/* Header styles for the Flow State app */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  transition: background-color 0.3s, box-shadow 0.3s, border-radius 100s ease-in-out;
}

/* Sticky header for mobile */
@media (max-width: 600px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: env(safe-area-inset-top, 8px) env(safe-area-inset-right, 8px) 8px env(safe-area-inset-left, 8px);
  }
  
  /* Header with background when scrolling */
  .header.scrolled {
    background-color: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
  
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

#datetime {
  font-size: 1rem;
  color: var(--fg);
}

.header button {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  margin-left: 12px;
  transition: color var(--transition);
}

.header button:hover {
  color: var(--accent);
}

/* Theme dropdown */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-dropdown {
  position: relative;
  display: inline-block;
}

.theme-dropdown-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition);
  padding: 2px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-dropdown-btn:hover {
  color: var(--accent);
}

.theme-dropdown-content {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 140px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: 0 3px 8px var(--shadow);
  z-index: 100;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
}

.theme-dropdown.active .theme-dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.theme-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.theme-option:hover {
  background: var(--bg);
}

.theme-option.active {
  background: var(--accent);
  color: white;
}

/* Mobile optimizations for theme dropdown */
@media (max-width: 600px) {
  .theme-dropdown-content {
    right: -20px; /* Shift the dropdown to the left slightly */
    max-height: 300px;
    overflow-y: auto;
  }
  
  .theme-option {
    padding: 12px 16px; /* Larger touch targets */
  }
}

/* Legacy theme selector */
.theme-selector {
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.theme-selector label {
  margin-right: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.theme-selector select {
  padding: 4px 8px;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-selector select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

/* Flow logo animation - enhanced brainwave inspired */
.flow-logo {
  position: relative;
  display: inline-block;
  transition: color 0.3s;
  z-index: 1;
  cursor: pointer;
  overflow: visible;
  color: var(--fg);
}

/* Subtle hover effect with reduced shadow */
.flow-logo:hover {
  color: var(--fg);
  text-shadow: 0 0 2px rgba(41, 121, 255, 0.3);
  filter: none;
}

/* Canvas for wave animation - moved behind logo */
.wave-canvas {
  position: absolute;
  left: -20px;
  width: calc(100% + 40px);
  height: 60px;
  z-index: -1; /* Reverted back to -1 to place waves behind text */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.flow-logo:hover .wave-canvas {
  opacity: 1;
}