.notification-pane.slide-out {
  animation: slideOut 0.3s ease-in forwards;
}
.close-notification {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(239,68,68,0.15);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-left: 1rem;
}
.close-notification:hover {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  transform: scale(1.1) rotate(10deg);
}
/* Fixed notification pane overlay */
.notification-pane {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: rgba(255,255,255,0.98);
  box-shadow: -4px 0 24px rgba(37,99,235,0.12);
  border-radius: 0 0 0 16px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
  overflow-y: scroll;
  padding-bottom: 80px;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  color: white;
  font-weight: 600;
  border-radius: 0 0 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.notification-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}

.notification-item {
  background: rgba(37,99,235,0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.notification-btn {
  display: none !important;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .notification-btn {
    display: flex !important;
    width: 100%;
    border-radius: 20px;
    font-size: 1rem;
    justify-content: flex-start;
    padding-left: 1rem;
  }
}
/* Modern Healthcare Design System */
:root {
  --primary-color: #2563eb;
  --secondary-color: #06b6d4;
  --accent-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --success-color: #22c55e;
  
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #4facfe 100%);
  --bg-pattern: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 0%, transparent 50%);
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #ffffff;
  
  --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);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}
::-webkit-scrollbar {
  display: none;
}
body {
  -ms-overflow-style: none;  /* IE və köhnə Edge */
  scrollbar-width: none; 
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-pattern);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(244, 114, 182, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: backgroundPulse 20s ease-in-out infinite;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Header Styles - Reduced Size */
.header {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.95) 0%,
    rgba(6, 182, 212, 0.90) 50%,
    rgba(16, 185, 129, 0.85) 100%);
  backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.header:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex !important;
  align-items: center !important;
  gap: 1rem;
  justify-content: space-between !important; /* Ensures stable positioning */
  position: relative !important;
}

.header-left {
  display: flex !important;
  align-items: center !important;
  gap: 1rem;
  flex-shrink: 0 !important;
}

.header-right {
  display: flex !important;
  align-items: center !important;
  gap: 1rem;
  margin-left: auto;
  flex-shrink: 0 !important;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: translateY(-2px);
}

.logo i {
  font-size: 2rem;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.logo-image:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin: 0;
  transition: all 0.3s ease;
}

.logo h1:hover {
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}

.subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping */
}

.subtitle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Header button styles moved below - avoiding duplication */

/* Health Interface Grid - 2x2 Layout */
.health-interface.grid-2x2 {
  padding: 0.5rem 1rem 0.2rem 1rem;
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.cell {

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  padding: 1rem 4rem;
  text-align: center;
  position: relative;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.cell:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(255, 255, 255, 0.98);
}

.icon-container {
  width: 135px;
  height: 135px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.icon-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  z-index: -1;
}

.cell:hover .icon-container {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.cell h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.cell p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Health Category Specific Styles */
.hydration .icon-container {
  cursor: default;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.hydration i {
  color: var(--primary-color);
  font-size: 5rem;
}

.climate .icon-container {
  background: linear-gradient(135deg, #e0f2fe, #b3e5fc);
}

.climate i {
  color: var(--secondary-color);
  font-size: 5rem;
}

.toilet .icon-container {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.toilet i {
  color: var(--warning-color);
  font-size: 5rem;
}

.sos .icon-container {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
}

.sos i {
  color: var(--danger-color);
  font-size: 5rem;
}

/* Progress Bar */
.progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0%;
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.cell:hover .progress {
  opacity: 1;
}

/* Dashboard Styles */
.dashboard {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-container {
  display: grid;
  grid-template-columns: 6fr 0.6fr; /* Even more space for EEG chart, minimal for info panel */
  gap: 1rem; /* Further reduced gap for maximum chart space */
  margin-bottom: 2rem;
}

.eeg-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  padding: 32px; /* Increased padding for better spacing */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.section-header i {
  font-size: 2rem;
  color: var(--primary-color);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
}

.status-dot.active {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.eeg-container {
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #f8fafc;
  min-height: 650px; /* Increased from 600px to utilize more space */
}

.eeg-displays {
  display: flex;
  gap: 1rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;

}

.eeg-display {
  width: 100%;
}

.eeg-display img {
  width: 100%;
  display: block;
}

.eeg-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.frequency-bands {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.band {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.band-label {
  min-width: 80px;
}

.band-indicator {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
}

.band.alpha .band-indicator { background: var(--primary-color); }
.band.beta .band-indicator { background: var(--secondary-color); }
.band.gamma .band-indicator { background: var(--accent-color); }

/* Info Panel */
.info-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* Further reduced gap between cards */
}

.info-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  padding: 0.6rem; /* Significantly reduced from 1.5rem */
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.98);
}

.info-card i {
  font-size: 1.2rem; /* Further reduced from 2.5rem */
  color: var(--primary-color);
  margin-bottom: 0.3rem; /* Reduced margin */
}

.info-card h3 {
  font-size: 0.7rem; /* Further reduced from 1rem */
  font-weight: 600;
  margin-bottom: 0.2rem; /* Reduced margin */
  color: var(--text-primary);
}

.info-card p {
  font-size: 0.65rem; /* Further reduced from 0.875rem */
  color: var(--text-secondary);
}

/* Action buttons in info panel */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.8rem; /* Increased margin to separate from info cards */
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2); /* Subtle separator */
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--border-radius);
  border: none;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn i {
  font-size: 0.8rem;
  margin: 0;
}

.action-btn span {
  flex: 1;
  text-align: left;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.action-btn.secondary {
  background: rgba(100, 116, 139, 0.8);
  color: white;
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.2);
}

.action-btn.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
  background: rgba(100, 116, 139, 0.9);
}

/* Controls - Legacy styles (buttons moved to info panel) */
/*
.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}
*/

/* Standardized header button styles - replaces nav-btn */
.header-btn {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 25px !important;
  color: white !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  white-space: nowrap !important; /* Prevent text wrapping */
  flex-shrink: 0 !important; /* Prevent button shrinking */
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10 !important;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.header-btn i {
  font-size: 1rem;
}

.header-btn span {
  white-space: nowrap;
}

/* Primary variant for header button */
.header-btn.primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(6, 182, 212, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Secondary variant for header button */
.header-btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Legacy support for older styles */
.screen2 {
  min-height: calc(100vh - 120px);
}

.img_container {
  width: 100%;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.img_container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 0.5rem;
  }
  
  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .header-left, .header-right {
    margin-left: 0;
    justify-content: center;
  }
  
  .header-right {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center !important;
    justify-content: center !important;
    margin: 0px!important;
  }

  .subtitle {
    margin: 0;
    text-align: center;
  }
  
  .header-btn {
    align-self: center;
    margin: 0;
  }
  
  .health-interface.grid-2x2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    padding: 2rem;
    gap: 1.5rem;
  }
  
  .cell {
    min-height: 250px;
    padding: 1.5rem 1.5rem 1.5rem;
  }
  
  .icon-container {
    width: 120px;
    height: 120px;
  }
  
  .hydration i, .climate i, .toilet i, .sos i {
    font-size: 4rem;
  }
  
  .cell h3 {
    font-size: 1.75rem;
  }
  
  .cell p {
    font-size: 1.125rem;
  }
  
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Action buttons responsive styles */
  .action-buttons {
    flex-direction: row;
    gap: 0.3rem;
    justify-content: space-between;
  }

  .action-btn {
    flex: 1;
    min-width: 0;
    font-size: 0.6rem;
    padding: 0.4rem 0.5rem;
  }

  .action-btn span {
    text-align: center;
  }
  
  /* Legacy controls responsive styles - buttons moved to info panel
  .controls {
    flex-direction: column;
    align-items: center;
  }
  */
  
  .header-btn {
    align-self: center;
    margin: 0;
    width: auto;
    max-width: 200px;
  }
}


@media (max-width: 650px) {
  .section-header{
    gap: 0.5rem;
    flex-direction: column;
  }
  .status-indicator{
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .eeg-section{
    padding: 20px;
  }
  .eeg-displays {
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .eeg-display {
    display: flex;
    justify-content: center;
    align-self: center;
  }

  .eeg-display img {
    min-width: 300px;
    display: block;

  }
  .eeg-container {
    min-height: 0px; /* Increased from 600px to utilize more space */
  }
  

}

@media (max-width: 480px) {
  .cell {
    padding: 1.5rem;
    min-height: 220px;
  }
  .section-header h2{
    font-size: 1.1rem;
  }

.icon-container {
  width: 100px;
  height: 100px;
  }

  .hydration i, .climate i, .toilet i, .sos i {
    font-size: 3.5rem;
  }
  
  .cell h3 {
    font-size: 1.5rem;
  }
  
  .cell p {
    font-size: 1rem;
  }
  
  .logo h1 {
    font-size: 1.25rem;
  }
  
  .logo i {
    font-size: 1.75rem;
  }
  
  .logo-image {
    width: 35px;
    height: 35px;
  }
  .screen2{
    padding: 1rem 0!important;
  }
  .eeg-displays{
   

  }
  .eeg-display {
    height: 140px;
    width: 300px;
    overflow-x: scroll;
  }

  .eeg-display img {
    min-width: 300px;
    height: 140px;
    display: block;
    
  }
  .action-buttons {
    justify-content: center;
    margin: 0 auto;
    width: 90%;
    gap: 0.2rem;
    flex-direction: column;
  }
  .action-buttons .action-btn{
    padding: 1rem;
    font-size: 16px!important;
    font-weight: 600!important;
  }
  .action-buttons .action-btn span{
    text-align: center;
  }
}

@media (max-width: 480px) {
  .subtitle {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
  }
  .eeg-section{
    padding: 10px;
  }
}

/* Notification animations for consistent styling */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Focus page specific controls */
.focus-controls {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.focus-controls .control-section {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.focus-controls .control-section h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.focus-controls .control-section h3 i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.control-buttons .action-btn {
  min-width: 180px;
  justify-content: center;
}

/* PWA Styles */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.pwa-install-banner.visible {
  transform: translateY(0);
}

.pwa-install-banner.hidden {
  transform: translateY(100%);
}

.install-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.install-icon i {
  font-size: 2rem;
  color: white;
}

.install-text {
  flex: 1;
}

.install-text h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.install-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.install-actions {
  display: flex;
  gap: 0.5rem;
}

.install-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.install-btn.primary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
}

.install-btn.primary:hover {
  background: white;
  transform: translateY(-2px);
}

.install-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.install-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pwa-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning-color);
  color: white;
  padding: 0.75rem;
  z-index: 1001;
  text-align: center;
  transform: translateY(-100%);
  animation: slideDownUpdate 0.3s ease forwards;
}

@keyframes slideDownUpdate {
  to {
    transform: translateY(0);
  }
}

.update-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.update-btn {
  background: white;
  color: var(--warning-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.update-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pwa-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  z-index: 1002;
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 300px;
}

.pwa-notification.show {
  transform: translateX(0);
}

.pwa-notification.success {
  background: var(--success-color);
}

.pwa-notification.info {
  background: var(--primary-color);
}

.pwa-notification.warning {
  background: var(--warning-color);
}

.pwa-notification button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.pwa-notification button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile-first PWA optimizations */
@media (max-width: 768px) {
  .install-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .eeg-overlay {
  position: relative;
  top: auto;
  right: auto;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  }
  .install-actions {
    justify-content: center;
  }
  
  .pwa-notification {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

/* PWA display mode detection */
@media (display-mode: standalone) {
  /* Styles for when app is installed and running as PWA */
  html, body {
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .header {
    padding-top: max(1rem, env(safe-area-inset-top));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }
  
  body {
    padding-top: calc(80px + env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  /* Hide any potential browser UI */
  ::-webkit-scrollbar {
    display: none;
  }
  
  /* Prevent zoom on double tap */
  * {
    touch-action: manipulation;
  }
}

/* Fullscreen mode (Android) */
@media (display-mode: fullscreen) {
  .header {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
  
  body {
    /* padding-top: calc(80px + env(safe-area-inset-top)); */
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* iOS Safari specific PWA styles */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .header {
      padding-top: max(1rem, env(safe-area-inset-top));
      /* Handle iPhone notch */
      background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.98) 0%,
        rgba(6, 182, 212, 0.95) 50%,
        rgba(16, 185, 129, 0.90) 100%);
    }
    
    body {
      /* Ensure full viewport usage */
      height: 100vh;
      height: -webkit-fill-available;
    }
  }
}

/* Hide browser UI elements specifically */
@media all and (display-mode: standalone) {
  /* Remove any browser chrome */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  /* Prevent pull-to-refresh on mobile */
  body {
    overscroll-behavior-y: contain;
  }
  
  /* Full immersive experience */
  .dashboard, .health-interface {
    min-height: calc(100vh - 80px);
    min-height: calc(100vh - 80px - env(safe-area-inset-top));
    padding-top: calc(80px + env(safe-area-inset-top));
  }
}

/* Standalone mode body classes */
body.pwa-standalone {
  /* No browser UI - full app experience */
  height: 100vh;
  height: -webkit-fill-available;
  overflow-x: hidden;
}

body.pwa-fullscreen {
  /* Complete fullscreen mode */
  height: 100vh;
  margin: 0;
  padding: 0;
}

/* Hide scrollbars in standalone mode */
body.pwa-standalone ::-webkit-scrollbar,
body.pwa-fullscreen ::-webkit-scrollbar {
  display: none;
}

body.pwa-standalone,
body.pwa-fullscreen {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Prevent text selection and context menus for app-like feel */
body.pwa-standalone *,
body.pwa-fullscreen * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow text selection for input fields */
body.pwa-standalone input,
body.pwa-standalone textarea,
body.pwa-fullscreen input,
body.pwa-fullscreen textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}