/* CSS Variables for Color Palette */
:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
}
.darkMode {
  --primary-color: #3b82f6;
  --secondary-color: #94a3b8;
  --accent-color: #0891b2;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --white: #1e293b;
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-600: #cbd5e1;
  --gray-800: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(255 255 255 / 0.05);
  --shadow: 0 1px 3px 0 rgb(255 255 255 / 0.1),
    0 1px 2px -1px rgb(255 255 255 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(255 255 255 / 0.1),
    0 4px 6px -4px rgb(255 255 255 / 0.1);
}
/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--gray-800);
  position: relative;
}

/* Info Button */
.info-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--white);
  color: var(--primary-color);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.info-btn:hover {
  background: var(--gray-100);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.darkMode .info-btn {
  background: var(--gray-200);
  box-shadow: var(--shadow);
}

.darkMode .info-btn:hover {
  background: var(--gray-300);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
#theme-switch {
  position: fixed;
  top: 20px;
  right: 75px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--white), var(--gray-100));
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow), 0 0 15px rgba(37, 99, 235, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

#theme-switch:hover {
  background: var(--gray-100);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.darkMode #theme-switch {
  background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
  box-shadow: var(--shadow), 0 0 15px rgba(6, 182, 212, 0.15);
}

.darkMode #theme-switch:hover {
  background: var(--gray-300);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Show/Hide SVGs based on theme */
#theme-switch svg:first-child {
  display: block;
}

#theme-switch svg:last-child {
  display: none;
}

.darkMode #theme-switch svg:first-child {
  display: none;
}

.darkMode #theme-switch svg:last-child {
  display: block;
}

/* Info Modal */
.info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.info-modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.info-content {
  background: var(--white);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.info-modal:not(.hidden) .info-content {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-600);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.info-content h3 {
  margin: 0 0 16px 0;
  color: var(--primary-color);
  font-size: 20px;
  font-weight: 600;
}

.info-content p {
  margin: 0 0 12px 0;
  line-height: 1.5;
  color: var(--gray-600);
}

.info-content p:last-child {
  margin-bottom: 0;
  font-style: italic;
  color: var(--gray-800);
}

/* Mode Selector */
.mode-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--white);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.mode-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--gray-600);
  min-width: 80px;
}

.mode-btn:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.mode-btn:active,
#infinity-mode.active,
#timer-mode.active {
  background: var(--primary-color);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Time Input Container */
.time-input-container {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  background: var(--white);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  align-items: center;
  justify-content: center;
}

.time-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--gray-600);
  font-size: 13px;
}

.time-input-label span {
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.time-input {
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  width: 70px;
  background: var(--white);
  color: var(--gray-800);
  transition: all 0.2s ease;
  font-weight: 500;
}

.time-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Timer Display */
.timer-display {
  margin-bottom: 32px;
  background: var(--white);
  border-radius: 12px;
  padding: 40px 60px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  position: relative;
}

.break-mode-switch {
  background: orange;
}

#time-display {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 600;
  color: var(--gray-800);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;
  letter-spacing: -0.02em;
}

#break {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success-color);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-remaining {
  font-size: 0.875rem;
  color: var(--secondary-color);
  text-align: center;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;
  font-weight: 500;
}

/* Controls Section */
.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.control-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 100px;
}

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

.control-btn.primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.control-btn.secondary {
  background: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.control-btn.secondary:hover {
  background: var(--gray-50);
  color: var(--gray-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

#start-btn {
  background: var(--success-color);
}

#start-btn:hover {
  background: #059669;
}

/* Hidden Class */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .info-btn {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  #theme-switch {
    top: 16px;
    right: 60px;
    width: 36px;
    height: 36px;
  }

  .timer-display {
    padding: 30px 40px;
  }

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

  .time-input-container {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .time-input-label {
    flex-direction: row;
    gap: 12px;
  }

  .controls {
    gap: 8px;
  }

  .control-btn {
    padding: 10px 20px;
    min-width: 90px;
    font-size: 13px;
  }

  .mode-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 70px;
  }

  .info-content {
    padding: 24px;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .controls {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 180px;
  }

  .control-btn {
    width: 100%;
  }

  .mode-selector {
    flex-direction: column;
    width: 100%;
    max-width: 180px;
  }

  .time-input-container {
    width: 100%;
    max-width: 280px;
  }
}

/* Focus and accessibility */
.control-btn:focus,
.mode-btn:focus,
.time-input:focus,
.info-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth transitions */
.control-btn,
.time-input-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
