/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */
:root {
    /* Color Palette */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --gray-color: #6c757d;
    --light-gray: #f0f0f0;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --shimmer-gradient: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);

    /* Shadows */
    --soft-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --medium-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --strong-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --glow-shadow: 0 0 30px rgba(102, 126, 234, 0.4);

    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-xxl: 40px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-xxl: 30px;
    --radius-full: 50px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   RESET & BASE STYLES WITH ANIMATIONS
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: var(--font-family);
    background: var(--primary-gradient);
    color: var(--dark-color);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    animation: rotateGradient 20s linear infinite;
    z-index: -1;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating Particles Animation */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent);
    background-size: 200% 200%;
    animation: float 15s ease-in-out infinite;
    opacity: 0.3;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

/* ========================================
    LAYOUT & CONTAINER
    ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    animation: fadeInUp 0.8s ease-out;
    width: 100%;
    box-sizing: border-box;
}

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

/* ========================================
   HEADER WITH GLASSMORPHISM
   ======================================== */
header {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--medium-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

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

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--shimmer-gradient);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

header .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    width: 100%;
}

header h1 {
    font-size: 2.5em;
    color: var(--white-color);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    display: inline;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); }
    to { text-shadow: 2px 2px 20px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.2); }
}

header .subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1em;
    font-weight: 500;
    display: inline;
}

.current-mode-indicator {
    margin-bottom: 20px;
}

.mode-status {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: modeTransition 0.3s ease-in-out;
}

@keyframes modeTransition {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mode Tabs with Smooth Transitions */
.mode-tabs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin: var(--spacing-lg) 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.tab-btn {
    padding: 12px var(--spacing-xl);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tab-btn:hover::before {
    width: 300px;
    height: 300px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--soft-shadow);
}

.tab-btn.active {
    background: var(--white-color);
    color: var(--primary-color);
    border-color: var(--white-color);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

/* ========================================
   TAP SECTION WITH ADVANCED ANIMATIONS
   ======================================== */
.tap-section {
    background: var(--white-color) !important;
    border-radius: var(--radius-xxl) !important;
    padding: 60px 40px !important;
    text-align: center !important;
    box-shadow: var(--strong-shadow) !important;
    margin-bottom: var(--spacing-xl) !important;
    cursor: pointer !important;
    transition: all var(--transition-normal) !important;
    position: relative !important;
    overflow: hidden !important;
    animation: scaleIn 0.6s ease-out 0.2s both !important;
    z-index: 1 !important;
}

/* Ensure tap sections maintain white background during all states */
.tap-section,
.tap-section:hover,
.tap-section:active,
.tap-section:focus,
.tap-section.pulse,
.tap-section * {
    background: var(--white-color) !important;
}

/* Override any background changes from animations or interactions */
.tap-section::before,
.tap-section::after {
    background: transparent !important;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tap-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    opacity: 0;
    transition: opacity 0.5s;
}

.tier-section:hover::before {
    opacity: 1;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tier-2 {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(102, 126, 234, 0.02) 100%);
    animation: tier2Entrance 0.7s ease-out;
}

.tier-3 {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.08) 0%, rgba(118, 75, 162, 0.03) 100%);
    animation: tier3Entrance 0.7s ease-out 0.2s both;
}

@keyframes tier2Entrance {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tier3Entrance {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tier-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    position: relative;
}

.tier-2-title {
    color: var(--primary-color);
    animation: titlePulse 2s ease-in-out infinite;
}

.tier-3-title {
    color: var(--secondary-color);
    animation: titlePulse 2s ease-in-out infinite 0.5s;
}

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

.tier-description {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: var(--spacing-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.feature-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card:hover::after {
    opacity: 1;
    animation: featureGlow 1.5s ease-in-out;
}

@keyframes featureGlow {
    0% { transform: translate(-50%, -50%); }
    100% { transform: translate(0, 0); }
}

.feature-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--card-shadow);
    border-color: var(--secondary-color);
}

.feature-card h4 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: #666;
    font-size: 1em;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.tier-2-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid var(--primary-color);
    position: relative;
    animation: cardFloat 3s ease-in-out infinite;
}

.tier-2-card:nth-child(even) {
    animation-delay: 0.5s;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tier-3-card {
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.15) 0%, rgba(102, 126, 234, 0.05) 100%);
    border: 2px solid var(--secondary-color);
    position: relative;
    animation: cardFloat 3s ease-in-out infinite;
}

.tier-3-card:nth-child(even) {
    animation-delay: 0.7s;
}

.coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badgePulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes badgePulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
        transform: scale(1.05);
    }
}

.coming-soon-badge.tier-3 {
    background: var(--secondary-color);
}

/* Support Section with Gradient */
.support-section {
    margin-top: var(--spacing-xxl);
    padding: var(--spacing-xxl);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    border-radius: var(--radius-xl);
    border: 2px solid var(--success-color);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: supportEntrance 0.8s ease-out 0.4s both;
}

@keyframes supportEntrance {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.support-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.2), transparent);
    animation: supportShimmer 3s infinite;
}

@keyframes supportShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.support-section h3 {
    color: var(--success-color);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.support-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.support-card {
    background: var(--white-color);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    text-align: center;
    position: relative;
    transition: all var(--transition-normal);
}

.support-card:hover {
    transform: translateY(-8px) rotate(-1deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.support-card h4 {
    color: var(--dark-color);
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.current-tier {
    background: var(--success-color);
    color: var(--white-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    animation: currentTierGlow 2s ease-in-out infinite;
}

@keyframes currentTierGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(40, 167, 69, 0.5); }
    50% { box-shadow: 0 0 20px rgba(40, 167, 69, 0.8); }
}

.support-cta {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--success-color);
    margin-top: var(--spacing-xl);
    position: relative;
    z-index: 1;
    animation: ctaBounce 2s ease-in-out infinite;
}

/* ========================================
   QUICK START GUIDE & FAQ SECTIONS
   ======================================== */
.quick-start-section,
.faq-section {
    margin-top: var(--spacing-xxl);
    padding: var(--spacing-xxl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: var(--font-size-xxxxl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.guide-grid,
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.guide-card,
.faq-item {
    background: var(--white-color);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--transition-normal);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.guide-card:hover,
.faq-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.guide-card h4,
.faq-item h4 {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.guide-card p,
.faq-item p {
    color: #666;
    font-size: var(--font-size-base);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.guide-features {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.feature-tag {
    background: var(--primary-gradient);
    color: var(--white-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes ctaBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ========================================
    COMPREHENSIVE MOBILE RESPONSIVENESS
    ======================================== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: var(--spacing-md);
        max-width: 100%;
    }

    header {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: var(--spacing-md);
    }

    .support-tiers {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Tablets and large phones */
@media (max-width: 768px) {
    :root {
        --spacing-xs: 4px;
        --spacing-sm: 8px;
        --spacing-md: 12px;
        --spacing-lg: 16px;
        --spacing-xl: 24px;
        --spacing-xxl: 32px;
    }

    /* Reduce animation intensity on mobile */
    body::before,
    body::after {
        animation-duration: 30s;
        background-size: 150% 150%;
    }

    .container {
        padding: var(--spacing-md) var(--spacing-sm);
        max-width: 100%;
        width: 100%;
    }

    header {
        padding: var(--spacing-lg) var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    header h1 {
        font-size: 1.8em;
        animation: none;
        line-height: 1.2;
    }

    header .subtitle {
        font-size: 1em;
        line-height: 1.3;
    }

    .mode-tabs {
        gap: var(--spacing-xs);
        margin: var(--spacing-md) 0;
    }

    .tab-btn {
        padding: 10px var(--spacing-lg);
        font-size: 0.9em;
        min-height: 44px; /* Touch target size */
        min-width: 44px;
    }

    /* Tap section optimization for mobile */
    .tap-section {
        padding: 40px 20px !important;
        margin-bottom: var(--spacing-lg) !important;
        min-height: 200px;
        touch-action: manipulation;
    }

    #bpm-display {
        font-size: 5em;
        line-height: 1.1;
    }

    .bpm-label {
        font-size: 1.8em;
        letter-spacing: 2px;
    }

    .tempo-indicator {
        font-size: 1.3em;
        margin-top: var(--spacing-md);
    }

    .accuracy-display {
        font-size: 1.5em;
        margin-top: 10px;
    }

    /* Metronome toggle for mobile */
    .metronome-toggle {
        margin: 12px 0;
        gap: var(--spacing-sm);
    }

    .toggle-switch {
        width: 50px;
        height: 26px;
        transform: scale(0.9);
    }

    .toggle-switch::after {
        width: 22px;
        height: 22px;
    }

    .toggle-switch.active::after {
        left: 26px;
    }

    /* Subdivision controls for mobile */
    .subdivision-controls {
        gap: var(--spacing-xs);
        margin: var(--spacing-md) 0;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .subdivision-btn {
        padding: 8px 16px;
        font-size: 0.85em;
        min-height: 40px;
        min-width: 40px;
    }

    /* Stats grid for tablets */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    .stat-card {
        padding: 20px 15px;
        min-height: 100px;
    }

    .stat-label {
        font-size: 0.85em;
        margin-bottom: 8px;
    }

    .stat-value {
        font-size: 2em;
    }

    /* Action buttons for mobile */
    .action-buttons {
        gap: var(--spacing-sm);
        margin: var(--spacing-lg) 0;
        flex-direction: column;
    }

    .btn {
        padding: 12px 24px;
        font-size: 1em;
        min-height: 44px; /* Touch target */
        width: 100%;
        max-width: 300px;
    }

    /* Chart containers for mobile */
    .chart-container {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }

    .chart-title {
        font-size: 1.3em;
        margin-bottom: var(--spacing-md);
    }

    /* Feature cards for mobile */
    .feature-card {
        padding: 20px 15px;
    }

    .feature-card h4 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .feature-card p {
        font-size: 0.9em;
        line-height: 1.4;
    }

    /* Support section for mobile */
    .support-section {
        padding: var(--spacing-lg);
        margin-top: var(--spacing-lg);
    }

    .support-tiers {
        gap: var(--spacing-md);
    }

    .support-card {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    /* Info section for mobile */
    .info-section {
        padding: var(--spacing-lg);
        margin-top: var(--spacing-lg);
    }

    .info-section h2 {
        font-size: 1.6em;
        margin-bottom: var(--spacing-md);
    }

    .info-section h3 {
        font-size: 1.3em;
        margin: var(--spacing-md) 0 var(--spacing-sm);
    }

    .info-section h4 {
        font-size: 1.1em;
        margin: var(--spacing-sm) 0 var(--spacing-xs);
    }

    .info-section p,
    .info-section ul li,
    .info-section ol li {
        font-size: 0.95em;
        line-height: 1.5;
        margin-bottom: var(--spacing-sm);
    }

    /* Practice mode for mobile */
    .practice-controls {
        padding: var(--spacing-md);
        margin: var(--spacing-md) 0;
    }

    .practice-input {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: stretch;
    }

    .practice-input input {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        font-size: 1.1em;
        padding: 12px;
        min-height: 44px;
    }

    #practice-bpm-display {
        font-size: 5em;
    }

    /* Share modal for mobile */
    .share-modal {
        padding: var(--spacing-sm);
        align-items: flex-end;
    }

    .share-content {
        max-width: 100%;
        width: 100%;
        margin-bottom: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .share-buttons {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .share-btn {
        padding: 12px;
        min-height: 44px;
    }

    /* Hover effects for touch devices */
    .stat-card:hover,
    .feature-card:hover,
    .support-card:hover {
        transform: translateY(-2px);
    }

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

    /* Mobile responsive coming soon badges - 30% size reduction */
    .coming-soon-badge {
        font-size: 0.6em;
        padding: 4px 8px;
        top: 8px;
        right: 8px;
        min-height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    :root {
        --spacing-xs: 3px;
        --spacing-sm: 6px;
        --spacing-md: 10px;
        --spacing-lg: 14px;
        --spacing-xl: 20px;
        --spacing-xxl: 28px;
    }

    .container {
        padding: var(--spacing-sm);
    }

    header {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    header h1 {
        font-size: 1.5em;
        text-align: center;
    }

    header .subtitle {
        font-size: 0.9em;
        text-align: center;
    }

    .mode-tabs {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .tab-btn {
        width: 100%;
        max-width: 250px;
        padding: 12px;
    }

    /* Tap section for small screens */
    .tap-section {
        padding: 30px 15px !important;
        margin-bottom: var(--spacing-md) !important;
        min-height: 180px;
    }

    #bpm-display {
        font-size: 3.5em;
    }

    .bpm-label {
        font-size: 1.4em;
        letter-spacing: 1px;
    }

    .tempo-indicator {
        font-size: 1.1em;
    }

    .accuracy-display {
        font-size: 1.3em;
    }

    .instruction {
        font-size: 1.1em;
        margin-bottom: var(--spacing-lg);
    }

    /* Stats grid for phones */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .stat-card {
        padding: 15px 12px;
        min-height: 80px;
    }

    .stat-label {
        font-size: 0.8em;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1.8em;
    }

    /* Controls for phones */
    .subdivision-controls {
        justify-content: center;
        gap: var(--spacing-xs);
    }

    .subdivision-btn {
        padding: 6px 12px;
        font-size: 0.8em;
        min-height: 36px;
        min-width: 36px;
    }

    .metronome-toggle {
        margin: 10px 0;
    }

    /* Action buttons for phones */
    .action-buttons {
        gap: var(--spacing-xs);
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
        min-height: 40px;
    }

    /* Charts for phones */
    .chart-container {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .chart-title {
        font-size: 1.2em;
        margin-bottom: var(--spacing-sm);
    }

    /* Practice mode for phones */
    .practice-controls {
        padding: var(--spacing-sm);
    }

    #practice-bpm-display {
        font-size: 3.5em;
    }

    #targetDisplay {
        font-size: 1.2em;
    }

    #practiceAccuracy {
        font-size: 1.3em;
    }

    #practiceScore {
        font-size: 1.1em;
    }

    /* Info section for phones */
    .info-section {
        padding: var(--spacing-md);
    }

    .info-section h2 {
        font-size: 1.4em;
    }

    .info-section h3 {
        font-size: 1.2em;
    }

    .info-section h4 {
        font-size: 1em;
    }

    .info-section p,
    .info-section ul li,
    .info-section ol li {
        font-size: 0.9em;
        line-height: 1.4;
    }

    /* Feature grid for phones */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .feature-card {
        padding: 15px 12px;
    }

    .feature-card h4 {
        font-size: 1em;
    }

    .feature-card p {
        font-size: 0.85em;
    }

    /* Support section for phones */
    .support-tiers {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .support-card {
        padding: var(--spacing-md);
    }

    /* Share modal for phones */
    .share-modal {
        padding: var(--spacing-xs);
    }

    .share-content {
        padding: var(--spacing-md);
    }

    .share-title {
        font-size: 1.4em;
    }

    /* Disable complex animations on small screens */
    .tier-2-card,
    .tier-3-card,
    .support-card {
        animation: none;
    }

    /* Reduce visual effects for performance */
    .tap-section::before,
    .tier-section::before,
    .support-section::before {
        opacity: 0.3;
    }

    /* Enhanced mobile coming soon badges for phones - 30% size reduction */
    .coming-soon-badge {
        font-size: 0.65em;
        padding: 6px 10px;
        top: 6px;
        right: 6px;
        min-height: 22px;
        font-weight: 700;
        letter-spacing: 0.8px;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Very small phones */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.3em;
    }

    header .subtitle {
        font-size: 0.85em;
    }

    #bpm-display {
        font-size: 3em;
    }

    .bpm-label {
        font-size: 1.2em;
    }

    .tempo-indicator {
        font-size: 1em;
    }

    .accuracy-display {
        font-size: 1.1em;
    }

    .instruction {
        font-size: 1em;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85em;
    }

    /* Very small phone optimizations for coming soon badges - 30% size reduction */
    .coming-soon-badge {
        font-size: 0.67em;
        padding: 7px 11px;
        top: 4px;
        right: 4px;
        min-height: 25px;
        font-weight: 800;
        letter-spacing: 1px;
        border-width: 3px;
    }
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */
@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* ========================================
    MOBILE PERFORMANCE & TOUCH OPTIMIZATIONS
    ======================================== */

/* Touch action optimizations for better mobile performance */
.tap-section,
.subdivision-btn,
.tab-btn,
.btn,
.toggle-switch {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Improve touch targets for accessibility */
.subdivision-btn,
.tab-btn,
.btn {
    min-height: 44px;
    min-width: 44px;
    position: relative;
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
    /* Reduce complex gradients on mobile for better performance */
    body::before {
        background-size: 150% 150%;
        animation-duration: 40s;
    }

    body::after {
        animation-duration: 25s;
    }

    /* Optimize animations for mobile */
    .tap-section::before {
        animation-duration: 15s;
    }

    /* Reduce shadow complexity on mobile */
    .stat-card,
    .chart-container,
    .feature-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .tap-section {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    }
}

/* Improve scrolling performance on mobile */
* {
    -webkit-overflow-scrolling: touch;
}

/* Better font rendering on mobile */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========================================
    ACCESSIBILITY & PERFORMANCE
    ======================================== */
.tab-btn:focus,
.subdivision-btn:focus,
.btn:focus,
.toggle-switch:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before,
    body::after {
        animation: none;
    }

    .tap-section:hover,
    .btn:hover,
    .stat-card:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --secondary-color: #551a8b;
        --dark-color: #000000;
    }

    .tab-btn {
        border-width: 3px;
    }

    .btn {
        border: 3px solid currentColor;
    }
}

/* Print Styles */
@media print {
    html, body {
        background: white;
        color: black;
    }

    .share-modal,
    .action-buttons,
    body::before,
    body::after {
        display: none;
    }

    .tap-section,
    .chart-container,
    .info-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* ========================================
   UTILITY ANIMATIONS
   ======================================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Info Section Improvements */
.info-section h2,
.info-section h3 {
    position: relative;
    display: inline-block;
}

.info-section h2::after,
.info-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.info-section h3::after {
    width: 40px;
    height: 2px;
}

.info-section ul li {
    position: relative;
    padding-left: 10px;
}

.info-section ul li::marker {
    color: var(--primary-color);
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin: 10px 0;
    animation: slideInDown 0.3s ease-out;
}

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

.message-success {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.message-error {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.tap-section:hover {
    background: var(--white-color) !important;
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25), var(--glow-shadow) !important;
}

.tap-section:active {
    transform: scale(0.97);
}

.tap-section.pulse {
    animation: pulseAnimation 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulseAnimation {
    0%, 100% {
        background: var(--white-color) !important;
        box-shadow: var(--strong-shadow) !important;
    }
    50% {
        background: var(--white-color) !important;
        box-shadow: 0 25px 80px rgba(102, 126, 234, 0.6) !important;
        transform: scale(1.02);
    }
}

.instruction {
    color: var(--primary-color);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

#bpm-display {
    font-size: 10em;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin: 20px 0;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#bpm-display:not(:empty) {
    animation: numberPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes numberPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bpm-label {
    font-size: 3em;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tempo-indicator {
    margin-top: var(--spacing-lg);
    font-size: 1.5em;
    font-weight: 600;
    color: var(--primary-color);
    min-height: 40px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-out;
}

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

.accuracy-display {
    margin-top: 15px;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--success-color);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* ========================================
   CONTROLS WITH MICRO-INTERACTIONS
   ======================================== */
.subdivision-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin: var(--spacing-lg) 0;
    flex-wrap: wrap;
}

.subdivision-btn {
    padding: 10px 20px;
    background: var(--white-color);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9em;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.subdivision-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--primary-gradient);
    transition: height 0.3s ease;
    z-index: -1;
}

.subdivision-btn:hover::after {
    height: 100%;
}

.subdivision-btn:hover {
    color: var(--white-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--soft-shadow);
}

.subdivision-btn.active {
    background: var(--primary-gradient);
    color: var(--white-color);
    border-color: var(--primary-color);
    box-shadow: var(--soft-shadow);
    animation: scaleInBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleInBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Metronome Toggle with Smooth Animation */
.metronome-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: 15px 0;
    position: relative;
    z-index: 1;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch:hover {
    transform: scale(1.05);
}

.toggle-switch.active {
    background: var(--success-color);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: var(--white-color);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    left: 32px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Practice Controls */
.practice-controls {
    background: rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
    border: 2px solid rgba(102, 126, 234, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.practice-input {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.practice-input input {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 1.2em;
    width: 100px;
    text-align: center;
    font-weight: 600;
    transition: all var(--transition-normal);
    background: var(--white-color);
}

.practice-input input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

/* ========================================
   BUTTONS WITH ADVANCED EFFECTS
   ======================================== */
.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin: var(--spacing-xl) 0;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--soft-shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

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

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

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

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========================================
   STATS CARDS WITH HOVER EFFECTS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--white-color);
    padding: 25px;
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    animation: cardPopIn 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardPopIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--shimmer-gradient);
    transition: left 0.7s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    color: var(--primary-color);
    font-size: 2.5em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.15);
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* ========================================
   CHARTS WITH SMOOTH ANIMATIONS
   ======================================== */
.chart-container {
    background: var(--white-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--card-shadow);
    margin-bottom: var(--spacing-xl);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.chart-container:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.chart-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: var(--spacing-lg);
    position: relative;
    display: inline-block;
}

.chart-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
}

.chart-container:hover .chart-title::after {
    width: 100%;
}

/* ========================================
   MODAL WITH BACKDROP BLUR
   ======================================== */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.share-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

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

.share-content {
    background: var(--white-color);
    padding: var(--spacing-xxl);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--strong-shadow);
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.share-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--dark-color);
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.share-btn {
    padding: 15px;
    border-radius: var(--radius-md);
    border: none;
    color: var(--white-color);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.share-btn:hover::before {
    width: 300px;
    height: 300px;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--soft-shadow);
}

.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #4267B2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.linkedin { background: #0077B5; }

/* ========================================
   ROADMAP SECTION WITH GRADIENTS
   ======================================== */
.info-section {
    background: var(--white-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xxl);
    margin-top: var(--spacing-xxl);
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.roadmap-container {
    margin-top: var(--spacing-xl);
}

.tier-section {
    margin-bottom: var(--spacing-xxl);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.tier-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.tier-section:hover::before {
    opacity: 1;
}

/* Additional styling for info-section content */
.info-section {
    position: relative;
    overflow: hidden;
}

.info-section p {
    color: var(--dark-color);
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.info-section ul {
    list-style-type: none;
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-md);
}

.info-section ul li {
    position: relative;
    margin-bottom: var(--spacing-sm);
    font-size: 1em;
    color: var(--gray-color);
    line-height: 1.5;
}

.info-section ul li::before {
    content: '•';
    position: absolute;
    left: -10px;
    color: var(--primary-color);
    font-size: 1.2em;
}

.info-section ol {
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-xl);
}

.info-section ol li {
    margin-bottom: var(--spacing-sm);
    font-size: 1em;
    color: var(--dark-color);
    line-height: 1.5;
}

.info-section h4 {
    color: var(--primary-color);
    font-size: 1.3em;
    font-weight: 600;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    position: relative;
}

.info-section h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Styling for practice mode inputs and labels */
.practice-controls label {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark-color);
    transition: all var(--transition-normal);
}

.practice-controls label:hover {
    color: var(--primary-color);
}

.practice-input input {
    background: var(--light-gray);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-normal);
    width: 100px;
}

.practice-input input:hover {
    border-color: var(--secondary-color);
    transform: scale(1.03);
}

.practice-input input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: var(--glow-shadow);
    transform: scale(1.05);
}

/* Practice Tap Area - Ensure consistent white background */
#practiceTapArea {
    background: var(--white-color) !important;
    border-radius: var(--radius-xxl) !important;
    padding: 60px var(--spacing-lg) !important;
    text-align: center !important;
    box-shadow: var(--strong-shadow) !important;
    margin-bottom: var(--spacing-xl) !important;
    cursor: pointer !important;
    transition: all var(--transition-normal) !important;
    position: relative !important;
    overflow: hidden !important;
    animation: scaleIn 0.6s ease-out 0.2s both !important;
    z-index: 1 !important;
}

/* Ensure practice tap area maintains styling when visible */
#practiceMode #practiceTapArea {
    display: block !important;
    background: var(--white-color) !important;
    opacity: 1 !important;
}

/* Styling for practice mode specific elements */
#practice-bpm-display {
    font-size: 8em;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

#practice-bpm-display:not(:empty) {
    animation: numberPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#targetDisplay {
    color: var(--secondary-color);
    font-weight: 700;
}

#practiceAccuracy {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--success-color);
    transition: all var(--transition-normal);
}

#practiceScore {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--dark-color);
    transition: all var(--transition-normal);
}

/* Styling for share modal buttons */
.share-btn {
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-normal);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--medium-shadow);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: var(--soft-shadow);
}

/* Styling for mode-content sections */
.mode-content {
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.mode-content:not([style*="display: none"]) {
    animation: fadeInUp 0.6s ease-out;
}

/* Styling for disabled buttons */
.btn:disabled {
    background: var(--gray-color);
    color: var(--white-color);
    border-color: var(--gray-color);
    cursor: not-allowed;
    box-shadow: none;
}

/* Additional hover effects for interactive elements */
.tap-section:hover .instruction {
    color: var(--secondary-color);
    animation: bounce 1.5s ease-in-out infinite;
}

.tap-section:active .instruction {
    animation: none;
}

/* Styling for tempo indicator text */
.tempo-indicator:empty::before {
    content: 'Tap to start';
    color: var(--gray-color);
    font-style: italic;
}

/* Ensure consistent typography across sections */
h2, h3, h4 {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--dark-color);
}

/* Animation for buttons on click */
.btn:active,
.subdivision-btn:active,
.tab-btn:active {
    transform: scale(0.95);
}

/* Styling for responsive adjustments */
@media (max-width: 768px) {
    .info-section h2 {
        font-size: 1.8em;
    }

    .info-section h3 {
        font-size: 1.5em;
    }

    .info-section p,
    .info-section ul li,
    .info-section ol li {
        font-size: 0.95em;
    }

    .practice-input input {
        width: 80px;
        font-size: 1em;
    }

    #practice-bpm-display {
        font-size: 6em;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

    .guide-grid,
    .faq-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .quick-start-section,
    .faq-section {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .info-section h2 {
        font-size: 1.5em;
    }

    .info-section h3 {
        font-size: 1.3em;
    }

    .practice-controls {
        padding: var(--spacing-md);
    }

    .practice-input {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .practice-input input {
        width: 100%;
        max-width: 150px;
    }

    .share-content {
        padding: var(--spacing-lg);
    }

    .share-title {
        font-size: 1.5em;
    }
}

/* Ensure accessibility for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
    .info-section,
    .tier-section,
    .practice-controls,
    .share-modal,
    .share-content {
        animation: none;
    }

    .practice-input input,
    .share-btn,
    .btn,
    .subdivision-btn,
    .tab-btn {
        transition: none;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .info-section {
        background: var(--white-color);
        border: 2px solid var(--dark-color);
    }

    .info-section p,
    .info-section ul li,
    .info-section ol li {
        color: var(--dark-color);
    }

    .practice-input input {
        border: 3px solid var(--dark-color);
        background: var(--white-color);
    }

    .share-btn {
        border: 2px solid var(--dark-color);
    }
}

/* Print styles */
@media print {
    .info-section,
    .roadmap-container,
    .support-section {
        box-shadow: none;
        border: 1px solid #000;
    }

    .info-section h2::after,
    .info-section h3::after,
    .info-section h4::after {
        background: #000;
    }

    .tier-section::before,
    .support-section::before,
    .tap-section::before {
        display: none;
    }
}