/* =============================================
   StrigLab TV Mode Styles
   ============================================= */

/* Prevent ALL scrolling in TV mode — everything must fit in 100vh */
body.tv-mode,
body.tv-mode html {
  overflow: hidden !important;
}

body.tv-mode .sidebar {
  display: none;
}

body.tv-mode .main-wrapper {
  margin-left: 0;
  overflow: hidden;
  height: 100vh;
}

body.tv-mode .topbar {
  left: 0;
  height: 60px;
}

body.tv-mode .main-content {
  margin-top: 60px;
  padding: var(--space-4);
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
  max-width: 100vw;
}

body.tv-mode .page-header {
  margin-bottom: var(--space-4);
}

body.tv-mode .page-title {
  font-size: var(--font-size-2xl);
}

/* Make KPIs larger */
body.tv-mode .kpi-row {
  margin-bottom: var(--space-2);
}
body.tv-mode .kpi-card {
  padding: var(--space-3);
}
body.tv-mode .kpi-value {
  font-size: var(--font-size-xl);
}
body.tv-mode .kpi-icon {
  width: 44px;
  height: 44px;
  font-size: var(--font-size-lg);
}

/* Make Finance larger */
body.tv-mode .finance-row {
  margin-bottom: var(--space-2);
}
body.tv-mode .finance-card {
  padding: var(--space-3);
}
body.tv-mode .finance-value {
  font-size: var(--font-size-xl);
}

/* Make Charts row larger */
body.tv-mode .charts-row {
  margin-bottom: var(--space-5);
  flex: 1; /* allow it to grow in TV mode */
}
body.tv-mode .chart-card {
  display: flex;
  flex-direction: column;
}
body.tv-mode .chart-body {
  flex: 1;
}

/* Bottom row */
body.tv-mode .bottom-row {
  flex: 1; /* allow it to grow */
}
body.tv-mode .bottom-row .card {
  display: flex;
  flex-direction: column;
}

/* Increase text sizes for readability from afar */
body.tv-mode .chart-card-title,
body.tv-mode .finance-label,
body.tv-mode .kpi-label {
  font-size: var(--font-size-md);
}

body.tv-mode .kpi-sub,
body.tv-mode .finance-sub,
body.tv-mode .chart-card-subtitle,
body.tv-mode .activity-text {
  font-size: var(--font-size-sm);
}

body.tv-mode .avatar-sm {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-sm);
}

/* Hide interactive elements in TV mode */
body.tv-mode .topbar-btn:not(.tv-btn),
body.tv-mode .chart-toggle-btns,
body.tv-mode .filter-select,
body.tv-mode .theme-toggle {
  display: none !important;
}

body.tv-mode .tv-btn {
  background: #ef4444 !important; /* Red to indicate it's active and clickable to exit */
  color: white;
}
body.tv-mode .tv-btn::after {
  content: ' Sair';
}

/* Remove wasted padding-bottom in TV mode so content fits in 100vh */
body.tv-mode .chart-body {
  padding-bottom: 0 !important;
}

/* Compress funnel in TV mode so all rows fit without overflow */
body.tv-mode .funnel-chart-wrap {
  gap: 4px !important;
  padding: 0 10px !important;
}

body.tv-mode .funnel-row {
  gap: 15px !important;
}

body.tv-mode .funnel-bar {
  max-height: 24px !important;
  height: 100% !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

body.tv-mode .funnel-label {
  width: 160px !important;
  gap: 8px !important;
  font-size: 14px !important;
}

body.tv-mode .funnel-label .funnel-label-name {
  font-size: 14px !important;
}
body.tv-mode .funnel-label .funnel-label-count {
  font-size: 13px !important;
}

/* === TV Mode Layout Grid === */
.tv-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto 1fr 1fr;
  gap: 15px;
  height: 100%;
}

/* === TV Micro Stats === */
.tv-micro-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 10px;
  transition: transform 0.2s;
}

.tv-micro-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 5px;
}

.tv-micro-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.tv-micro-lab {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}
