:root {
  --primary-bg: #fafafa;
  --secondary-bg: #f0f0f0;
  --card-bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6a6a6a;
  --accent-primary: #2563eb;
  --accent-secondary: #059669;
  --accent-tertiary: #dc2626;
  --border-color: #d1d5db;
  --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 25px -8px rgba(0, 0, 0, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.08);
  --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
  --gradient-secondary: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  
  /* Color Palette Variables */
  --clock-gradient: var(--gradient-primary);
  
  /* Blue Theme */
  --blue-light: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
  --purple-light: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  --green-light: linear-gradient(135deg, #059669 0%, #047857 100%);
  --orange-light: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  --pink-light: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

[data-theme="dark"] {
  --primary-bg: #0a0a0a;
  --secondary-bg: #1a1a1a;
  --card-bg: #2a2a2a;
  --text-primary: #f5f5f5;
  --text-secondary: #d4d4d4;
  --text-muted: #a3a3a3;
  --accent-primary: #3b82f6;
  --accent-secondary: #10b981;
  --accent-tertiary: #f59e0b;
  --border-color: #404040;
  --shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4), 0 1px 4px 0 rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 25px -8px rgba(0, 0, 0, 0.6), 0 4px 10px -4px rgba(0, 0, 0, 0.4);
  --gradient-primary: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  --gradient-secondary: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  
  /* Dark Theme Color Palettes */
  --blue-dark: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --purple-dark: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  --green-dark: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --orange-dark: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --pink-dark: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-container {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: grid;
  grid-template-areas: 
    "header header"
    "main sidebar"
    "footer footer";
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 16px;
  padding-top: calc(16px + var(--safe-area-top, 0px));
  padding-bottom: calc(16px + var(--safe-area-bottom, 0px));
  padding-left: calc(16px + var(--safe-area-left, 0px));
  padding-right: calc(16px + var(--safe-area-right, 0px));
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  grid-area: header;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  height: fit-content;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ensure header nav and logo use the same typographic scale and feel as the hero */
.logo-link {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
}

.header-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.header-nav .nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-nav .nav-link:hover {
  background: rgba(0,0,0,0.04);
}

/* Main content typography to match hero-clock style */
.main-content, .main-content * {
  font-family: inherit;
  color: var(--text-primary);
}

.main-content h1, .main-content h2, .main-content h3 {
  font-weight: 700;
  color: var(--text-primary);
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.theme-toggle {
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
}

.main-content {
  grid-area: main;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  overflow: visible;
}

.hero-clock {
  text-align: center;
  width: 100%;
  max-width: 800px;
  position: relative;
}

.digital-clock {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
  overflow: visible;
}

.digital-clock .about-section,
.digital-clock .how-to-section {
  text-align: left;
}

.digital-clock:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.15), 0 15px 15px -5px rgba(0, 0, 0, 0.08);
}

.compact-timer {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

[data-theme="dark"] .compact-timer {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.compact-timer:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

[data-theme="dark"] .compact-timer:hover {
  background: rgba(0, 0, 0, 0.4);
}

.timer-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timer-time-mini {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.timer-status-mini {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-controls-mini {
  display: flex;
  gap: 6px;
}

.btn-mini {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn-mini.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-mini.btn-secondary {
  background: var(--accent-tertiary);
  color: white;
}

.btn-mini.btn-tertiary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

.btn-mini:hover:not(:disabled) {
  transform: scale(1.1);
}

.timer-details {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timer Mode Selector */
.timer-mode-container {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.mode-selection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  touch-action: manipulation;
}

.mode-btn:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.mode-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-lg);
}

.mode-icon {
  font-size: 18px;
}

.mode-name {
  font-weight: 600;
}

/* Timer Section Main */
.timer-section-main {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timer-display-large {
  text-align: center;
  margin-bottom: 16px;
}

.timer-time-large {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  font-family: 'Inter', monospace;
}

.timer-status-large {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-info {
  width: 100%;
  max-width: 400px;
  margin-bottom: 16px;
}

.session-info {
  text-align: center;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar-main {
  width: 100%;
  height: 10px;
  background: var(--secondary-bg);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 16px;
}

.timer-controls-main {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-main {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.3px;
  min-width: 100px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
}

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

.btn-main.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-main.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-main.btn-secondary {
  background: var(--accent-tertiary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-main.btn-secondary:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-main.btn-tertiary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-main.btn-tertiary:hover:not(:disabled) {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.timer-settings-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.setting-group-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setting-group-main label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setting-group-main input {
  padding: 6px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--secondary-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  width: 50px;
  transition: all 0.3s ease;
}

.setting-group-main input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.no-settings-text {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
  padding: 24px 16px;
}

/* Color Palette Selector */
.color-palette-container {
  position: relative;
  margin-right: 12px;
}

.color-palette-toggle {
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-palette-toggle:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
}

.color-palette-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 120px;
}

.color-palette-dropdown.show {
  display: flex;
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  margin: 0 auto;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: var(--border-color);
}

.color-option.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

/* Fullscreen Toggle Button */
.fullscreen-toggle {
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.fullscreen-toggle:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
}

.fullscreen-icon {
  font-size: 16px;
  color: var(--text-primary);
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
  min-height: 44px;
}

.hamburger-menu:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
}

.hamburger-line {
  width: 20px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  margin: 2px 0;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Color Theme Classes */
.color-blue {
  --clock-gradient: var(--blue-light);
}

.color-purple {
  --clock-gradient: var(--purple-light);
}

.color-green {
  --clock-gradient: var(--green-light);
}

.color-orange {
  --clock-gradient: var(--orange-light);
}

.color-pink {
  --clock-gradient: var(--pink-light);
}

/* Dark mode color overrides */
[data-theme="dark"].color-blue {
  --clock-gradient: var(--blue-dark);
}

[data-theme="dark"].color-purple {
  --clock-gradient: var(--purple-dark);
}

[data-theme="dark"].color-green {
  --clock-gradient: var(--green-dark);
}

[data-theme="dark"].color-orange {
  --clock-gradient: var(--orange-dark);
}

[data-theme="dark"].color-pink {
  --clock-gradient: var(--pink-dark);
}

/* Fullscreen Mode Styles */
.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--primary-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.fullscreen-mode .time-display {
  font-size: clamp(8rem, 20vw, 16rem);
  margin-bottom: 24px;
}

.fullscreen-mode .date-display {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 16px;
}

.fullscreen-mode .timezone-display {
  font-size: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 0;
}

.fullscreen-mode .timer-section-main {
  display: none;
}

.fullscreen-mode .fullscreen-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
}

.fullscreen-mode .fullscreen-icon {
  font-size: 22px;
}

/* Hide elements in fullscreen mode */
body.fullscreen-active .sidebar,
body.fullscreen-active .footer,
body.fullscreen-active .header {
  display: none;
}

body.fullscreen-active .app-container {
  padding: 0;
  max-width: 1400px;
  min-height: 100vh;
  gap: 0;
}

body.fullscreen-active .main-content {
  min-height: 100vh;
}

.time-display {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: var(--clock-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  font-family: 'Inter', monospace;
}

.date-display {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
}

.timezone-display {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.timer-display {
  text-align: center;
  margin-bottom: 24px;
}

.timer-time {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timer-status {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

.timer-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-group input {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--secondary-bg);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.setting-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 100px;
}

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

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent-tertiary);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-1px);
}

.btn-tertiary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-tertiary:hover:not(:disabled) {
  background: var(--secondary-bg);
  border-color: var(--accent-primary);
}

.btn-audio {
  background: var(--accent-secondary);
  color: white;
}

.btn-audio:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.timer-progress {
  margin-top: 16px;
}

.progress-info {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--secondary-bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
  width: 0%;
}

.audio-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sound-selection {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.sound-btn {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 40px;
  touch-action: manipulation;
}

.sound-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.sound-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-control label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 55px;
}

#volumeSlider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--secondary-bg);
  outline: none;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
}

#volumeValue {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 35px;
}

.sidebar {
  grid-area: sidebar;
  transition: transform 0.3s ease;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
  display: block;
}

.sidebar-mobile {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--card-bg);
  z-index: 999;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 20px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-mobile.show {
  right: 0;
}

.ad-container {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);

/* Page-specific single-column override for About/HowTo pages */
.app-container.app-singlecol {
  display: block; /* disable grid */
  max-width: 1440px;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  margin-left: auto;
  margin-right: auto;
  padding: 28px 20px;
}

.app-container.app-singlecol .main-content {
  margin-top: 12px;
}

/* On single-column pages (about/how-to) hide the full-screen and palette UI to reduce clutter */
.app-container.app-singlecol .header-controls .color-palette-container,
.app-container.app-singlecol .header-controls .fullscreen-toggle {
  display: none !important;
}

/* Keep theme toggle visible and slightly larger for clarity */
.app-container.app-singlecol .header-controls .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 1.05rem;
}
  height: fit-content;
  position: sticky;
  top: 20px;
}

.footer {
  grid-area: footer;
}

.ad-banner {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-bg);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  min-height: 250px;
}

.ad-placeholder.banner {
  min-height: 60px;
  font-size: 12px;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  max-width: 400px;
  transform: translateX(450px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

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

.notification-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.notification-text {
  font-size: 14px;
  color: var(--text-primary);
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-areas: 
      "header"
      "main"
      "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 12px;
  }

  .sidebar {
    display: none;
  }

  .hamburger-menu {
    display: flex;
  }

  .audio-container {
    position: static;
  }

  .main-content {
    min-height: 300px;
  }

  .digital-clock {
    padding: 24px 20px;
    min-height: 300px;
  }

  .timer-mode-container {
    padding: 12px;
    margin-bottom: 12px;
  }

  .audio-container {
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 8px;
    gap: 8px;
    grid-template-rows: auto 1fr auto;
  }

  .digital-clock {
    padding: 20px 16px;
  }

  .time-display {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .timer-time-large {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
  }

  .timer-settings-main {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .setting-group-main input {
    width: 60px;
    padding: 8px;
    font-size: 14px;
  }

  .btn-main {
    padding: 14px 20px;
    font-size: 14px;
    min-height: 48px;
  }

  .sound-selection {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .sound-btn {
    padding: 12px;
    min-height: 44px;
    font-size: 12px;
  }

  .mode-btn {
    padding: 14px 16px;
    min-height: 48px;
    font-size: 14px;
  }

  .header-content {
    padding: 10px 16px;
  }

  .logo {
    font-size: 18px;
  }

  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .ad-placeholder.banner {
    min-height: 50px;
    font-size: 12px;
  }

  .color-option {
    width: 36px;
    height: 36px;
  }

  .timer-mode-container {
    padding: 16px;
  }

  .audio-container {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 8px;
    gap: 8px;
    grid-template-rows: auto 1fr auto;
  }

  .time-display {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    margin-bottom: 10px;
  }

  .digital-clock {
    padding: 20px 16px;
  }

  .date-display {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .timezone-display {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .timer-section-main {
    margin-top: 16px;
    gap: 12px;
  }

  .timer-time-large {
    font-size: clamp(1.4rem, 4vw, 2rem);
  }

  .btn-main {
    padding: 16px 20px;
    font-size: 14px;
    min-width: 100px;
    min-height: 50px;
  }

  .sound-btn {
    padding: 14px 8px;
    font-size: 11px;
    min-height: 48px;
  }

  .mode-btn {
    padding: 16px 20px;
    min-height: 52px;
    font-size: 15px;
  }

  .header-content {
    padding: 12px 16px;
  }

  .header-controls {
    gap: 8px;
  }

  .theme-toggle,
  .color-palette-toggle,
  .fullscreen-toggle {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }

  .logo {
    font-size: 18px;
  }

  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .ad-placeholder.banner {
    min-height: 40px;
    font-size: 11px;
  }

  .timer-settings-main {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .setting-group-main input {
    width: 55px;
    padding: 10px 8px;
    font-size: 14px;
    min-height: 44px;
  }

  .setting-group-main label {
    font-size: 12px;
  }

  .color-option {
    width: 40px;
    height: 40px;
  }

  .notification {
    left: 8px;
    right: 8px;
    max-width: none;
    transform: translateY(-100px);
  }

  .notification.show {
    transform: translateY(0);
  }
}

/* Mobile-specific styles */
.mobile-device {
  -webkit-overflow-scrolling: touch;
}

.touch-device button:hover {
  transform: none;
}

.touch-device .btn-main:active,
.touch-device .mode-btn:active,
.touch-device .sound-btn:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* PWA styles */
.install-prompt {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Improve focus visibility for keyboard navigation */
button:focus,
input:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Better contrast for accessibility */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
  
  [data-theme="dark"] {
    --border-color: #ffffff;
    --text-secondary: #ffffff;
  }
}