/* Tailwind CSS styles compiled for standalone use */

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

/* Color variables */
:root {
  --primary: #9D84B7;
  --secondary: #66C7B4;
  --accent: #F7A9A8;
  --success: #72E5BE;
  --warning: #FFD166;
  --error: #EF476F;
  --dark: #1A1A2E;
  --darker: #16213E;
}

/* Utility classes */
.min-h-screen { min-height: 100vh; }
.bg-dark { background-color: var(--dark); }
.bg-darker { background-color: var(--darker); }
.text-gray-100 { color: #F8F9FA; }
.text-gray-300 { color: #DEE2E6; }
.text-gray-400 { color: #CED4DA; }
.text-gray-500 { color: #ADB5BD; }
.text-gray-700 { color: #495057; }
.text-gray-800 { color: #343A40; }
.text-white { color: #ffffff; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* Background gradients */
.bg-gradient-to-br {
  background: linear-gradient(to bottom right, #1B1F3B, #3A4A7D);
}

.text-gradient {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Layout */
.container-custom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container-custom {
    padding: 0 2rem;
  }
}

/* CRITICAL: Expand container for 2-column layout */
@media (min-width: 1200px) {
  .container-custom {
    max-width: 1400px;
  }
}

/* Typography */
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-base { font-size: 1.05rem; line-height: 1.5rem; }
.text-sm { font-size: 0.975rem; line-height: 1.25rem; }
.text-xs { font-size: 0.85rem; line-height: 1rem; }

@media (min-width: 768px) {
  .md\\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-mono { font-family: 'Fira Code', monospace; }

/* Spacing */
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-8 { padding-top: 0.5rem; padding-bottom: 2rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }

.pt-3 { padding-top: 0.75rem; }
.pb-2 { padding-bottom: 0.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid - FIXED: Proper responsive grid implementation */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* FIXED: Responsive grid classes that actually work */
@media (min-width: 640px) {
  .sm\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sm\\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 768px) {
  .md\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (min-width: 1024px) {
  .lg\\:flex-row { flex-direction: row; }
  .lg\\:block { display: block; }
  .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lg\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .lg\\:col-span-1 { grid-column: span 1 / span 1; }
}

/* FIXED: Specific class for comparison stats grid */
.comparison-stats-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 640px) {
  .comparison-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .comparison-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  
  .comparison-stats-grid .card:last-child {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1200px) {
  .comparison-stats-grid .card:last-child {
    grid-column: span 1 / span 1;
  }
}

/* CRITICAL: 2-Column Keyboard Layout for 1200px+ screens */
.keyboards-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
}

@media (min-width: 1200px) {
  .keyboards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }
}

/* CRITICAL: 2-Column Productivity Layout for 1200px+ screens */
.productivity-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
  align-items: start !important;
}

@media (min-width: 1200px) {
  .productivity-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.btn-primary {
  background-color: #7F8CFF; // var(--primary);
  color: #FDFDFF;
}

.btn-primary:hover {
  background-color: #B28DFF;
}

.btn-outline {
  border: 2px solid var(--primary);
  color: white; // var(--primary);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: rgba(157, 132, 183, 0.3);
}

/* Cards */
.card {
  background-color: var(--darker);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid #374151;
  transition: all 0.3s;
}

.card:hover {
  border-color: rgba(157, 132, 183, 0.3);
}

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-gray-700 { border-color: #495057; }
.border-gray-800 { border-color: #343A40; }
.border-b { border-bottom-width: 1px; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.bottom-4 { bottom: 1rem; }
.left-4 { left: 1rem; }

/* Sizing */
.w-full { width: 100%; }
.w-px { width: 1px; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-6xl { max-width: 72rem; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Backdrop */
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* Z-index */
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }

/* Transitions */
.transition-colors { transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out; }
.transition-all { transition: all 0.15s ease-in-out; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Leading */
.leading-relaxed { line-height: 1.625; }

/* Space */
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Focus */
.focus\\:outline-none:focus { outline: none; }
.focus\\:ring-2:focus { box-shadow: 0 0 0 2px rgba(157, 132, 183, 0.5); }

/* Keyboard specific styles */
.keyboard-container {
  position: relative;
  width: 100%;
  height: 300px;
  background: linear-gradient(to bottom, #374151, #1f2937, #000000);
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid #374151;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.keyboard-keys {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.keyboard-layout {
  position: relative;
  width: 720px;
  height: 280px;
}

.key {
  position: absolute;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  border: 2px solid #d1d5db;
  background-color: #f3f4f6;
  color: #374151;
  transition: all 0.1s;
}

.key.active {
  transform: scale(1.05);
  color: white;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
}

.finger {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 20;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.typing-method-indicator {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 30;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Animation for cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink {
  animation: blink 1s infinite;
}

/* CRITICAL: Mobile Responsive Keyboard Fixes - PROPERLY CENTERED */
@media (max-width: 480px) {
  .container-custom {
    padding: 0 0.5rem;
  }
  
  .keyboard-container {
    height: 200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    border-radius: 0.375rem;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  
  .keyboard-keys {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
  }
  
  /* CRITICAL: Perfect keyboard centering calculation */
  .keyboard-layout {
    /* Original keyboard is 720px wide, scaled to 0.45 = 324px */
    /* Mobile screen is typically 375px, so we have 51px margin on each side */
    transform: scale(0.45) !important;
    transform-origin: center center !important;
    width: 720px !important;
    height: 280px !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    margin-left: -360px !important; /* Half of 720px */
    margin-top: -140px !important;  /* Half of 280px */
  }
  
  /* CRITICAL: Hide typing method badges on mobile */
  .typing-method-indicator {
    display: none !important;
  }
  
  /* Smaller text on mobile */
  .text-3xl { font-size: 1.25rem; line-height: 1.75rem; }
  .text-4xl { font-size: 1.5rem; line-height: 2rem; }
  .text-2xl { font-size: 1.125rem; line-height: 1.5rem; }
  .text-xl { font-size: 1rem; line-height: 1.5rem; }
  
  /* Adjust speed controls for mobile */
  .keyboards-grid {
    gap: 0.75rem !important;
  }
  
  .productivity-grid {
    gap: 0.75rem !important;
  }
  
  /* Make buttons smaller on mobile */
  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* Adjust card padding */
  .card {
    padding: 0.75rem;
  }
  
  /* Make speed control buttons smaller */
  .keyboards-grid button {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.625rem !important;
  }
  
  /* Adjust header spacing */
  .py-8 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .py-12 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  /* Make speed preset buttons smaller */
  #slowSpeedPresets button,
  #fastSpeedPresets button {
    padding: 0.125rem 0.375rem !important;
    font-size: 0.625rem !important;
  }
  
  /* Adjust progress text size */
  .font-mono {
    font-size: 0.75rem !important;
    line-height: 1.25rem !important;
  }
}

/* Responsive adjustments for tablets */
@media (max-width: 768px) and (min-width: 481px) {
  .container-custom {
    padding: 0 1rem;
  }
  
  .keyboard-layout {
    transform: scale(0.6) !important;
    transform-origin: center center !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    margin-left: -360px !important;
    margin-top: -140px !important;
  }
  
  .keyboard-container {
    height: 240px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .keyboard-keys {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }
  
  .text-3xl { font-size: 1.5rem; line-height: 2rem; }
  .text-4xl { font-size: 1.875rem; line-height: 2.25rem; }
  
  /* Adjust buttons for tablet */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .card {
    padding: 1.25rem;
  }
}

/* Responsive keyboard scaling for medium screens */
@media (max-width: 1199px) and (min-width: 769px) {
  .keyboard-layout {
    transform: scale(0.85);
    transform-origin: center;
  }
}

/* CRITICAL FIX: Specific positioning for 1200px-1290px range */
@media (min-width: 1200px) and (max-width: 1290px) {
  .keyboards-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important; /* Reduced gap for tighter screens */
  }
  
  .productivity-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important; /* Reduced gap for tighter screens */
  }
  
  .keyboard-layout {
    transform: scale(0.75) !important; /* Smaller scale for this range */
    transform-origin: center !important;
  }
  
  .keyboard-container {
    height: 260px !important; /* Reduced height */
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .keyboard-keys {
    padding: 0.25rem !important; /* Reduced padding */
  }
  
  /* Ensure container doesn't exceed available space */
  .container-custom {
    max-width: 1280px !important;
    padding: 0 1rem !important;
  }
}

/* CRITICAL: 2-Column Layout for 1291px+ screens */
@media (min-width: 1291px) {
  .keyboards-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }
  
  .productivity-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }
  
  .keyboard-layout {
    transform: scale(0.9);
    transform-origin: center;
  }
  
  /* Ensure the container has enough width */
  .container-custom {
    max-width: 1400px;
  }
  
  /* Adjust keyboard container for side-by-side layout */
  .keyboard-container {
    height: 280px; /* Slightly smaller for better fit */
  }
  
  /* Optimize text layout for 2-column */
  .keyboard-section {
    max-width: 100%;
  }
}

/* Form elements */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* New Styles */
.speed-display {
  font-size: 1rem;
  font-weight: bold;
  min-width: 60px;
  text-align: center;
}

.speed-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background-color: rgba(178, 124, 68, 0.2);
  color: #b27c44;
  border: none;
  cursor: pointer;
}

.text-gold {
  color: #b27c44;
}

.gradient-border {
  background: linear-gradient(to right, rgba(178, 124, 68, 0.5), rgba(178, 124, 68, 0.3));
}

.speed-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.05);
  margin: 0.75rem 0;
}

.keyboard-container {
  width: 100%;
  height: 240px;
  background-color: #0f1115;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .speed-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
}


.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

/* Base styles for buttons */
.cta-container a.btn {
  display: inline-block;
  padding: 16px 24px;
  font-size: 1rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
  border-radius: 8px;
}

/* On medium screens and up: horizontal layout */
@media (min-width: 768px) {
  .cta-container {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .cta-container a.btn {
    width: auto;
    min-width: 220px;
    font-size: 1.125rem; /* larger text */
  }
}

  #dailyTypingTime {
        background-color: #2C2C2C; /* Dark background */
        color: #FFFFFF; /* White text */
        border: 2px solid #6A4C93; /* Purple border */
        border-radius: 0.5rem; /* Rounded corners */
        padding: 0.5rem; /* Padding inside the dropdown */
        font-size: 0.875rem; /* Text size */
    }

    #dailyTypingTime:focus {
        outline: none; /* Remove default focus outline */
        border-color: #8A2BE2; /* Brighter purple border on focus */
        box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.5); /* Purple glow effect on focus */
    }

    #dailyTypingTime option {
        background-color: #2C2C2C; /* Dark background for options */
        color: #FFFFFF; /* White text for options */
    }
  