/* Root Variables */
:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #06b6d4;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Dark theme variables */
[data-bs-theme="dark"] {
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 400px;
}

.flash-messages .alert {
  margin-bottom: 10px;
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1040;
}

.theme-toggle .btn {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.theme-toggle .btn:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.theme-toggle .btn i {
  font-size: 1.2rem;
  color: inherit;
}

.theme-toggle .dropdown-menu {
  bottom: 60px;
  right: 0;
  top: auto;
  transform: translateY(0);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  background-color: var(--bg-primary);
}

.theme-toggle .dropdown-item {
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.theme-toggle .dropdown-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--primary-color);
}

.theme-toggle .dropdown-item.active,
.theme-toggle .dropdown-item:active {
  background-color: var(--primary-color);
  color: white;
}

.theme-toggle .dropdown-item i {
  color: inherit;
}

/* Authentication Styles */
.auth-container {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-form .form-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.auth-form .form-label i {
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.auth-form .form-control {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.auth-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
  background-color: var(--bg-primary);
  outline: none;
}

.auth-form .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 2.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 10;
}

/* Password toggle for floating labels */
.form-floating .password-toggle {
  top: 50%;
  transform: translateY(-50%);
  right: 0.75rem;
}

.password-toggle:hover {
  color: var(--primary-color);
  background-color: var(--bg-tertiary);
}

.auth-btn {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
}

.auth-link:hover {
  color: var(--primary-hover);
  background-color: var(--bg-tertiary);
  text-decoration: none;
}

.auth-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Hero Section */
.auth-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%236366f1" fill-opacity="0.05" fill-rule="nonzero"><path d="m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>') repeat;
  opacity: 0.3;
}

.auth-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 500px;
  color: white;
}

.hero-icon {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.hero-icon i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.hero-icon i:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: white;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-features {
  display: grid;
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

.feature-item i {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  min-width: 2rem;
}

.feature-item span {
  font-weight: 500;
  color: white;
}

/* Dashboard Styles */
.dashboard-container {
  min-height: 100vh;
  background-color: var(--bg-secondary);
}

/* Dashboard Card Uniformity */
.dashboard-cards .card {
  height: 280px;
  min-height: 280px;
  transition: all 0.3s ease;
  border: none;
  box-shadow: var(--shadow-md);
}

.dashboard-cards .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dashboard-cards .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  position: relative;
}

.dashboard-cards .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.dashboard-cards .card-icon {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.dashboard-cards .card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.dashboard-cards .card-text {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.dashboard-cards .card-text.small {
  font-size: 0.8rem;
  opacity: 0.9;
}

.dashboard-cards .card-button {
  margin-top: auto;
  padding-top: 1rem;
  text-align: center;
}

/* Responsive adjustments for dashboard cards */
@media (max-width: 992px) {
  .dashboard-cards .card {
    height: 250px;
    min-height: 250px;
  }
}

@media (max-width: 768px) {
  .dashboard-cards .card {
    height: 200px;
    min-height: 200px;
  }
  
  .dashboard-cards .card-body {
    padding: 1rem;
  }
  
  .dashboard-cards .card-icon i {
    font-size: 2rem !important;
    margin-bottom: 0.5rem;
  }
  
  .dashboard-cards .card-title {
    font-size: 1.1rem;
  }
  
  .dashboard-cards .card-text {
    font-size: 0.85rem;
  }
}

/* Form Validation */
.form-control:invalid {
  border-color: var(--danger-color);
}

.form-control:valid {
  border-color: var(--success-color);
}

.password-strength {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-form-container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-icon {
    gap: 1rem;
  }
  
  .hero-icon i {
    font-size: 2rem;
    padding: 1rem;
  }
  
  .theme-toggle {
    bottom: 100px;
    right: 15px;
  }
  
  .flash-messages {
    left: 15px;
    right: 15px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .auth-form-container {
    border-radius: 16px;
  }
  
  .auth-logo {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .hero-icon {
    flex-direction: column;
    gap: 1rem;
  }
  
  .feature-item {
    padding: 0.75rem;
  }
}

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-form-container {
  animation: fadeInUp 0.6s ease-out;
}

.auth-hero-content {
  animation: slideInRight 0.8s ease-out 0.2s both;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Focus styles for accessibility */
.form-control:focus,
.btn:focus,
.auth-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
  }
  
  [data-bs-theme="dark"] {
    --border-color: #ffffff;
  }
}

/* Table Styling */
.table-current-user {
  background-color: rgba(99, 102, 241, 0.08) !important;
  border-left: 4px solid var(--primary-color);
}

.table-current-user td {
  color: var(--text-primary);
  font-weight: 500;
}

.table-current-user .text-muted {
  color: var(--text-secondary) !important;
  font-weight: 600;
}

[data-bs-theme="dark"] .table-current-user {
  background-color: rgba(99, 102, 241, 0.15) !important;
  border-left: 4px solid var(--primary-color);
}

[data-bs-theme="dark"] .table-current-user td {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .table-current-user .text-muted {
  color: #cbd5e1 !important;
  font-weight: 600;
}

/* System Status Cards */
.status-card-mqtt-broker {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white !important;
  border: none;
  transition: all 0.3s ease;
}

.status-card-mqtt-broker:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.status-card-mqtt-client {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white !important;
  border: none;
  transition: all 0.3s ease;
}

.status-card-mqtt-client:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.status-card-mqtt-remote {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white !important;
  border: none;
  transition: all 0.3s ease;
}

.status-card-mqtt-remote.not-configured {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.status-card-mqtt-remote:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.status-card-mqtt-remote.not-configured:hover {
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.status-card-database {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white !important;
  border: none;
  transition: all 0.3s ease;
}

.status-card-database:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(20, 184, 166, 0.3);
}

/* Dark theme adjustments for status cards */
[data-bs-theme="dark"] .status-card-mqtt-broker {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

[data-bs-theme="dark"] .status-card-mqtt-client {
  background: linear-gradient(135deg, #164e63 0%, #155e75 100%);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

[data-bs-theme="dark"] .status-card-mqtt-remote {
  background: linear-gradient(135deg, #581c87 0%, #6b21a8 100%);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

[data-bs-theme="dark"] .status-card-mqtt-remote.not-configured {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

[data-bs-theme="dark"] .status-card-database {
  background: linear-gradient(135deg, #134e4a 0%, #115e59 100%);
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.2);
}

/* Status card content styling */
.status-card-mqtt-broker .card-body,
.status-card-mqtt-client .card-body,
.status-card-mqtt-remote .card-body,
.status-card-database .card-body {
  position: relative;
  z-index: 2;
}

.status-card-mqtt-broker .card-title,
.status-card-mqtt-client .card-title,
.status-card-mqtt-remote .card-title,
.status-card-database .card-title {
  color: white !important;
  font-weight: 600;
}

.status-card-mqtt-broker .card-text,
.status-card-mqtt-client .card-text,
.status-card-mqtt-remote .card-text,
.status-card-database .card-text {
  color: rgba(255, 255, 255, 0.9) !important;
}

.status-card-mqtt-broker .fas,
.status-card-mqtt-client .fas,
.status-card-mqtt-remote .fas,
.status-card-database .fas {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Badge styling on colored cards */
.status-card-mqtt-broker .badge,
.status-card-mqtt-client .badge,
.status-card-mqtt-remote .badge,
.status-card-database .badge {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.status-card-mqtt-broker .badge.bg-success,
.status-card-mqtt-client .badge.bg-success,
.status-card-database .badge.bg-success {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #059669 !important;
}

.status-card-mqtt-remote .badge.bg-warning {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #d97706 !important;
}

.status-card-mqtt-remote .badge.bg-secondary {
  background-color: rgba(255, 255, 255, 0.7) !important;
  color: #374151 !important;
}

.status-card-mqtt-remote .badge.bg-success {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #059669 !important;
}

/* LCS Devices - Lights functionality */
.lights-section {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--primary-color);
  margin: 0.5rem 0;
}

.lights-section-header {
  background-color: var(--bg-tertiary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.lights-section-header h6 {
  color: var(--text-primary) !important;
  font-weight: 600;
}

[data-bs-theme="dark"] .lights-section-header {
  background-color: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.lights-table {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.lights-table .table {
  margin-bottom: 0;
}

.lights-table .table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem;
}

.lights-table .table td {
  padding: 0.5rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

.lights-toggle-btn {
  transition: all 0.3s ease;
}

.lights-toggle-btn:hover {
  transform: translateY(-1px);
}

.badge-light-on {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.badge-light-off {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.badge-switch-on {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.badge-switch-off {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

/* Timeslots filtering */
.filter-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.filter-section .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
}

.filter-section .form-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.filter-section .form-control,
.filter-section .form-select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-buttons .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

/* Status badges enhancements */
.badge-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Light status specific badges */
.light-status-operational {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.light-status-maintenance {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.light-status-damaged {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Timeslots Summary Cards - Colorful */
.timeslots-summary-cards .card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.timeslots-summary-cards .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.timeslots-summary-cards .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
}

.timeslots-summary-cards .card-total::before {
  background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
}

.timeslots-summary-cards .card-active::before {
  background: linear-gradient(90deg, var(--info-color), #06b6d4);
}

.timeslots-summary-cards .card-pending::before {
  background: linear-gradient(90deg, var(--warning-color), #f59e0b);
}

.timeslots-summary-cards .card-completed::before {
  background: linear-gradient(90deg, var(--success-color), #10b981);
}

.timeslots-summary-cards .card-total {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.timeslots-summary-cards .card-active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.timeslots-summary-cards .card-pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.timeslots-summary-cards .card-completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.timeslots-summary-cards .card-body {
  text-align: center;
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.timeslots-summary-cards .card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.timeslots-summary-cards .card-total .card-title {
  color: var(--primary-color);
}

.timeslots-summary-cards .card-active .card-title {
  color: var(--info-color);
}

.timeslots-summary-cards .card-pending .card-title {
  color: var(--warning-color);
}

.timeslots-summary-cards .card-completed .card-title {
  color: var(--success-color);
}

.timeslots-summary-cards h4 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.timeslots-summary-cards .card-total h4 {
  color: var(--primary-color);
  text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.timeslots-summary-cards .card-active h4 {
  color: var(--info-color);
  text-shadow: 0 2px 4px rgba(6, 182, 212, 0.2);
}

.timeslots-summary-cards .card-pending h4 {
  color: var(--warning-color);
  text-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.timeslots-summary-cards .card-completed h4 {
  color: var(--success-color);
  text-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Dark theme adjustments for timeslots summary cards */
[data-bs-theme="dark"] .timeslots-summary-cards .card-total {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

[data-bs-theme="dark"] .timeslots-summary-cards .card-active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

[data-bs-theme="dark"] .timeslots-summary-cards .card-pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-bs-theme="dark"] .timeslots-summary-cards .card-completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Theme-aware table head for LCS devices lights table */
.theme-aware-table-head {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .theme-aware-table-head {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* ========================================
   LIGHT CONTROL SYSTEM STYLES
   ======================================== */

/* Light Control Button Base Styles */
.light-control-btn {
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 85px;
  position: relative;
  overflow: hidden;
  user-select: none;
  outline: none;
}

.light-control-btn:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Light State: ON */
.light-control-btn.state-on {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  border: 2px solid transparent;
}

.light-control-btn.state-on:hover:not(.state-pending) {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Light State: OFF */
.light-control-btn.state-off {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-control-btn.state-off:hover:not(.state-pending) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Light State: PENDING */
.light-control-btn.state-pending {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  color: white;
  cursor: wait;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  border: 2px solid transparent;
}

/* Spinner animation for pending state */
.light-control-btn.state-pending .light-icon i {
  animation: spin 1s linear infinite;
}

/* Shimmer effect for pending state */
.light-control-btn.state-pending::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Light Icon Styles */
.light-control-btn .light-icon {
  display: inline-flex;
  align-items: center;
}

.light-control-btn .light-text {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Pulse animation for MQTT updates */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { 
    transform: scale(1.05); 
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  }
  100% { transform: scale(1); }
}

.light-control-btn.mqtt-update {
  animation: pulse 0.6s ease-in-out;
}

/* Status refresh animation */
.light-control-btn.status-updated {
  animation: statusUpdate 0.5s ease-in-out;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

@keyframes statusUpdate {
  0% { 
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    transform: scale(1.02);
  }
  100% { 
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    transform: scale(1);
  }
}

/* Spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Shimmer animation */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .time-header,
[data-bs-theme="dark"] .light-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .time-cell {
    background: var(--bg-tertiary);
}

[data-bs-theme="dark"] .schedule-cell:not(.status-active) {
    background: #0f172a;
    border-color: #475569;
}

.schedule-cell:not([class*="status-"]) {
    background: #0f172a;
    border-color: #475569;
}

[data-bs-theme="dark"] .schedule-cell:not([class*="status-"]):hover {
    background: #1e293b !important;
    border-color: var(--primary-color) !important;
}

[data-bs-theme="dark"] .schedule-cell.current-hour-cell {
    background: rgba(99, 102, 241, 0.15);
    border-color: #475569;
}

[data-bs-theme="dark"] .schedule-cell:not([class*="status-"]) {
    background: #0f172a;
    border-color: #020617;
}

[data-bs-theme="dark"] .schedule-cell.current-hour-cell {
    background: rgba(99, 102, 241, 0.15);
    border-color: #020617;
}

[data-bs-theme="dark"] .light-control-btn.state-off:hover:not(.state-pending) {
  background: #475569;
  color: var(--text-primary);
  border-color: var(--primary-color);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .light-control-btn {
    min-width: 75px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .light-control-btn .light-text {
    font-size: 0.75rem;
  }
}

/* Accessibility - High contrast mode */
@media (prefers-contrast: high) {
  .light-control-btn.state-on {
    background: #059669;
    border: 3px solid #047857;
  }
  
  .light-control-btn.state-off {
    background: white;
    color: black;
    border: 3px solid #374151;
  }
}

/* Loading states for lights table */
.lights-section-loading {
  position: relative;
}

.lights-section-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

[data-bs-theme="dark"] .lights-section-loading::after {
  background: rgba(15, 23, 42, 0.8);
}

/* Error state for light controls */
.light-control-btn.state-error {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: white;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .light-control-btn {
    transition: none;
  }
  
  .light-control-btn:hover {
    transform: none;
  }
  
  /* Timeslots page reduced motion */
  .schedule-cell {
    transition: none;
  }
  
  .schedule-cell:hover {
    transform: none;
  }
  
  .status-active {
    animation: none;
  }
  
  .legend-item:hover {
    transform: none;
  }
  
  .timeslots-date-navigation .btn:hover {
    transform: none;
  }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
  .schedule-cell.status-pending { 
    background: #ff8c00 !important; 
    border: 3px solid #cc7000 !important; 
  }
  
  .schedule-cell.status-active { 
    background: #00aa00 !important; 
    border: 3px solid #008800 !important; 
  }
  
  .schedule-cell.status-done { 
    background: #0066cc !important; 
    border: 3px solid #004499 !important; 
  }
  
  .schedule-cell.status-cancelled { 
    background: #cc0000 !important; 
    border: 3px solid #990000 !important; 
  }
  
  .legend-color.status-pending { 
    background: #ff8c00 !important; 
    border: 3px solid #cc7000 !important; 
  }
  
  .legend-color.status-active { 
    background: #00aa00 !important; 
    border: 3px solid #008800 !important; 
  }
  
  .legend-color.status-done { 
    background: #0066cc !important; 
    border: 3px solid #004499 !important; 
  }
  
  .legend-color.status-cancelled { 
    background: #cc0000 !important; 
    border: 3px solid #990000 !important; 
  }
  
  .booking-indicator {
    border: 2px solid white !important;
    font-weight: 800;
  }
}

/* Light State Display (Read-only for non-admin users) */
.light-state-display {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 80px;
  justify-content: center;
}

.light-state-display.state-on {
  background-color: var(--bs-success);
  color: white;
}

.light-state-display.state-off {
  background-color: var(--bs-secondary);
  color: white;
}

.light-state-display .light-icon {
  margin-right: 0.25rem;
}

.light-state-display .light-text {
  font-weight: 600;
}

/* Dark theme adjustments for light state display */
[data-bs-theme="dark"] .light-state-display.state-off {
  background-color: #495057;
  color: white;
}

/* System Time Card Styling */
.status-card-system-time-bg {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.status-card-system-time-bg:hover {
  background-color: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Dark theme adjustments for system time card */
[data-bs-theme="dark"] .status-card-system-time-bg {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .status-card-system-time-bg:hover {
    background-color: #475569;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   NEW TIMESLOTS GRID STYLES (Variable Height)
   ======================================== */

/* New Timeslots Grid Container */
.timeslots-grid-new {
    display: flex;
    flex-direction: column;
    height: 70vh;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Timeslots Header */
.timeslots-header {
    display: flex;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--border-color);
    z-index: 10;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.light-header-new {
    flex: 1;
    min-width: 150px;
    padding: 1rem 0.75rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.light-header-new:last-child {
    border-right: none;
}

.light-header-new .light-header-description {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.1;
    word-break: break-word;
    hyphens: auto;
}

/* Timeslots Content Area */
.timeslots-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.device-timeslots-column {
    flex: 1;
    min-width: 150px;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.device-timeslots-column:last-child {
    border-right: none;
}

/* Timeslots Timeline */
.timeslots-timeline {
    position: relative;
    height: 100%;
    background: linear-gradient(to bottom,
        var(--bg-primary) 0%,
        var(--bg-secondary) 100%);
}

/* Hour markers (optional visual guides) */
.timeslots-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(100% / 24 - 1px),
        var(--border-color) calc(100% / 24 - 1px),
        var(--border-color) calc(100% / 24)
    );
    opacity: 0.3;
    pointer-events: none;
}

/* Timeslot Blocks */
.timeslot-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 6px;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow: hidden;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 20px;
}

.timeslot-block:hover {
    transform: translateX(2px) scale(1.02);
    z-index: 20;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color) !important;
}

/* Timeslot Content */
.timeslot-time-range {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 0.1rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.timeslot-booking-id {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 0.1rem;
}

.timeslot-status {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeslot Status Colors */
.timeslot-block.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.timeslot-block.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid #10b981;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4), 0 0 15px rgba(16, 185, 129, 0.2);
    animation: modernPulse 2.5s ease-in-out infinite;
}

.timeslot-block.status-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: 1px solid #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.timeslot-block.status-cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 1px solid #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    opacity: 0.9;
}

/* Current Time Indicator */
.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    z-index: 15;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

/* Dark Theme Adjustments */
[data-bs-theme="dark"] .timeslots-grid-new {
    background: #0f172a;
    border-color: #475569;
}

[data-bs-theme="dark"] .timeslots-header,
[data-bs-theme="dark"] .light-header-new {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .timeslots-timeline {
    background: linear-gradient(to bottom,
        var(--bg-primary) 0%,
        var(--bg-tertiary) 100%);
}

[data-bs-theme="dark"] .timeslots-timeline::before {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(100% / 24 - 1px),
        #475569 calc(100% / 24 - 1px),
        #475569 calc(100% / 24)
    );
}

[data-bs-theme="dark"] .device-timeslots-column {
    border-color: #475569;
}

/* Dark theme status color enhancements */
[data-bs-theme="dark"] .timeslot-block.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] .timeslot-block.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.5), 0 0 15px rgba(16, 185, 129, 0.3) !important;
    animation: modernPulse 2.5s ease-in-out infinite !important;
}

[data-bs-theme="dark"] .timeslot-block.status-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4) !important;
}

[data-bs-theme="dark"] .timeslot-block.status-cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
}

/* Responsive Design for New Timeslots Grid */
@media (max-width: 768px) {
    .timeslots-grid-new {
        height: 60vh;
        margin: 0 -10px;
        border-radius: 12px;
    }

    .light-header-new {
        min-width: 120px;
        padding: 0.6rem 0.4rem;
    }

    .light-header-new .light-header-description {
        font-size: 1rem;
        line-height: 1.0;
    }

    .device-timeslots-column {
        min-width: 120px;
    }

    .timeslot-time-range {
        font-size: 0.6rem;
    }

    .timeslot-booking-id {
        font-size: 0.55rem;
    }

    .timeslot-status {
        font-size: 0.55rem;
    }

    .timeslot-block {
        left: 2px;
        right: 2px;
        min-height: 16px;
    }
}

@media (max-width: 480px) {
    .timeslots-grid-new {
        height: 50vh;
    }

    .light-header-new {
        min-width: 100px;
        padding: 0.5rem 0.3rem;
    }

    .light-header-new .light-header-description {
        font-size: 0.9rem;
        -webkit-line-clamp: 1;
    }

    .device-timeslots-column {
        min-width: 100px;
    }

    .timeslot-time-range {
        font-size: 0.55rem;
    }

    .timeslot-booking-id {
        font-size: 0.5rem;
    }

    .timeslot-status {
        font-size: 0.5rem;
    }

    .timeslot-block {
        left: 1px;
        right: 1px;
        min-height: 14px;
        padding: 0.2rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeslot-block {
        transition: none;
    }

    .timeslot-block:hover {
        transform: none;
    }

    .timeslot-block.status-active {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .timeslot-block.status-pending {
        background: #ff8c00 !important;
        border: 2px solid #cc7000 !important;
    }

    .timeslot-block.status-active {
        background: #00aa00 !important;
        border: 2px solid #008800 !important;
    }

    .timeslot-block.status-done {
        background: #0066cc !important;
        border: 2px solid #004499 !important;
    }

    .timeslot-block.status-cancelled {
        background: #cc0000 !important;
        border: 2px solid #990000 !important;
    }
}

/* ========================================
   TIMESLOTS PAGE RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .timeslots-grid-container {
        border-radius: 12px;
        max-height: 60vh;
        margin: 0 -10px;
    }
    
    .schedule-cell {
        height: 45px;
        width: 130px;
        margin: 1px;
        border-radius: 6px;
    }
    
    .time-header, .light-header {
        padding: 0.5rem;
        font-size: 0.8rem;
        height: 2.5rem;
    }
    
    .light-header-description {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .time-cell {
        font-size: 0.8rem;
        padding: 0.5rem;
        min-width: 45px;
        width: 45px;
    }
    
    .timeslots-date-navigation {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
        margin: 1rem -10px;
        border-radius: 16px;
    }
    
    .timeslots-date-navigation .current-date {
        font-size: 1.5rem;
        min-width: 200px;
    }
    
    .timeslots-date-navigation .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
    }
    
    .legend-items {
        gap: 1rem;
    }
    
    .legend-item {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .legend-color {
        width: 24px;
        height: 24px;
    }
    
    .booking-indicator {
        font-size: 0.6rem;
        padding: 1px 4px;
        bottom: 2px;
        right: 4px;
    }
    
    .current-time-info {
        padding: 0.75rem 1rem;
        margin: 1rem -10px;
        border-radius: 12px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .schedule-cell {
        height: 40px;
        width: 100px;
        margin: 1px;
    }
    
    .light-header-description {
        font-size: 0.9rem;
        -webkit-line-clamp: 1;
    }
    
    .time-cell {
        font-size: 0.75rem;
        min-width: 40px;
        width: 40px;
        padding: 0.25rem;
    }
    
    .timeslots-date-navigation .current-date {
        font-size: 1.25rem;
        min-width: 150px;
    }
    
    .legend-items {
        flex-direction: column;
        align-items: center;
    }
    
    .legend-item {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* ========================================
   AUTO/MANUAL SWITCH STYLES
   ======================================== */

/* Auto/Manual Toggle Switch */
.auto-manual-switch {
  position: relative;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  width: 120px;
  height: 36px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--warning-color) 0%, var(--warning-color) 100%);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auto-manual-switch.manual-mode {
  background: linear-gradient(90deg, var(--warning-color) 0%, var(--warning-color) 100%);
}

.auto-manual-switch.auto-mode {
  background: linear-gradient(90deg, #059669 0%, #059669 100%);
}

.auto-mode-text, .manual-mode-text {
  font-size: 0.75rem;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.auto-mode-text.active, .manual-mode-text.active {
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hover effects */
.auto-manual-switch:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.auto-manual-switch:hover .auto-mode-text:not(.active),
.auto-manual-switch:hover .manual-mode-text:not(.active) {
  color: rgba(255, 255, 255, 0.95);
}

/* Pending state for switch */
.auto-manual-switch.mode-pending {
  cursor: wait;
  opacity: 0.7;
}

.auto-manual-switch.mode-pending .auto-mode-text,
.auto-manual-switch.mode-pending .manual-mode-text {
  opacity: 0.6;
}

/* Disabled state for light control when in auto mode */
.light-control-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.light-control-disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: inherit;
  z-index: 1;
}

[data-bs-theme="dark"] .light-control-disabled::after {
  background: rgba(15, 23, 42, 0.7);
}

/* ========================================
   REFRESH DATA BUTTON ENHANCED STATES
   ======================================== */

/* Base refresh button styling */
.btn-refresh-data {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  min-width: 150px;
}

/* Refresh button states */
.btn-refresh-data.state-sending {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  border-color: #06b6d4;
  color: white;
}

.btn-refresh-data.state-waiting {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border-color: #8b5cf6;
  color: white;
}

.btn-refresh-data.state-processing {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  color: white;
  animation: processingPulse 2s ease-in-out infinite;
}

.btn-refresh-data.state-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: white;
}

.btn-refresh-data.state-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
  color: white;
  animation: errorShake 0.5s ease-in-out;
}

.btn-refresh-data.state-timeout {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #f97316;
  color: white;
}

/* Processing pulse animation */
@keyframes processingPulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.8; 
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  }
}

/* Error shake animation */
@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Progress indicator styles */
.refresh-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

.refresh-progress-bar::after {
  content: '';
  position: absolute;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: progressShimmer 3s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Status text enhancements */
.refresh-status-text {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.refresh-status-icon {
  display: inline-flex;
  align-items: center;
}

/* Spinner variations for different states */
.refresh-status-icon .fa-paper-plane {
  animation: paperPlaneFloat 2s ease-in-out infinite;
}

.refresh-status-icon .fa-satellite-dish {
  animation: satellitePulse 2s ease-in-out infinite;
}

.refresh-status-icon .fa-cogs {
  animation: spin 2s linear infinite;
}

@keyframes paperPlaneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes satellitePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Success checkmark animation */
.refresh-status-icon .fa-check {
  animation: checkmarkBounce 0.6s ease-out;
}

@keyframes checkmarkBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Disabled state during refresh */
.btn-refresh-data:disabled {
  cursor: wait;
}

.btn-refresh-data:disabled:hover {
  transform: none;
}

/* Dark theme adjustments for refresh button */
[data-bs-theme="dark"] .btn-refresh-data.state-processing {
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

[data-bs-theme="dark"] .refresh-progress-bar {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .btn-refresh-data {
    min-width: 130px;
    font-size: 0.875rem;
  }
  
  .refresh-status-text {
    font-size: 0.8rem;
  }
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn-refresh-data.state-processing {
    animation: none;
  }
  
  .refresh-status-icon .fa-paper-plane,
  .refresh-status-icon .fa-satellite-dish,
  .refresh-status-icon .fa-cogs {
    animation: none;
  }
  
  .refresh-progress-bar::after {
    animation: none;
  }
}

/* ========================================
   TIMESLOTS CALENDAR GRID STYLES
   ======================================== */

/* Date Navigation - Modern Design */
.timeslots-date-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.timeslots-date-navigation .current-date {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    min-width: 280px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.timeslots-date-navigation .btn {
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.timeslots-date-navigation .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
}

.timeslots-date-navigation .btn:active {
    transform: translateY(-1px);
}

/* Grid Container */
.timeslots-grid-container {
    overflow-x: auto;
    border-radius: 8px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

/* Light theme grid container enhancements */
:root .timeslots-grid-container {
    background: #ffffff;
    border-color: #94a3b8;
}

/* Dark theme grid container enhancements */
[data-bs-theme="dark"] .timeslots-grid-container {
    border-color: #475569;
    background: #0f172a;
}

/* Webkit Scrollbar Styling for Timeslots Grid */
.timeslots-grid-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.timeslots-grid-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.timeslots-grid-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    opacity: 0.7;
}

.timeslots-grid-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    opacity: 1;
}

/* Grid Table */
.timeslots-grid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    position: relative;
    border: 2px solid var(--border-color);
}

/* Enhanced table borders for grid visibility */
.timeslots-grid-table td {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.timeslots-grid-table th {
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Light theme table border enhancements */
:root .timeslots-grid-table {
    border-color: #94a3b8;
}

:root .timeslots-grid-table td {
    border-color: #94a3b8;
}

:root .timeslots-grid-table th {
    border-color: #94a3b8;
}

/* Dark theme table border enhancements */
[data-bs-theme="dark"] .timeslots-grid-table {
    border-color: #475569;
}

[data-bs-theme="dark"] .timeslots-grid-table td {
    border-color: #475569;
}

[data-bs-theme="dark"] .timeslots-grid-table th {
    border-color: #475569;
}

/* Headers */
.time-header, .light-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: 1rem 0.75rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.time-header.sticky-time {
    position: sticky;
    left: 0;
    z-index: 15;
    min-width: 55px;
    width: 55px;
    padding: 1rem 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    border-right: 2px solid var(--border-color);
}

.light-header {
    min-width: 150px;
    width: 150px;
    border-right: 1px solid var(--border-color);
    height: 3rem;
    padding: 0.5rem 0.75rem;
}

.light-header-description {
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.1;
    word-break: break-word;
    hyphens: auto;
}

/* Time Cells */
.time-cell {
    background: var(--bg-secondary);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-right: 2px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 55px;
    width: 55px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.time-cell.current-hour {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Schedule Cells - Modern Design */
.schedule-cell {
    width: 150px;
    height: 50px;
    border-radius: 8px;
    margin: 2px;
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    background: var(--bg-primary);
    vertical-align: middle;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.schedule-cell:hover {
    transform: translateY(-2px) scale(1.02);
    z-index: 20;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color) !important;
}

/* Empty cells - theme-aware styling */
.schedule-cell:not([class*="status-"]) {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.schedule-cell:not([class*="status-"]):hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Light theme specific grid enhancements */
:root .schedule-cell:not([class*="status-"]) {
    background: #ffffff;
    border: 1px solid #94a3b8;
}

:root .schedule-cell:not([class*="status-"]):hover {
    background: #f8fafc;
    border-color: var(--primary-color);
}

/* Current Hour Highlighting */
.schedule-cell.current-hour-cell {
    border-top: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    position: relative;
}

.schedule-cell.current-hour-cell::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: shimmer 3s infinite;
}

/* Jump to current time highlight animation */
.current-hour-highlight {
    animation: currentHourPulse 2s ease-in-out;
}

@keyframes currentHourPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    25% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
    50% { 
        transform: scale(1.03); 
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
    }
    75% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Status Colors - Modern Gradient Design */
.schedule-cell.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.schedule-cell.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
    font-weight: 600;
    animation: modernPulse 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.schedule-cell.status-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.schedule-cell.status-cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    font-weight: 600;
    opacity: 0.9;
    position: relative;
    overflow: hidden;
}

/* Continuous Booking Border */
.schedule-cell.continuous-booking {
    border: 3px solid #f59e0b !important;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Status Indicator - REMOVED to allow full cell color coverage */

/* Booking Indicator - Modern Design */
.booking-indicator {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Status-specific booking indicator colors */
.status-pending .booking-indicator { 
    background: rgba(245, 158, 11, 0.9); 
    border-color: rgba(255, 255, 255, 0.3);
}
.status-active .booking-indicator { 
    background: rgba(16, 185, 129, 0.9); 
    border-color: rgba(255, 255, 255, 0.3);
}
.status-done .booking-indicator { 
    background: rgba(99, 102, 241, 0.9); 
    border-color: rgba(255, 255, 255, 0.3);
}
.status-cancelled .booking-indicator { 
    background: rgba(239, 68, 68, 0.9); 
    border-color: rgba(255, 255, 255, 0.3);
}

/* Modern Pulse Animation for Active Status */
@keyframes modernPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5), 0 0 30px rgba(16, 185, 129, 0.3);
    }
}

/* Shimmer Effect for DONE Status */
.schedule-cell.status-done::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmerSlide 3s ease-in-out infinite;
}

@keyframes shimmerSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Diagonal Stripes for CANCELLED Status */
.schedule-cell.status-cancelled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.1) 3px,
        rgba(255,255,255,0.1) 6px
    );
}

/* Subtle Glow for PENDING Status */
.schedule-cell.status-pending::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: pendingGlow 2s ease-in-out infinite alternate;
}

@keyframes pendingGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Legend Styling - Modern Design */
.timeslots-legend .card-body {
    padding: 2rem;
}

.timeslots-legend {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.legend-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
}

.legend-color {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.legend-color.status-none {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
}

.legend-color.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.legend-color.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: modernPulse 2.5s ease-in-out infinite;
}

.legend-color.status-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: 2px solid #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    position: relative;
}

.legend-color.status-done::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmerSlide 3s ease-in-out infinite;
}

.legend-color.status-cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    position: relative;
}

.legend-color.status-cancelled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.1) 2px,
        rgba(255,255,255,0.1) 4px
    );
}

.legend-color.continuous-border {
    background: var(--bg-primary);
    border-color: #f59e0b;
    border-width: 3px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.legend-shortcuts {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Current Time Info - Modern Design */
.current-time-info {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    text-align: center;
}

.current-time-info small {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.current-time-info #currentTime {
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-left: 0.5rem;
}

/* Dark Theme Adjustments */
[data-bs-theme="dark"] .time-header,
[data-bs-theme="dark"] .light-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .time-cell {
    background: var(--bg-tertiary);
}

[data-bs-theme="dark"] .schedule-cell:not(.status-active) {
    background: var(--bg-primary);
}

[data-bs-theme="dark"] .schedule-cell.current-hour-cell {
    background: rgba(99, 102, 241, 0.15);
}

/* Dark theme status color enhancements */
[data-bs-theme="dark"] .schedule-cell.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] .schedule-cell.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.3) !important;
    animation: modernPulse 2.5s ease-in-out infinite !important;
}

[data-bs-theme="dark"] .schedule-cell.status-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
}

[data-bs-theme="dark"] .schedule-cell.status-cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

[data-bs-theme="dark"] .legend-item {
    background: var(--bg-tertiary);
}

[data-bs-theme="dark"] .legend-item:hover {
    background: #475569;
}

/* Dark theme legend color overrides */
[data-bs-theme="dark"] .legend-color.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] .legend-color.status-active {
    background: #059669 !important;
    border: 1px solid #047857 !important;
    animation: breathe 2s ease-in-out infinite !important;
}

[data-bs-theme="dark"] .legend-color.status-done {
    background: #2563eb !important;
    border: 1px solid #1d4ed8 !important;
}

[data-bs-theme="dark"] .legend-color.status-cancelled {
    background: #dc2626 !important;
    border: 1px solid #b91c1c !important;
}

/* Dark theme continuous booking border overrides */
[data-bs-theme="dark"] .schedule-cell.continuous-booking {
    border: 3px solid #fbbf24 !important;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6) !important;
}

[data-bs-theme="dark"] .legend-color.continuous-border {
    background: var(--bg-primary) !important;
    border-color: #fbbf24 !important;
    border-width: 3px !important;
}

/* Responsive Design for Timeslots Grid */
@media (max-width: 768px) {
    .timeslots-date-navigation {
        gap: 1rem;
        padding: 1rem;
    }
    
    .timeslots-date-navigation .current-date {
        font-size: 1.2rem;
        min-width: 200px;
    }
    
    .time-header.sticky-time,
    .time-cell {
        min-width: 50px;
        width: 50px;
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
    }
    
    .light-header,
    .schedule-cell {
        min-width: 105px;
        width: 105px;
    }
    
    .light-header {
        height: 2.5rem;
        padding: 0.4rem 0.6rem;
    }
    
    .light-header-description {
        font-size: 1.1rem;
        font-weight: 900;
        -webkit-line-clamp: 2;
        line-height: 1.0;
    }
    
    .schedule-cell {
        height: 40px;
    }
    
    .legend-items {
        gap: 1rem;
    }
    
    .legend-item {
        padding: 0.4rem 0.8rem;
        gap: 0.5rem;
    }
    
    .legend-color {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .timeslots-date-navigation {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .timeslots-date-navigation .current-date {
        font-size: 1rem;
        order: -1;
    }
    
    .timeslots-grid-container {
        max-height: 60vh;
    }
    
    .light-header,
    .schedule-cell {
        min-width: 90px;
        width: 90px;
    }
    
    .light-header {
        height: 2.2rem;
        padding: 0.35rem 0.5rem;
    }
    
    .light-header-description {
        font-size: 1rem;
        font-weight: 900;
        -webkit-line-clamp: 1;
        line-height: 1.0;
    }
    
    .time-cell {
        min-width: 45px;
        width: 45px;
        font-size: 0.7rem;
        padding: 0.4rem 0.2rem;
        letter-spacing: 0.2px;
    }
    
    .schedule-cell {
        height: 35px;
    }
    
    .legend-items {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
}

/* High contrast mode support for timeslots */
@media (prefers-contrast: high) {
    .schedule-cell.status-pending,
    .legend-color.status-pending {
        background: #059669;
        border: 3px solid #047857;
    }
    
    .schedule-cell.status-active,
    .legend-color.status-active {
        background: #059669;
        border: 3px solid #047857;
    }
    
    .schedule-cell.status-done,
    .legend-color.status-done {
        background: #2563eb;
        border: 3px solid #1d4ed8;
    }
    
    .schedule-cell.status-cancelled,
    .legend-color.status-cancelled {
        background: #dc2626;
        border: 3px solid #b91c1c;
    }
}

/* Reduced motion support for timeslots */
@media (prefers-reduced-motion: reduce) {
    .schedule-cell.status-active,
    .legend-color.status-active {
        animation: none;
    }
    
    .schedule-cell:hover {
        transform: none;
    }
    
    .legend-item:hover {
        transform: none;
    }
    
    .timeslots-date-navigation .btn:hover {
        transform: none;
    }
}

/* Timeslots Grid Styling */
.timeslots-table th {
    background-color: #1e293b;
    border-color: #334155;
    vertical-align: middle;
}

.timeslots-table td {
    background-color: #0f172a;
    border-color: #334155;
    min-height: 80px;
    height: auto;
    vertical-align: top;
}

/* Ensure description text in timeslots header is readable on dark backgrounds */
.timeslots-table th .text-muted,
.timeslots-table th .small.text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.timeslot-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 60px;
    padding: 8px;
}

.timeslot-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Status Colors */
.status-done {
    background-color: #1e40af; /* Blue */
    border-color: #3b82f6;
    color: white;
}

.status-active {
    background-color: #166534; /* Green */
    border-color: #22c55e;
    color: white;
    animation: pulse-border 2s infinite;
}

.status-pending {
    background-color: #115e59; /* Teal/Dark Green */
    border-color: #14b8a6;
    color: white;
}

.status-cancel {
    background-color: #991b1b; /* Red */
    border-color: #ef4444;
    color: white;
}

.status-none {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.status-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Current Time Indicator */
.current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%; /* Approximate, driven by logic if needed more precise */
    height: 2px;
    background-color: #ef4444;
    box-shadow: 0 0 4px #ef4444;
    z-index: 20;
    pointer-events: none;
}

.current-time-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
}

@keyframes pulse-border {
    0% { border-color: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { border-color: #22c55e; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { border-color: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ========================================
   TIMESLOT MODAL STATUS BADGES
   ======================================== */

/* Timeslot cell clickable styling */
.timeslot-cell:not(.status-none) {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeslot-cell:not(.status-none):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Status Badge Base Styles */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    color: white;
}

/* Status Badge Colors */
.status-badge-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.status-badge-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.status-badge-done {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.status-badge-cancel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.status-badge-default {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 2px 6px rgba(100, 116, 139, 0.3);
}

/* Pulse animation for active status badge */
@keyframes badgePulse {
    0%, 100% { 
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    }
    50% { 
        box-shadow: 0 2px 12px rgba(16, 185, 129, 0.5);
    }
}

/* Modal Timeslot Detail Styling */
.timeslot-detail-row .row {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.timeslot-detail-row .row:last-child {
    border-bottom: none;
}

.timeslot-detail-row code {
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

[data-bs-theme="dark"] .timeslot-detail-row code {
    background-color: var(--bg-secondary);
}