/* Professional CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Custom Properties */
:root {
  /* Colors */
  --bg-color: #0f0f0f;
  --text-color: #ffffff;
  --accent-color: #0474fc;
  --secondary-text: rgba(255, 255, 255, 0.7);
  
  /* Typography */
  --font-primary: 'Figtree', sans-serif;
  
  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Button Animation Variables */
  --btn-bg: hsl(0, 0%, 0%);
  --btn-border-width: 1.5;
  --btn-offset: 1;
  --btn-scale: 1;
  --after-blur: 10;
  --after-opacity: 1;
  --after-pos-y: 10;
  --before-opacity: 0.3;
  --bg-position: 100;
  
  /* Gradients */
  --gradient-rainbow: linear-gradient(
    to right,
    hsl(0, 0, 100%),
    hsl(0, 0, 100%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(270, 100%, 50%),
    hsl(330, 40%, 70%),
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(90, 100%, 75%),
    hsl(0, 0, 100%),
    hsl(0, 0, 100%)
  );
}

/* Animation Properties Support */
@property --bg-position {
  syntax: "<number>";
  inherits: true;
  initial-value: 100;
}
@property --after-blur {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --after-opacity {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
@property --before-opacity {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.3;
}
@property --btn-offset {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
@property --btn-scale {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* Prevent scroll during focus session */
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--spacing-lg);
  position: relative;
}

/* Timer */
.timer-display {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-bottom: var(--spacing-xl);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.timer-display.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Main Action Area */
.action-area {
  display: grid;
  place-items: center;
  z-index: 10;
}

/* Button Styles */
.focus-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: transform 0.2s ease;
}

.focus-btn:disabled {
  pointer-events: none;
  cursor: default;
}

.focus-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.focus-btn:active:not(:disabled) {
  transform: translateY(0);
}

.focus-btn-content {
  display: block;
  padding: 1.2em 3em;
  background: rgba(4, 116, 252, 0.1);
  border: 2px solid var(--accent-color);
  color: white;
  font-weight: 700;
  border-radius: 50px;
  font-size: 1.5rem;
  position: relative;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 
    0 0 10px rgba(4, 116, 252, 0.3),
    0 0 20px rgba(4, 116, 252, 0.2),
    inset 0 0 10px rgba(4, 116, 252, 0.1);
  transition: all 0.3s ease;
}

.focus-btn:hover:not(:disabled) .focus-btn-content {
  background: rgba(4, 116, 252, 0.2);
  box-shadow: 
    0 0 20px rgba(4, 116, 252, 0.6),
    0 0 40px rgba(4, 116, 252, 0.4),
    0 0 60px rgba(4, 116, 252, 0.2),
    inset 0 0 20px rgba(4, 116, 252, 0.2);
}

.focus-btn-text {
  color: white;
  display: inline-block;
  position: relative;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes neonGlow {
  0%, 100% {
    box-shadow: 
      0 0 10px rgba(4, 116, 252, 0.3),
      0 0 20px rgba(4, 116, 252, 0.2),
      inset 0 0 10px rgba(4, 116, 252, 0.1);
  }
  50% {
    box-shadow: 
      0 0 20px rgba(4, 116, 252, 0.6),
      0 0 30px rgba(4, 116, 252, 0.4),
      0 0 40px rgba(4, 116, 252, 0.2),
      inset 0 0 15px rgba(4, 116, 252, 0.2);
  }
}

.focus-btn.animate .focus-btn-content {
  animation: neonGlow 2s ease-in-out infinite;
}

/* Active Session State */
.focus-btn.active .focus-btn-content {
  background: rgba(4, 116, 252, 0.3);
  border-color: #00ff88;
  animation: activeNeonPulse 1.5s ease-in-out infinite alternate;
}

@keyframes activeNeonPulse {
  from { 
    box-shadow: 
      0 0 15px rgba(0, 255, 136, 0.5),
      0 0 30px rgba(0, 255, 136, 0.3),
      0 0 45px rgba(0, 255, 136, 0.2),
      inset 0 0 15px rgba(0, 255, 136, 0.2);
  }
  to { 
    box-shadow: 
      0 0 25px rgba(0, 255, 136, 0.7),
      0 0 50px rgba(0, 255, 136, 0.5),
      0 0 75px rgba(0, 255, 136, 0.3),
      inset 0 0 25px rgba(0, 255, 136, 0.3);
  }
}

/* Controls */
.controls {
  margin-top: var(--spacing-xl);
  display: flex;
  gap: var(--spacing-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.controls.visible {
  opacity: 1;
  pointer-events: auto;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.control-btn:active {
  transform: translateY(0);
}

/* Footer */
.site-footer {
  position: absolute;
  bottom: var(--spacing-lg);
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  color: var(--secondary-text);
}

.footer-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  transition: text-shadow 0.3s ease;
}

.footer-link:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 600px) {
  .app-container {
    padding: var(--spacing-md);
  }
  
  .focus-btn-content {
    font-size: 1.2rem;
    padding: 0.8em 1.5em;
  }
}
