/* === Color System === */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(0, 212, 255, 0.04);
  --bg-card-hover: rgba(0, 212, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --accent: #00d4ff;
  --accent-dark: #0099cc;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-bright: #00ffff;
  --success: #00e676;
  --warning: #ffab00;
  --danger: #ff1744;
  --border: rgba(0, 212, 255, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', 'Sora', sans-serif;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: auto;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

/* === Animations === */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
                inset 0 0 20px rgba(0, 212, 255, 0.05);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5),
                inset 0 0 20px rgba(0, 212, 255, 0.1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.1s; }
.animate-in:nth-child(2) { animation-delay: 0.2s; }
.animate-in:nth-child(3) { animation-delay: 0.3s; }
.animate-in:nth-child(4) { animation-delay: 0.4s; }
.animate-in:nth-child(5) { animation-delay: 0.5s; }

/* === Header === */
.header {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.05) 0%, transparent 100%);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--accent);
  background: rgba(0, 212, 255, 0.1);
  backdrop-filter: blur(20px);
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}

.streak-icon {
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.streak-count {
  font-size: 1.8rem;
  font-weight: 700;
  min-width: 3rem;
}

.streak-label {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 400;
}

/* === Usage Counter === */
.usage-counter {
  margin: 1.5rem 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.05);
  backdrop-filter: blur(10px);
}

.usage-text {
  display: block;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.usage-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  border-radius: 3px;
  transition: width var(--transition);
}

/* === Main Content === */
.main-content {
  flex: 1;
  padding: 0 1rem;
}

/* === Timer Card === */
.timer-card {
  margin: 2rem 0;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 212, 255, 0.02) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
}

.timer-display {
  text-align: center;
  margin-bottom: 2rem;
}

.timer-value {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-family: 'Space Grotesk', monospace;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  margin-bottom: 0.5rem;
}

.timer-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 300;
}

.timer-controls {
  margin-bottom: 2rem;
}

.duration-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-dark) 0%, var(--accent) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-bottom: 1rem;
}

.duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
  transition: all var(--transition);
  border: 2px solid rgba(0, 0, 0, 0.5);
}

.duration-slider::-webkit-slider-thumb:hover {
  width: 24px;
  height: 24px;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.8);
}

.duration-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
  transition: all var(--transition);
  border: 2px solid rgba(0, 0, 0, 0.5);
}

.duration-slider::-moz-range-thumb:hover {
  width: 24px;
  height: 24px;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.8);
}

.duration-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.button-group {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

/* === Buttons === */
.btn {
  padding: 1rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: 'Space Grotesk', sans-serif;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left var(--transition);
  z-index: 0;
}

.btn:hover:before {
  left: 100%;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #0a0a0f;
  border-color: var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 212, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #0099cc 100%);
  color: #0a0a0f;
  border-color: var(--accent);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 212, 255, 0.5);
}

.btn-accent:active {
  transform: translateY(0) scale(0.98);
}

.btn-premium {
  background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
  color: #0a0a0f;
  border-color: #00e676;
  box-shadow: 0 0 30px rgba(0, 230, 118, 0.3);
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 230, 118, 0.5);
}

.btn-premium:active {
  transform: translateY(0) scale(0.98);
}

.btn-lg {
  padding: 1.2rem 1.5rem;
  font-size: 1.1rem;
  min-height: 48px;
}

/* === Result Modal === */
.result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.result-modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.result-content {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 212, 255, 0.05) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
  backdrop-filter: blur(20px);
}

.result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.result-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Space Grotesk', monospace;
}

#btn-share {
  margin-bottom: 1rem;
}

/* === History Section === */
.history-section {
  padding: 2rem 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 1rem 1.5rem;
  text-transform: uppercase;
  color: var(--text-primary);
}

.history-container {
  padding: 0 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.05);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
}

.history-item:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent);
  transform: translateX(4px);
}

.history-item-left {
  flex: 1;
}

.history-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.history-duration {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.history-score {
  text-align: right;
}

.history-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.history-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
}

/* === Premium Section === */
.premium-section {
  padding: 2rem 0;
}

.premium-card {
  margin: 0 1rem;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-xl);
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 230, 118, 0.15);
}

.premium-header {
  margin-bottom: 1.5rem;
}

.premium-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.premium-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.premium-benefits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.benefit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.benefit-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* === Footer === */
.footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.02);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer-content p {
  color: var(--text-secondary);
  font-weight: 300;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  transition: all var(--transition);
}

.footer-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* === Responsive Design === */
@media (max-width: 480px) {
  .header-title {
    font-size: 2rem;
  }

  .timer-value {
    font-size: 3rem;
  }

  .timer-card {
    padding: 1.5rem 1rem;
  }

  .button-group {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
  }

  .result-content {
    width: 95%;
  }

  .premium-card {
    margin: 0 1rem;
  }
}

@media (min-width: 481px) {
  .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .result-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === Utility Classes === */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.opacity-75 {
  opacity: 0.75;
}
