/* Lightning Brain Theme - Shared CSS Variables and Components */

/* ===== CSS VARIABLES ===== */
:root {
  /* Disney Classic Palette */
  --disney-navy: #12194A;
  --disney-blue: #393E8F;
  --disney-gold: #D4A017;
  --disney-red: #B12228;
  --disney-pink: #EFBEB7;
  --disney-white: #FFFFFF;
  --disney-light-gray: #f7fafd;
  
  /* Semantic Colors */
  --primary: var(--disney-blue);
  --primary-dark: var(--disney-navy);
  --secondary: var(--disney-gold);
  --accent: var(--disney-red);
  --warning: var(--disney-pink);
  --background: var(--disney-white);
  --background-alt: var(--disney-light-gray);
  --text-primary: var(--disney-navy);
  --text-secondary: #666666;
  --text-muted: #888888;
  
  /* Status Colors */
  --status-down: var(--disney-red);
  --status-normal: var(--disney-gold);
  --status-good: #28a745;
  --status-warning: #ffc107;
  --status-info: #17a2b8;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
  
  /* Typography */
  --font-family: 'Segoe UI', 'Inter', 'system-ui', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  margin: 0 0 var(--spacing-md) 0;
  font-weight: 600;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
  margin: 0 0 var(--spacing-md) 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== NAVIGATION ===== */
.topnav {
  background-color: var(--primary-dark);
  min-height: 48px;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.topnav a {
  float: left;
  color: var(--background);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  line-height: 20px;
  transition: background-color 0.2s, color 0.2s;
}

.topnav a:hover {
  background-color: var(--secondary);
  color: var(--text-primary);
}

.topnav a.active {
  background-color: var(--status-good);
  color: var(--background);
}

.topnav a.right {
  float: right;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: #333;
  color: var(--background);
  padding: 8px 16px 8px 8px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.dropbtn:hover {
  background-color: #555;
}

.profile-btn {
  min-width: 0;
  height: 40px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--background);
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dropdown-content a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  float: none;
  text-align: left;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: var(--background-alt);
  color: var(--text-primary);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Profile Icon */
.profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--background);
  border-radius: 50%;
  font-weight: bold;
  font-size: 16px;
  margin-right: 4px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.profile-icon.premium {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.crown-icon {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
}

/* Mobile Navigation */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--background);
  font-size: 24px;
  cursor: pointer;
  padding: 12px;
}

.hamburger-label {
  margin-left: 8px;
  font-size: 14px;
}

/* ===== TABLES ===== */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: var(--spacing-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--background);
  font-size: var(--font-size-base);
}

th {
  background: var(--primary);
  font-weight: 600;
  font-size: 1.08em;
  color: var(--background);
  padding: 12px 8px;
  border-bottom: 2px solid var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

td {
  padding: 10px 8px;
  font-size: 1.04em;
  border-bottom: 1px solid var(--background-alt);
  vertical-align: middle;
}

tr:nth-child(even) {
  background: rgba(57, 62, 143, 0.05);
}

tr:nth-child(odd) {
  background: var(--background-alt);
}

tr:hover {
  background: rgba(177, 34, 40, 0.1);
  transition: background 0.15s;
}

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

/* Sticky Columns */
th:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  background: var(--primary) !important;
  color: var(--background) !important;
  z-index: var(--z-sticky);
  font-weight: 600;
  max-width: 180px;
  min-width: 80px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 2px solid var(--secondary);
}
tbody td:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  background: inherit !important;
  color: inherit !important;
  z-index: var(--z-sticky);
  font-weight: 600;
  max-width: 180px;
  min-width: 80px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 2px solid var(--secondary);
}

/* Status Colors */
td[bgcolor='#F00'] {
  background: var(--status-down) !important;
  color: var(--background) !important;
  border-radius: 0;
  box-shadow: none;
}

/* ===== BUTTONS ===== */
.btn {
  background: var(--primary);
  color: var(--background);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: var(--secondary);
  color: var(--text-primary);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background: var(--text-secondary);
  color: var(--background);
}

.btn-secondary:hover {
  background: #5a6268;
  color: var(--background);
}

.btn-success {
  background: var(--status-good);
  color: var(--background);
}

.btn-success:hover {
  background: #218838;
  color: var(--background);
}

.btn-danger {
  background: var(--status-down);
  color: var(--background);
}

.btn-danger:hover {
  background: #c82333;
  color: var(--background);
}

.btn-warning {
  background: var(--status-warning);
  color: var(--text-primary);
}

.btn-warning:hover {
  background: #e0a800;
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
}

/* Timer Button */
.timer-btn {
  background: var(--status-down);
  color: var(--background);
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
  font-size: 0.98em;
}

.timer-btn.active {
  box-shadow: 0 0 0 2px rgba(177, 34, 40, 0.67);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(177, 34, 40, 0.67); }
  70% { box-shadow: 0 0 0 8px rgba(177, 34, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(177, 34, 40, 0.67); }
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background-color: var(--background);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(243, 204, 100, 0.2);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border: 2px solid var(--status-down) !important;
  background: #fff6f6 !important;
}

/* ===== CARDS ===== */
.card {
  background: var(--background-alt);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.alert-card {
  background: var(--background-alt);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  position: relative;
  margin-bottom: var(--spacing-md);
}

.alert-card h3 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--primary);
  font-size: 1.2em;
}

.alert-card p {
  margin: 5px 0;
  color: var(--primary);
}

.alert-card .date {
  font-size: 0.9em;
  color: var(--primary);
}

/* ===== BADGES ===== */
.badge {
  background: var(--secondary);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.95em;
  font-weight: 600;
  margin-left: 6px;
  display: inline-block;
}

.badge-here {
  background: var(--secondary);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.95em;
  font-weight: 600;
  margin-left: 6px;
  display: inline-block;
}

/* ===== SLIDER ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  height: 36px;
  margin: 16px 0 12px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--disney-red);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  margin-top: -11px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(57, 62, 143, 0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--disney-red);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(57, 62, 143, 0.2);
}

input[type="range"]::-ms-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--disney-red);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

input[type="range"]::-ms-fill-lower,
input[type="range"]::-ms-fill-upper {
  background: rgba(57, 62, 143, 0.2);
  border-radius: 5px;
}

input[type="range"]:focus {
  outline: none;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(57, 62, 143, 0.2);
  border: none;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: var(--disney-red);
  transition: .4s;
  border-radius: 50%;
  transform: none;
}

input:checked + .toggle-slider {
  background-color: rgba(57, 62, 143, 0.2);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-size: 0.9em;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s, font-weight 0.2s;
}

.toggle-label.active {
  color: #B12228;
  opacity: 1;
  font-weight: 700;
}

/* ===== MESSAGES ===== */
.message {
  padding: 15px;
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.message.success {
  background-color: var(--secondary);
  border-color: var(--primary);
  color: var(--text-primary);
}

.message.error {
  background-color: var(--warning);
  border-color: var(--status-down);
  color: var(--status-down);
}

.message.info {
  background-color: var(--background-alt);
  border-color: var(--status-info);
  color: var(--text-primary);
}

/* ===== CONTAINERS ===== */
.container {
  max-width: 1200px;
  margin: 40px auto 0 auto;
  background: var(--background);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  color: var(--text-primary);
}

.content {
  padding: var(--spacing-xl);
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
  .desktop-nav {
    display: none !important;
  }
  
  .hamburger {
    display: block;
  }
  
  .mobile-nav {
    display: block;
  }
  
  th, td {
    font-size: 0.98em;
    padding: 8px 4px;
  }
  
  h3 {
    font-size: 1.1em;
  }
  
  .container {
    margin: 8px 0 0 0 !important;
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
  }
  
  .content {
    padding: 10px 4px !important;
  }
}

@media (max-width: 600px) {
  th, td {
    font-size: 0.95em;
    padding: 7px 2px;
  }
  
  h3 {
    font-size: 1em;
  }
  
  table {
    font-size: 0.97em;
  }
  
  .two-column-layout {
    display: block !important;
  }
  
  .left-column, .right-column {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
}

/* ===== FAB (Floating Action Button) ===== */
.fab {
  display: none;
}

@media (max-width: 900px) {
  .fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: var(--z-fixed);
    background: var(--status-down);
    color: var(--background);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2.2em;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .fab:hover {
    background: #F15025;
  }
}

/* ===== SIDEBAR DRAWER ===== */
.sidebar-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.25);
  z-index: var(--z-modal-backdrop);
  display: flex;
  justify-content: flex-end;
}

.sidebar-drawer {
  width: 90vw;
  max-width: 370px;
  height: 100vh;
  background: var(--background);
  box-shadow: -2px 0 16px rgba(0,0,0,0.12);
  padding: 24px 18px 18px 18px;
  overflow-y: auto;
  position: relative;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-drawer.visible {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 2em;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--background);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 24px 24px 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
}

/* ===== DATA TABLES OVERRIDES ===== */
/* Override DataTables default styles to match theme */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  color: var(--text-primary);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--primary) !important;
  border: 1px solid var(--primary);
  background: var(--background);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--secondary);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: var(--background) !important;
  border-color: var(--primary);
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .topnav,
  .fab,
  .sidebar-drawer-overlay,
  .modal-overlay {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  table {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  
  th {
    background: #f0f0f0 !important;
    color: black !important;
  }
}

table + h3 {
  margin-top: 36px;
}

.rel-high, .rel-slightlyhigh {
  color: var(--disney-gold) !important;
  font-weight: bold;
} 