/* ========================================================================
   BGC Premium Theme - Executive Dashboard Grade
   ========================================================================
   PRODUCT: BGC-PRD-003 (Dynamic Board Dashboards)
   TARGET: Lighthouse 100% = COSO IC-P14 + ISO 9001:7.4 + DPDP/WCAG

   COSO: IC-P14 (Internal Communication) - Consistent visual standards
   ISO: ISO-9001:7.4 (Communication) - Professional presentation
   DPDP: WCAG 2.1 AA - Accessibility compliance

   Jai Anusandhan - Equal Excellence for All Pages
   ======================================================================== */

:root {
  --color-bg-primary: #1a1a2e;
  --color-bg-secondary: #16213e;
  --color-bg-tertiary: #0f3460;
  --color-accent: #00d4ff;
  --color-accent-text: #00d4ff;
  --color-accent-hover: #00b8e6;
  --color-text-primary: #ffffff;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #b0b0b0;  /* WCAG 2.1 AA: 7.5:1 contrast on #1a1a2e */
  --color-btn-text: #0d0d18;
  --color-success: #4caf50;
  --color-warning: #ff9800;
  --color-error: #f44336;
  --color-info: #2196f3;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --border-radius: 12px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip Link - WCAG 2.1 A Bypass Blocks */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-btn-text);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Container - Premium Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--color-bg-secondary), rgba(0, 212, 255, 0.1));
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-logo {
  width: 40px;
  height: 40px;
}

.nav-brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
  background: rgba(0, 212, 255, 0.1);
}

/* Stats Row - Dashboard Metrics */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 212, 255, 0.4);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

.stat-card.critical .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-error));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card.warning .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card.success .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Content Panel - Card Style */
.content-card {
  background: var(--color-bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 212, 255, 0.2);
  margin-bottom: 1.5rem;
}

/* Typography - Executive Grade */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff, var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(0, 212, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 2px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 1.25rem 0 0.75rem;
}

/* Tables - Premium Dashboard Style */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
  background: linear-gradient(135deg, var(--color-bg-tertiary), rgba(0, 212, 255, 0.1));
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td {
  background: var(--color-bg-tertiary);
}

.data-table tr:hover td {
  background: rgba(0, 212, 255, 0.05);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Badges - Status Indicators */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-open {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-closed {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-in-progress {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-acknowledged {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-critical {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-high {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-medium {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-low {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Category Pills */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.category-pill {
  background: var(--color-bg-tertiary);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(0, 212, 255, 0.2);
  transition: var(--transition);
}

.category-pill:hover {
  border-color: rgba(0, 212, 255, 0.4);
}

.category-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.category-name {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* Donut Chart Container */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* Footer - Jai Anusandhan Branding */
.footer {
  margin-top: 2.5rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  background: var(--color-bg-tertiary);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 212, 255, 0.1);
}

.footer-brand {
  font-size: 1rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.footer-compliance {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.footer-compliance span {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .nav-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================
   Feedback Widget & Modal Styles (T-S2-004)
   ======================================================================== */

/* Visually Hidden - Accessible but hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Stats Grid (like stats-row but named for semantic clarity) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-sublabel {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Status Variants for stat-card */
.stat-card.status-good {
  border-color: rgba(76, 175, 80, 0.4);
}

.stat-card.status-good .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.status-warning {
  border-color: rgba(255, 152, 0, 0.4);
}

.stat-card.status-warning .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.status-critical {
  border-color: rgba(244, 67, 54, 0.4);
}

.stat-card.status-critical .stat-value {
  background: linear-gradient(135deg, #fff, var(--color-error));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Dashboard Section */
.dashboard-section {
  background: var(--color-bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* Breakdown Pills */
.breakdown-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.pill {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-bg-tertiary);
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.pill.status-good {
  border-color: rgba(76, 175, 80, 0.4);
  color: var(--color-success);
}

.pill.status-warning {
  border-color: rgba(255, 152, 0, 0.4);
  color: var(--color-warning);
}

.pill.status-critical {
  border-color: rgba(244, 67, 54, 0.4);
  color: var(--color-error);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Badge Variants */
.badge-success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-info {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-warning {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-default {
  background: rgba(158, 158, 158, 0.2);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* NPS Widget Trigger Button */
.nps-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.nps-widget-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #0099cc);
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.nps-widget-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
}

.nps-widget-trigger:focus {
  outline: 3px solid rgba(0, 212, 255, 0.5);
  outline-offset: 2px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(244, 67, 54, 0.2);
  color: var(--color-error);
}

.modal-content h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.modal-content h2::before {
  display: none;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  padding-bottom: 0.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--color-text-primary);
  background: rgba(0, 212, 255, 0.1);
}

.tab-btn.active {
  color: var(--color-accent);
  background: rgba(0, 212, 255, 0.2);
}

.tab-panel[hidden] {
  display: none;
}

/* NPS Scale */
.nps-question {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
  font-size: 1rem;
}

.nps-scale {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.nps-score-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: var(--color-text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nps-score-btn:hover {
  border-color: rgba(0, 212, 255, 0.5);
  transform: scale(1.1);
}

.nps-score-btn:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nps-score-btn.selected {
  transform: scale(1.15);
}

.nps-score-btn.selected.promoter {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border-color: #4caf50;
}

.nps-score-btn.selected.passive {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: #ff9800;
}

.nps-score-btn.selected.detractor {
  background: linear-gradient(135deg, #f44336, #c62828);
  border-color: #f44336;
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.form-group .required {
  color: var(--color-error);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-tertiary);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), #0099cc);
  color: var(--color-btn-text);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 1rem;
  margin-top: 1rem;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 8px;
  color: var(--color-success);
}

.success-message[hidden] {
  display: none;
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .nav-bar,
  .skip-link {
    display: none;
  }

  .container {
    padding: 0;
  }

  .content-card,
  .stat-card,
  .footer {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  h1, h2, h3, .stat-value {
    color: #333;
    -webkit-text-fill-color: #333;
    background: none;
  }

  .data-table {
    border: 1px solid #ccc;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #ddd;
    background: white;
  }

  .data-table th {
    background: #f5f5f5;
  }
}
