/* =========================================
   BPM Counter Tool - PREMIUM UI
   Version: 4.0 | AI-Style Neon Theme
   Mobile-First | AdSense Optimized
   ========================================= */

/* ==========================================
   UI UPGRADE: NEON AI STYLE
   ========================================== */

/* Enhanced Tool Card - Centered & Rounded */
.tool-card {
    background: linear-gradient(165deg,
            rgba(18, 22, 38, 0.98) 0%,
            rgba(12, 15, 28, 0.99) 100%);
    border: 1px solid rgba(27, 152, 224, 0.25);
    border-radius: 32px;
    padding: 40px 35px;
    margin: 0 auto 40px;
    max-width: 600px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(27, 152, 224, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

/* Neon Glow Border Effect */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            #1b98e0 0%,
            #00d4ff 25%,
            #9b59b6 50%,
            #e91e63 75%,
            #1b98e0 100%);
    background-size: 200% 100%;
    animation: neonBorderFlow 4s linear infinite;
}

@keyframes neonBorderFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Light Theme Tool Card */
[data-theme="light"] .tool-card {
    background: linear-gradient(165deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 250, 252, 0.99) 100%);
    border-color: rgba(0, 102, 204, 0.15);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.12),
        0 0 40px rgba(0, 102, 204, 0.05);
}

/* Enhanced BPM Display - Shadowed Counter Box */
.bpm-display-container {
    background: linear-gradient(145deg,
            rgba(15, 18, 32, 0.95) 0%,
            rgba(22, 26, 45, 0.90) 100%);
    border: 2px solid rgba(27, 152, 224, 0.3);
    border-radius: 28px;
    padding: 50px 40px;
    margin-bottom: 35px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(27, 152, 224, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 0.05),
        inset 0 -2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Inner Neon Glow */
.bpm-display-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: radial-gradient(ellipse at 50% 0%,
            rgba(27, 152, 224, 0.15) 0%,
            transparent 60%);
    pointer-events: none;
}

[data-theme="light"] .bpm-display-container {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(240, 244, 250, 0.95) 100%);
    border-color: rgba(0, 102, 204, 0.2);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(0, 102, 204, 0.08);
}

/* BIG TAP BUTTON - Mobile First + GPU Optimized */
.tap-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1b98e0 0%, #00b4ff 40%, #9b59b6 100%);
    background-size: 200% 200%;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: pointer;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: gradientPulse 4s ease-in-out infinite, buttonFloat 3s ease-in-out infinite;
    box-shadow:
        0 20px 50px rgba(27, 152, 224, 0.5),
        0 0 80px rgba(27, 152, 224, 0.25),
        inset 0 -6px 20px rgba(0, 0, 0, 0.2),
        inset 0 6px 20px rgba(255, 255, 255, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: visible;
    /* Performance Optimization: GPU Acceleration */
    will-change: transform, opacity;
    -webkit-tap-highlight-color: transparent;
    /* Mobile UX: Prevent accidental zoom */
    touch-action: manipulation;
}

@keyframes gradientPulse {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes buttonFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Pulse Ring around Button */
.tap-btn::after {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 3px solid rgba(27, 152, 224, 0.5);
    animation: pulseRingExpand 2s ease-out infinite;
}

@keyframes pulseRingExpand {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

.tap-btn:hover {
    transform: translateY(-6px) scale(1.05);
    animation: none;
    box-shadow:
        0 30px 70px rgba(27, 152, 224, 0.6),
        0 0 100px rgba(27, 152, 224, 0.35),
        inset 0 -6px 20px rgba(0, 0, 0, 0.2),
        inset 0 6px 25px rgba(255, 255, 255, 0.2);
}

.tap-btn:active {
    transform: scale(0.92);
    animation: none;
    box-shadow:
        0 10px 30px rgba(27, 152, 224, 0.4),
        0 0 50px rgba(27, 152, 224, 0.2);
}

.tap-btn i {
    font-size: 3.5rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Mobile First - BIGGER Button on Mobile for Easy Tapping */
@media (max-width: 768px) {
    .tap-btn {
        width: 220px;
        height: 220px;
        font-size: 1.8rem;
        /* Mobile: Disable heavy animations for battery */
        animation: none;
    }

    .tool-card {
        padding: 30px 20px;
        margin: 0 15px 30px;
        border-radius: 24px;
    }

    .bpm-display-container {
        padding: 35px 25px;
        border-radius: 20px;
    }

    /* Disable floating animations on mobile for performance */
    .floating-notes,
    .floating-icons {
        display: none !important;
    }
}

/* Action Buttons - Big & Rounded */
.btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.reset-btn,
.copy-bpm-btn {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 16px;
    border: 2px solid rgba(27, 152, 224, 0.3);
    background: rgba(27, 152, 224, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reset-btn:hover,
.copy-bpm-btn:hover {
    background: rgba(27, 152, 224, 0.2);
    border-color: rgba(27, 152, 224, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(27, 152, 224, 0.2);
}

/* Stats Grid - Enhanced Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-box {
    background: linear-gradient(145deg,
            rgba(27, 152, 224, 0.08) 0%,
            rgba(27, 152, 224, 0.02) 100%);
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 18px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: rgba(27, 152, 224, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(27, 152, 224, 0.15);
}

/* ==========================================
   ADSENSE OPTIMIZATION - ONLY 2 ADS
   Strategic Placement for High CTR
   ========================================== */

/* AD 1: Below Tool (Responsive) */
.ad-below-tool {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background: rgba(27, 152, 224, 0.03);
    border: 1px dashed rgba(27, 152, 224, 0.2);
    border-radius: 16px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AD 2: Footer Ad */
.ad-footer-section {
    max-width: 728px;
    margin: 50px auto 30px;
    padding: 20px;
    background: rgba(27, 152, 224, 0.03);
    border: 1px dashed rgba(27, 152, 224, 0.2);
    border-radius: 16px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide excess ads on mobile for speed */
@media (max-width: 480px) {
    .ad-footer-section {
        display: none;
    }
}

/* Ad placeholder styling */
.ad-placeholder-minimal {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="light"] .ad-below-tool,
[data-theme="light"] .ad-footer-section {
    background: rgba(0, 102, 204, 0.03);
    border-color: rgba(0, 102, 204, 0.15);
}

/* ==========================================
   ORIGINAL STYLES (Enhanced Below)
   ========================================== */

/* BPM Display Container */
.bpm-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-lg);
}

.bpm-display-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(27, 152, 224, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bpm-display-container:hover::before {
    opacity: 1;
}

.bpm-display-container.beat-flash {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(27, 152, 224, 0.15), rgba(155, 89, 182, 0.1));
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(27, 152, 224, 0.4);
}

/* BPM Value Display */
.bpm-value {
    font-size: 7rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Fira Code', 'SF Mono', monospace;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(27, 152, 224, 0.3);
    transition: color 0.3s ease;
}

/* BPM Color States */
.bpm-value.slow {
    color: #3498db;
}

.bpm-value.moderate {
    color: #2ecc71;
}

.bpm-value.fast {
    color: #f39c12;
}

.bpm-value.very-fast {
    color: #e74c3c;
}

.bpm-label {
    font-size: 1.4rem;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 15px;
    font-weight: 600;
}

/* Tap Button */
.tap-btn {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(27, 152, 224, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    transition: all 0.12s ease;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    user-select: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 2px;
}

.tap-btn::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.tap-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 50%);
    pointer-events: none;
}

.tap-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 50px rgba(27, 152, 224, 0.7);
}

.tap-btn:active,
.tap-btn.active {
    transform: scale(0.95);
    box-shadow: 0 8px 25px rgba(27, 152, 224, 0.4);
}

.tap-btn i {
    font-size: 3rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.tap-btn span {
    position: relative;
    z-index: 1;
}

/* Reset Button */
.reset-btn {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.reset-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
    transform: translateY(-2px);
}

/* Copy Button */
.copy-bpm-btn {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

.copy-bpm-btn:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
    color: #2ecc71;
    transform: translateY(-2px);
}

/* Instruction Text */
.instruction-text {
    text-align: center;
    color: var(--text-muted);
    margin-top: 20px;
    font-size: 0.95rem;
    padding: 15px 25px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    display: inline-block;
}

.instruction-text strong {
    color: var(--primary-blue);
    background: rgba(27, 152, 224, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Stats Grid */
.bpm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 600px;
}

.stat-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
    font-family: 'Fira Code', monospace;
}

/* BPM History */
.bpm-history {
    margin-top: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
}

.bpm-history h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bpm-history h3 i {
    color: var(--primary-blue);
}

.bpm-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: var(--bg-hover);
    transform: translateX(5px);
}

.history-bpm {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-family: 'Fira Code', monospace;
}

.history-taps {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-history {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.clear-history-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.clear-history-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Tempo Guide */
.tempo-guide {
    margin-top: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
}

.tempo-guide h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tempo-guide h3 i {
    color: var(--primary-blue);
}

.tempo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tempo-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.tempo-item:hover {
    border-color: var(--primary-blue);
    transform: translateY(-3px);
}

.tempo-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.tempo-bpm {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Bookmark Section */
.bookmark-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.bookmark-btn:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(27, 152, 224, 0.3);
}

.bookmark-btn i {
    font-size: 1rem;
}

/* ==========================================
   TARGET BPM GAMIFICATION FEATURE
   World-Class Premium UI
   ========================================== */
.target-bpm-section {
    background: linear-gradient(145deg, rgba(27, 152, 224, 0.08) 0%, rgba(155, 89, 182, 0.05) 100%);
    border: 1px solid rgba(27, 152, 224, 0.25);
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.target-bpm-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.target-bpm-wrapper label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.target-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.target-input-row input {
    flex: 1;
    max-width: 150px;
    padding: 12px 18px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
}

.target-input-row input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 20px rgba(27, 152, 224, 0.2);
}

.target-input-row input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.set-target-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(27, 152, 224, 0.3);
}

.set-target-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(27, 152, 224, 0.4);
}

.set-target-btn:active {
    transform: scale(0.95);
}

.target-display-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.target-bpm-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
    padding: 8px 16px;
    background: rgba(27, 152, 224, 0.1);
    border-radius: 50px;
}

.accuracy-display {
    font-size: 1.2rem;
    font-weight: 800;
    padding: 10px 20px;
    background: rgba(46, 204, 113, 0.1);
    border: 2px solid rgba(46, 204, 113, 0.3);
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: 'Fira Code', monospace;
}

.accuracy-display:empty {
    display: none;
}

/* ==========================================
   SOUND TOGGLE BUTTON - Premium Style
   ========================================== */
.btn-sound {
    position: relative;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(27, 152, 224, 0.2)) !important;
    border: 2px solid rgba(155, 89, 182, 0.4) !important;
    color: var(--accent-purple) !important;
    padding: 12px 18px;
    border-radius: 50px;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-sound:hover {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.35), rgba(27, 152, 224, 0.35)) !important;
    border-color: var(--accent-purple) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

.btn-sound i {
    font-size: 1.2rem;
}

/* ==========================================
   PERFORMANCE OPTIMIZATION - GPU / Core Web Vitals
   ========================================== */
/* Will-change for smooth animations */
.gradient-orb,
.music-note,
.floating-icon,
.particle,
.aurora-bg,
.ripple {
    will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .tap-btn::after {
        animation: none !important;
    }
}

/* Disable heavy effects on low-end devices / slow connections */
@media (max-width: 480px) {

    .gradient-orb,
    .music-note,
    .floating-icon,
    .cosmic-stars,
    .aurora-bg {
        display: none !important;
    }

    .tap-btn::after {
        animation: none;
    }
}

/* Green Tick Animation for Copy */
@keyframes tickBounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Mobile responsive for Target BPM */
@media (max-width: 768px) {
    .target-bpm-section {
        padding: 15px 18px;
    }

    .target-input-row {
        flex-wrap: wrap;
    }

    .target-input-row input {
        max-width: none;
        flex: 1 1 100px;
    }

    .target-display-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Similar Tools Grid */
.similar-tools-section {
    margin-top: 50px;
    padding: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.similar-tools-section h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.similar-tools-section h3 i {
    color: var(--primary-blue);
}

.similar-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.similar-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-align: center;
}

.similar-tool-card:hover {
    border-color: var(--primary-blue);
    background: var(--bg-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.similar-tool-card i {
    font-size: 2rem;
    color: var(--primary-blue);
}

.similar-tool-card span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .bpm-value {
        font-size: 5rem;
    }

    .tap-btn {
        width: 180px;
        height: 180px;
        font-size: 1.4rem;
    }

    .tap-btn i {
        font-size: 2.5rem;
    }

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

    .tempo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bookmark-section {
        flex-direction: column;
        align-items: center;
    }

    .bookmark-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bpm-value {
        font-size: 4rem;
    }

    .tap-btn {
        width: 150px;
        height: 150px;
    }

    .bpm-display-container {
        padding: 30px 20px;
    }
}

/* Heartbeat Animation */
@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10% {
        transform: scale(1.08);
    }

    20% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.05);
    }

    40% {
        transform: scale(1);
    }
}

.heart-icon {
    display: inline-block;
    color: #e74c3c;
    animation: heartbeat 1.5s infinite;
}

/* Pulse Animation for active state */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.tap-btn.active::before {
    animation: pulse-ring 0.3s ease-out;
}

/* Dark Theme Specific Fixes */
[data-theme="dark"] .bpm-display-container {
    background: rgba(18, 18, 32, 0.9);
}

[data-theme="dark"] .stat-box,
[data-theme="dark"] .tempo-item,
[data-theme="dark"] .history-item {
    background: rgba(26, 26, 46, 0.8);
}

[data-theme="dark"] .bpm-value {
    color: #ffffff;
}

/* Light Theme Specific Fixes */
[data-theme="light"] .bpm-display-container {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .bpm-value {
    color: #1e293b;
    text-shadow: none;
}

[data-theme="light"] .tap-btn {
    box-shadow: 0 15px 40px rgba(0, 102, 204, 0.4);
}

[data-theme="light"] .stat-box,
[data-theme="light"] .tempo-item,
[data-theme="light"] .history-item {
    background: #f1f5f9;
}

[data-theme="light"] .bpm-history,
[data-theme="light"] .tempo-guide,
[data-theme="light"] .similar-tools-section {
    background: rgba(255, 255, 255, 0.95);
}

/* =========================================
   BPM Counter - PREMIUM ANIMATIONS CSS
   Ultra High Quality | Dark & Light Theme
   Version: 3.0 Premium
   ========================================= */

/* ==========================================
   1. ANIMATED GRADIENT BACKGROUND
   ========================================== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatOrb 20s ease-in-out infinite;
}

.gradient-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(27, 152, 224, 0.4) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.gradient-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(155, 89, 182, 0.4) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.gradient-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(50, 222, 132, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 50px) scale(0.9);
    }

    75% {
        transform: translate(-40px, -20px) scale(1.05);
    }
}

[data-theme="light"] .gradient-orb {
    opacity: 0.3;
}

/* ==========================================
   2. FLOATING MUSICAL NOTES
   ========================================== */
.floating-notes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.music-note {
    position: absolute;
    font-size: 24px;
    color: var(--primary-blue);
    opacity: 0.15;
    animation: floatNote 15s linear infinite;
}

.music-note:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    font-size: 20px;
}

.music-note:nth-child(2) {
    left: 15%;
    animation-delay: -2s;
    font-size: 28px;
}

.music-note:nth-child(3) {
    left: 25%;
    animation-delay: -4s;
    font-size: 18px;
}

.music-note:nth-child(4) {
    left: 35%;
    animation-delay: -6s;
    font-size: 32px;
}

.music-note:nth-child(5) {
    left: 45%;
    animation-delay: -8s;
    font-size: 22px;
}

.music-note:nth-child(6) {
    left: 55%;
    animation-delay: -10s;
    font-size: 26px;
}

.music-note:nth-child(7) {
    left: 65%;
    animation-delay: -12s;
    font-size: 20px;
}

.music-note:nth-child(8) {
    left: 75%;
    animation-delay: -14s;
    font-size: 30px;
}

.music-note:nth-child(9) {
    left: 85%;
    animation-delay: -3s;
    font-size: 24px;
}

.music-note:nth-child(10) {
    left: 95%;
    animation-delay: -7s;
    font-size: 28px;
}

@keyframes floatNote {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

[data-theme="light"] .music-note {
    color: #0066cc;
    opacity: 0.1;
}

/* ==========================================
   3. PREMIUM BPM DISPLAY CONTAINER
   ========================================== */
.bpm-display {
    position: relative;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.2);
    border-radius: 30px;
    padding: 60px 40px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(27, 152, 224, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.bpm-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent,
            rgba(27, 152, 224, 0.1),
            transparent,
            rgba(155, 89, 182, 0.1),
            transparent);
    animation: rotateBorder 10s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bpm-display:hover::before {
    opacity: 1;
}

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

/* Glowing rings around BPM display */
.bpm-display::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 33px;
    background: linear-gradient(135deg,
            rgba(27, 152, 224, 0.3),
            rgba(155, 89, 182, 0.3),
            rgba(50, 222, 132, 0.3));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(8px);
}

.bpm-display:hover::after {
    opacity: 1;
}

/* Beat Flash Animation - Enhanced */
.bpm-display.beat {
    transform: scale(1.03);
    border-color: rgba(27, 152, 224, 0.6);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(27, 152, 224, 0.4),
        0 0 60px rgba(27, 152, 224, 0.3),
        inset 0 0 40px rgba(27, 152, 224, 0.1);
}

[data-theme="light"] .bpm-display {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.15);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(0, 102, 204, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] .bpm-display.beat {
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 0 80px rgba(0, 102, 204, 0.2),
        0 0 40px rgba(0, 102, 204, 0.15);
}

/* ==========================================
   4. PREMIUM BPM VALUE DISPLAY
   ========================================== */
.bpm-value {
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(135deg,
            #ffffff 0%,
            #1b98e0 50%,
            #9b59b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    animation: pulseGlow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(27, 152, 224, 0.3));
}

@keyframes pulseGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 30px rgba(27, 152, 224, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 50px rgba(27, 152, 224, 0.5));
    }
}

/* Number counting animation */
.bpm-value.counting {
    animation: countPulse 0.1s ease-out;
}

@keyframes countPulse {
    0% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* BPM Color States with Gradients */
.bpm-value.slow {
    background: linear-gradient(135deg, #3498db, #2980b9, #1abc9c);
    -webkit-background-clip: text;
    background-clip: text;
}

.bpm-value.moderate {
    background: linear-gradient(135deg, #2ecc71, #27ae60, #1abc9c);
    -webkit-background-clip: text;
    background-clip: text;
}

.bpm-value.fast {
    background: linear-gradient(135deg, #f39c12, #e67e22, #d35400);
    -webkit-background-clip: text;
    background-clip: text;
}

.bpm-value.very-fast {
    background: linear-gradient(135deg, #e74c3c, #c0392b, #e91e63);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .bpm-value {
    background: linear-gradient(135deg,
            #0066cc 0%,
            #5856d6 50%,
            #9b59b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 102, 204, 0.2));
}

/* ==========================================
   5. ULTRA PREMIUM TAP BUTTON
   ========================================== */
.tap-btn {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1b98e0 0%, #9b59b6 50%, #e91e63 100%);
    background-size: 200% 200%;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    user-select: none;
    overflow: visible;
    animation: gradientShift 5s ease-in-out infinite, floatButton 3s ease-in-out infinite;
    box-shadow:
        0 20px 60px rgba(27, 152, 224, 0.5),
        0 10px 30px rgba(155, 89, 182, 0.3),
        inset 0 -5px 20px rgba(0, 0, 0, 0.2),
        inset 0 5px 20px rgba(255, 255, 255, 0.2);
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes floatButton {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Inner glow ring */
.tap-btn::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Outer pulsing ring */
.tap-btn::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    border: 3px solid rgba(27, 152, 224, 0.4);
    pointer-events: none;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Shine effect */
.tap-btn .shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    border-radius: 50%;
    animation: shineEffect 4s ease-in-out infinite;
}

@keyframes shineEffect {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 100%;
    }
}

.tap-btn:hover {
    transform: translateY(-5px) scale(1.05);
    animation: none;
    box-shadow:
        0 30px 80px rgba(27, 152, 224, 0.6),
        0 15px 40px rgba(155, 89, 182, 0.4),
        inset 0 -5px 20px rgba(0, 0, 0, 0.2),
        inset 0 5px 20px rgba(255, 255, 255, 0.3);
}

.tap-btn:active,
.tap-btn.active {
    transform: scale(0.92);
    animation: none;
    box-shadow:
        0 10px 30px rgba(27, 152, 224, 0.4),
        0 5px 15px rgba(155, 89, 182, 0.3),
        inset 0 5px 20px rgba(0, 0, 0, 0.3);
}

.tap-btn i {
    font-size: 3.5rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.tap-btn span {
    position: relative;
    z-index: 1;
    font-weight: 900;
}

/* ==========================================
   6. RIPPLE EFFECT ON TAP
   ========================================== */
.ripple-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
    pointer-events: none;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out forwards;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================
   7. PARTICLE BURST ON TAP
   ========================================== */
.particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.particle.blue {
    background: linear-gradient(135deg, #1b98e0, #00d4ff);
}

.particle.purple {
    background: linear-gradient(135deg, #9b59b6, #e91e63);
}

.particle.green {
    background: linear-gradient(135deg, #32de84, #1abc9c);
}

.particle.gold {
    background: linear-gradient(135deg, #f39c12, #ffd700);
}

/* ==========================================
   8. AUDIO VISUALIZER BARS
   ========================================== */
.audio-visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 60px;
    margin: 25px auto;
    padding: 15px 30px;
    background: rgba(27, 152, 224, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(27, 152, 224, 0.1);
}

.visualizer-bar {
    width: 6px;
    background: linear-gradient(to top, #1b98e0, #9b59b6);
    border-radius: 3px;
    transition: height 0.1s ease;
    animation: barPulse 1s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) {
    animation-delay: 0s;
    height: 30px;
}

.visualizer-bar:nth-child(2) {
    animation-delay: 0.1s;
    height: 45px;
}

.visualizer-bar:nth-child(3) {
    animation-delay: 0.2s;
    height: 35px;
}

.visualizer-bar:nth-child(4) {
    animation-delay: 0.3s;
    height: 50px;
}

.visualizer-bar:nth-child(5) {
    animation-delay: 0.4s;
    height: 40px;
}

.visualizer-bar:nth-child(6) {
    animation-delay: 0.5s;
    height: 55px;
}

.visualizer-bar:nth-child(7) {
    animation-delay: 0.6s;
    height: 45px;
}

.visualizer-bar:nth-child(8) {
    animation-delay: 0.7s;
    height: 35px;
}

.visualizer-bar:nth-child(9) {
    animation-delay: 0.8s;
    height: 50px;
}

.visualizer-bar:nth-child(10) {
    animation-delay: 0.9s;
    height: 40px;
}

.visualizer-bar:nth-child(11) {
    animation-delay: 0.15s;
    height: 30px;
}

.visualizer-bar:nth-child(12) {
    animation-delay: 0.25s;
    height: 55px;
}

@keyframes barPulse {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.8;
    }

    50% {
        transform: scaleY(var(--scale, 1.5));
        opacity: 1;
    }
}

.audio-visualizer.active .visualizer-bar {
    animation: barActive 0.15s ease-out;
}

@keyframes barActive {
    0% {
        transform: scaleY(2);
        background: linear-gradient(to top, #32de84, #1b98e0);
    }

    100% {
        transform: scaleY(1);
    }
}

[data-theme="light"] .audio-visualizer {
    background: rgba(0, 102, 204, 0.05);
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .visualizer-bar {
    background: linear-gradient(to top, #0066cc, #5856d6);
}

/* ==========================================
   9. PREMIUM STAT BOXES
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.stat-box {
    position: relative;
    background: linear-gradient(145deg,
            rgba(26, 26, 46, 0.9),
            rgba(18, 18, 32, 0.95));
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(27, 152, 224, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-box:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(27, 152, 224, 0.4);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(27, 152, 224, 0.15);
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Fira Code', monospace;
    position: relative;
    z-index: 1;
}

[data-theme="light"] .stat-box {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .stat-box:hover {
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(0, 102, 204, 0.1);
}

/* ==========================================
   10. PREMIUM BUTTONS
   ========================================== */
.btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.btn {
    position: relative;
    padding: 14px 28px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg,
            rgba(26, 26, 46, 0.9),
            rgba(18, 18, 32, 0.95));
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.btn-danger:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.2);
}

.btn-success:hover {
    border-color: #2ecc71;
    color: #2ecc71;
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.2);
}

.btn i {
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: scale(1.1);
}

[data-theme="light"] .btn {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 0, 0, 0.08);
}

/* ==========================================
   11. TEMPO GUIDE - 3D CARDS
   ========================================== */
.tempo-guide {
    position: relative;
    margin-top: 35px;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 24px;
    padding: 30px;
    overflow: hidden;
}

.tempo-guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #1b98e0, #9b59b6, #32de84);
    border-radius: 24px 24px 0 0;
}

.tempo-guide h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tempo-guide h3 i {
    color: var(--primary-blue);
    font-size: 1.3rem;
}

.tempo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tempo-item {
    position: relative;
    background: linear-gradient(145deg,
            rgba(30, 30, 50, 0.8),
            rgba(20, 20, 35, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.1);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tempo-item:hover {
    transform: translateY(-8px) rotateX(5deg);
    border-color: rgba(27, 152, 224, 0.5);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(27, 152, 224, 0.15);
}

.tempo-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.tempo-bpm {
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
}

[data-theme="light"] .tempo-guide {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .tempo-item {
    background: linear-gradient(145deg,
            rgba(248, 250, 252, 0.95),
            rgba(241, 245, 249, 0.9));
    border-color: rgba(0, 102, 204, 0.08);
}

/* ==========================================
   12. HISTORY SECTION - ANIMATED LIST
   ========================================== */
.history-section {
    position: relative;
    margin-top: 35px;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 24px;
    padding: 30px;
    overflow: hidden;
}

.history-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #9b59b6, #1b98e0, #32de84);
    border-radius: 24px 24px 0 0;
}

.history-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-section h3 i {
    color: var(--primary-blue);
    font-size: 1.3rem;
}

.history-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(27, 152, 224, 0.3) transparent;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(27, 152, 224, 0.3);
    border-radius: 3px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: linear-gradient(145deg,
            rgba(30, 30, 50, 0.7),
            rgba(20, 20, 35, 0.8));
    border: 1px solid rgba(27, 152, 224, 0.08);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRight 0.5s ease-out backwards;
}

.history-item:nth-child(1) {
    animation-delay: 0s;
}

.history-item:nth-child(2) {
    animation-delay: 0.05s;
}

.history-item:nth-child(3) {
    animation-delay: 0.1s;
}

.history-item:nth-child(4) {
    animation-delay: 0.15s;
}

.history-item:nth-child(5) {
    animation-delay: 0.2s;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item:hover {
    transform: translateX(8px);
    background: linear-gradient(145deg,
            rgba(40, 40, 60, 0.8),
            rgba(30, 30, 45, 0.9));
    border-color: rgba(27, 152, 224, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.history-bpm {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Fira Code', monospace;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-history {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
    font-style: italic;
    opacity: 0.7;
}

[data-theme="light"] .history-section {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .history-item {
    background: linear-gradient(145deg,
            rgba(248, 250, 252, 0.95),
            rgba(241, 245, 249, 0.9));
    border-color: rgba(0, 102, 204, 0.05);
}

/* ==========================================
   13. SIMILAR TOOLS - HOVER CARDS
   ========================================== */
.similar-tools {
    position: relative;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    overflow: hidden;
}

.similar-tools::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #32de84, #1b98e0, #9b59b6);
    border-radius: 24px 24px 0 0;
}

.similar-tools h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.similar-tools h3 i {
    color: var(--primary-blue);
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.similar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px 15px;
    background: linear-gradient(145deg,
            rgba(30, 30, 50, 0.8),
            rgba(20, 20, 35, 0.9));
    border: 1px solid rgba(27, 152, 224, 0.1);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.similar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(27, 152, 224, 0.15) 0%,
            transparent 50%,
            rgba(155, 89, 182, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.similar-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: rgba(27, 152, 224, 0.5);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(27, 152, 224, 0.15);
}

.similar-card:hover::before {
    opacity: 1;
}

.similar-card i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(27, 152, 224, 0.3));
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
}

.similar-card:hover i {
    transform: scale(1.2) rotate(10deg);
}

.similar-card span {
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

[data-theme="light"] .similar-tools {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .similar-card {
    background: linear-gradient(145deg,
            rgba(248, 250, 252, 0.95),
            rgba(241, 245, 249, 0.9));
    border-color: rgba(0, 102, 204, 0.08);
}

/* ==========================================
   14. INSTRUCTION BOX - PREMIUM STYLE
   ========================================== */
.instruction {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    background: linear-gradient(145deg,
            rgba(27, 152, 224, 0.1),
            rgba(155, 89, 182, 0.05));
    border: 1px solid rgba(27, 152, 224, 0.2);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.4s ease;
    animation: pulseInstruction 3s ease-in-out infinite;
}

@keyframes pulseInstruction {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(27, 152, 224, 0);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(27, 152, 224, 0.1);
    }
}

.instruction strong {
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    padding: 4px 12px;
    background-color: rgba(27, 152, 224, 0.1);
    border-radius: 8px;
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .instruction {
    background: linear-gradient(145deg,
            rgba(0, 102, 204, 0.08),
            rgba(88, 86, 214, 0.04));
    border-color: rgba(0, 102, 204, 0.15);
}

/* ==========================================
   15. SIDEBAR - PREMIUM NAVIGATION
   ========================================== */
.sidebar {
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(27, 152, 224, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar h3 i {
    background: linear-gradient(135deg, #1b98e0, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-list {
    list-style: none;
}

.tool-list li {
    margin-bottom: 8px;
}

.tool-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.tool-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #1b98e0, #9b59b6);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.tool-list a:hover,
.tool-list a.active {
    background: linear-gradient(90deg,
            rgba(27, 152, 224, 0.15),
            transparent);
    color: var(--primary-blue);
    border-color: rgba(27, 152, 224, 0.3);
    transform: translateX(5px);
}

.tool-list a:hover::before,
.tool-list a.active::before {
    transform: scaleY(1);
}

.tool-list a i {
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.tool-list a:hover i {
    transform: scale(1.2);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .tool-list a {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.03);
}

/* ==========================================
   16. TOOL CARD - ENHANCED
   ========================================== */
.tool-card {
    position: relative;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 28px;
    padding: 45px;
    margin-bottom: 30px;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
            #1b98e0, #9b59b6, #32de84, #f39c12, #e91e63);
    background-size: 400% 100%;
    animation: gradientMove 8s linear infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 400% 50%;
    }
}

.tool-header {
    text-align: center;
    margin-bottom: 45px;
}

.tool-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg,
            #ffffff 0%,
            #1b98e0 40%,
            #9b59b6 70%,
            #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.tool-title .heart-icon {
    -webkit-text-fill-color: #e74c3c;
    animation: heartbeat 1.5s infinite;
    filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.5));
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-top: 10px;
}

[data-theme="light"] .tool-card {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(241, 245, 249, 0.95));
    border-color: rgba(0, 102, 204, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tool-title {
    background: linear-gradient(135deg,
            #1e293b 0%,
            #0066cc 40%,
            #5856d6 70%,
            #1e293b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
}

/* ==========================================
   17. RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tap-btn {
        width: 180px;
        height: 180px;
        font-size: 1.4rem;
    }

    .bpm-value {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    .bpm-display {
        padding: 40px 25px;
        border-radius: 24px;
    }

    .bpm-value {
        font-size: 5rem;
    }

    .tap-btn {
        width: 160px;
        height: 160px;
        font-size: 1.2rem;
    }

    .tap-btn i {
        font-size: 2.5rem;
    }

    .tool-card {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .tool-title {
        font-size: 2rem;
    }

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .audio-visualizer {
        display: none;
    }
}

@media (max-width: 480px) {
    .bpm-value {
        font-size: 4rem;
    }

    .tap-btn {
        width: 140px;
        height: 140px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-box {
        padding: 15px 10px;
    }

    .tempo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   18. SMOOTH SCROLL 
   ========================================== */
html {
    scroll-behavior: smooth;
}

/* ==========================================
   19. SELECTION STYLES
   ========================================== */
::selection {
    background: rgba(27, 152, 224, 0.3);
    color: #fff;
}

[data-theme="light"] ::selection {
    background: rgba(0, 102, 204, 0.3);
    color: #1e293b;
}

/* ==========================================
   20. LOADING ANIMATION
   ========================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(27, 152, 224, 0.1);
    border-top-color: #1b98e0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   21. CTA BOX PREMIUM
   ========================================== */
.cta-box {
    position: relative;
    background: linear-gradient(135deg, #1b98e0 0%, #9b59b6 50%, #e91e63 100%);
    background-size: 200% 200%;
    animation: gradientShift 5s ease-in-out infinite;
    padding: 50px 40px;
    border-radius: 24px;
    text-align: center;
    margin: 50px 0;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(27, 152, 224, 0.3);
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.2) 0%,
            transparent 50%);
}

.cta-box h3,
.cta-box p {
    color: #fff;
    position: relative;
    z-index: 1;
}

.cta-box h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cta-box p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* =========================================
   ULTRA PREMIUM ANIMATIONS - ADVANCED
   World-Class Visual Effects
   Version: 4.0 Ultra
   ========================================= */

/* ==========================================
   1. NEON GLOW EFFECTS
   ========================================== */
.neon-glow {
    text-shadow:
        0 0 5px var(--primary-blue),
        0 0 10px var(--primary-blue),
        0 0 20px var(--primary-blue),
        0 0 40px var(--primary-blue);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {

    0%,
    100% {
        text-shadow:
            0 0 5px var(--primary-blue),
            0 0 10px var(--primary-blue),
            0 0 20px var(--primary-blue),
            0 0 40px var(--primary-blue);
    }

    50% {
        text-shadow:
            0 0 10px var(--primary-blue),
            0 0 20px var(--primary-blue),
            0 0 40px var(--primary-blue),
            0 0 80px var(--primary-blue);
    }
}

/* Neon Border Effect */
.neon-border {
    position: relative;
}

.neon-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, #1b98e0, #9b59b6, #e91e63, #32de84, #1b98e0);
    background-size: 400% 400%;
    animation: neonBorderGlow 8s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

@keyframes neonBorderGlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ==========================================
   2. 3D TRANSFORMS & HOVER EFFECTS
   ========================================== */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d-inner {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform: rotateX(0) rotateY(0);
}

.card-3d:hover .card-3d-inner {
    transform: rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

/* Tilt on Mouse Move - Applied via JS */
.tilt-effect {
    transition: transform 0.2s ease-out;
}

/* ==========================================
   3. MORPHING BLOB BACKGROUND
   ========================================== */
.morphing-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg,
            rgba(27, 152, 224, 0.3),
            rgba(155, 89, 182, 0.3));
    border-radius: 50%;
    filter: blur(60px);
    animation: morphBlob 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes morphBlob {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }

    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }

    50% {
        border-radius: 50% 60% 30% 60% / 30% 40% 70% 50%;
        transform: rotate(180deg) scale(0.9);
    }

    75% {
        border-radius: 60% 40% 60% 40% / 60% 50% 40% 60%;
        transform: rotate(270deg) scale(1.05);
    }
}

.morphing-blob.blob-1 {
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.morphing-blob.blob-2 {
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
    background: linear-gradient(135deg,
            rgba(155, 89, 182, 0.3),
            rgba(50, 222, 132, 0.3));
}

[data-theme="light"] .morphing-blob {
    opacity: 0.4;
}

/* ==========================================
   4. SOUND WAVE ANIMATION
   ========================================== */
.sound-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 40px;
    padding: 10px 20px;
    background: rgba(27, 152, 224, 0.1);
    border-radius: 30px;
    border: 1px solid rgba(27, 152, 224, 0.2);
}

.sound-wave-bar {
    width: 4px;
    height: 100%;
    background: linear-gradient(to top, #1b98e0, #9b59b6);
    border-radius: 2px;
    animation: soundWave 1.2s ease-in-out infinite;
    transform-origin: bottom;
}

.sound-wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.sound-wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.sound-wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.sound-wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.sound-wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.sound-wave-bar:nth-child(6) {
    animation-delay: 0.3s;
}

.sound-wave-bar:nth-child(7) {
    animation-delay: 0.2s;
}

.sound-wave-bar:nth-child(8) {
    animation-delay: 0.1s;
}

@keyframes soundWave {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

/* ==========================================
   5. TYPEWRITER TEXT EFFECT
   ========================================== */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-blue);
    white-space: nowrap;
    animation:
        typing 3.5s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary-blue);
    }
}

/* ==========================================
   6. LIQUID FILL EFFECT
   ========================================== */
.liquid-fill {
    position: relative;
    overflow: hidden;
}

.liquid-fill::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top,
            rgba(27, 152, 224, 0.3),
            rgba(27, 152, 224, 0.1));
    transition: height 0.5s ease;
}

.liquid-fill:hover::before {
    height: 100%;
}

.liquid-fill::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 200%;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath fill='rgba(27,152,224,0.3)' d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 600px 20px;
    animation: liquidWave 3s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease, bottom 0.5s ease;
}

.liquid-fill:hover::after {
    opacity: 1;
    bottom: calc(100% - 20px);
}

@keyframes liquidWave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-600px);
    }
}

/* ==========================================
   7. SPOTLIGHT EFFECT
   ========================================== */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotlight:hover::before {
    opacity: 1;
}

/* ==========================================
   8. GLITCH TEXT EFFECT
   ========================================== */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #e91e63;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitchAnim 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: 2px 0 #1b98e0;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitchAnim 2s infinite linear alternate-reverse;
    animation-delay: 0.5s;
}

@keyframes glitchAnim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
    }

    5% {
        clip: rect(12px, 9999px, 59px, 0);
    }

    10% {
        clip: rect(48px, 9999px, 29px, 0);
    }

    15% {
        clip: rect(42px, 9999px, 73px, 0);
    }

    20% {
        clip: rect(63px, 9999px, 27px, 0);
    }

    25% {
        clip: rect(34px, 9999px, 55px, 0);
    }

    30% {
        clip: rect(86px, 9999px, 73px, 0);
    }

    35% {
        clip: rect(20px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(26px, 9999px, 60px, 0);
    }

    45% {
        clip: rect(25px, 9999px, 66px, 0);
    }

    50% {
        clip: rect(57px, 9999px, 98px, 0);
    }

    55% {
        clip: rect(5px, 9999px, 46px, 0);
    }

    60% {
        clip: rect(82px, 9999px, 31px, 0);
    }

    65% {
        clip: rect(54px, 9999px, 27px, 0);
    }

    70% {
        clip: rect(28px, 9999px, 99px, 0);
    }

    75% {
        clip: rect(45px, 9999px, 69px, 0);
    }

    80% {
        clip: rect(23px, 9999px, 85px, 0);
    }

    85% {
        clip: rect(54px, 9999px, 84px, 0);
    }

    90% {
        clip: rect(45px, 9999px, 47px, 0);
    }

    95% {
        clip: rect(37px, 9999px, 20px, 0);
    }

    100% {
        clip: rect(4px, 9999px, 91px, 0);
    }
}

/* ==========================================
   9. PARALLAX LAYERS
   ========================================== */
.parallax-container {
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.parallax-layer.layer-1 {
    transform: translateZ(-200px) scale(1.2);
}

.parallax-layer.layer-2 {
    transform: translateZ(-100px) scale(1.1);
}

.parallax-layer.layer-3 {
    transform: translateZ(0);
}

/* ==========================================
   10. CIRCULAR PROGRESS RING
   ========================================== */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: rgba(27, 152, 224, 0.2);
    stroke-width: 8;
}

.progress-ring-progress {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease-in-out;
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================
   11. SHIMMER LOADING EFFECT
   ========================================== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: shimmerEffect 2s infinite;
}

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

    100% {
        left: 100%;
    }
}

/* ==========================================
   12. FLIP CARD EFFECT
   ========================================== */
.flip-card {
    perspective: 1000px;
    width: 100%;
    height: 200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.flip-card-front {
    background: var(--gradient-primary);
    color: #fff;
}

.flip-card-back {
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.95),
            rgba(26, 26, 46, 0.9));
    transform: rotateY(180deg);
    border: 1px solid rgba(27, 152, 224, 0.3);
}

/* ==========================================
   13. ELASTIC BOUNCE ANIMATION
   ========================================== */
.elastic-bounce {
    animation: elasticBounce 1s ease-out;
}

@keyframes elasticBounce {
    0% {
        transform: scale(0);
    }

    30% {
        transform: scale(1.25);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    85% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* ==========================================
   14. CONFETTI BURST
   ========================================== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

.confetti-piece:nth-child(odd) {
    animation-name: confettiFallRotate;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes confettiFallRotate {
    0% {
        transform: translateY(-100px) rotateX(0deg) rotateY(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotateX(360deg) rotateY(720deg);
        opacity: 0;
    }
}

/* ==========================================
   15. PULSING RINGS
   ========================================== */
.pulse-rings {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pulse-rings::before,
.pulse-rings::after {
    content: '';
    position: absolute;
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: pulseRingExpand 2s ease-out infinite;
}

.pulse-rings::before {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
}

.pulse-rings::after {
    width: 100%;
    height: 100%;
    animation-delay: 1s;
}

@keyframes pulseRingExpand {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==========================================
   16. GRADIENT TEXT ANIMATION
   ========================================== */
.animated-gradient-text {
    background: linear-gradient(90deg,
            #1b98e0, #9b59b6, #e91e63, #f39c12, #32de84, #1b98e0);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientTextMove 5s linear infinite;
}

@keyframes gradientTextMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

/* ==========================================
   17. MAGNETIC HOVER EFFECT
   ========================================== */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
}

/* ==========================================
   18. AURORA BACKGROUND
   ========================================== */
.aurora-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.aurora-bg::before,
.aurora-bg::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    animation: auroraMove 15s ease-in-out infinite;
}

.aurora-bg::before {
    background: radial-gradient(ellipse at 50% 50%,
            rgba(27, 152, 224, 0.2) 0%,
            transparent 50%);
    top: -50%;
    left: -25%;
    animation-delay: 0s;
}

.aurora-bg::after {
    background: radial-gradient(ellipse at 50% 50%,
            rgba(155, 89, 182, 0.2) 0%,
            transparent 50%);
    bottom: -50%;
    right: -25%;
    animation-delay: -7.5s;
}

@keyframes auroraMove {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(10%, 10%) rotate(5deg);
    }

    50% {
        transform: translate(-5%, 5%) rotate(-5deg);
    }

    75% {
        transform: translate(5%, -10%) rotate(3deg);
    }
}

[data-theme="light"] .aurora-bg::before,
[data-theme="light"] .aurora-bg::after {
    opacity: 0.5;
}

/* ==========================================
   19. BREATHING GLOW
   ========================================== */
.breathing-glow {
    animation: breathingGlow 4s ease-in-out infinite;
}

@keyframes breathingGlow {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(27, 152, 224, 0.3),
            0 0 40px rgba(27, 152, 224, 0.2);
    }

    50% {
        box-shadow:
            0 0 40px rgba(27, 152, 224, 0.5),
            0 0 80px rgba(27, 152, 224, 0.3),
            0 0 120px rgba(27, 152, 224, 0.1);
    }
}

/* ==========================================
   20. FLOATING ICONS DECORATION
   ========================================== */
.floating-icons {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary-blue);
    opacity: 0.08;
    animation: floatIcon 20s linear infinite;
}

@keyframes floatIcon {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.08;
    }

    90% {
        opacity: 0.08;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.floating-icon:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    left: 15%;
    animation-delay: -3s;
}

.floating-icon:nth-child(3) {
    left: 25%;
    animation-delay: -6s;
}

.floating-icon:nth-child(4) {
    left: 35%;
    animation-delay: -9s;
}

.floating-icon:nth-child(5) {
    left: 45%;
    animation-delay: -12s;
}

.floating-icon:nth-child(6) {
    left: 55%;
    animation-delay: -15s;
}

.floating-icon:nth-child(7) {
    left: 65%;
    animation-delay: -18s;
}

.floating-icon:nth-child(8) {
    left: 75%;
    animation-delay: -2s;
}

.floating-icon:nth-child(9) {
    left: 85%;
    animation-delay: -5s;
}

.floating-icon:nth-child(10) {
    left: 95%;
    animation-delay: -8s;
}

[data-theme="light"] .floating-icon {
    color: #0066cc;
    opacity: 0.06;
}

/* ==========================================
   21. TEXT REVEAL ANIMATION
   ========================================== */
.text-reveal {
    display: inline-block;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* Staggered delay for each letter */
.text-reveal span:nth-child(1) {
    animation-delay: 0.05s;
}

.text-reveal span:nth-child(2) {
    animation-delay: 0.1s;
}

.text-reveal span:nth-child(3) {
    animation-delay: 0.15s;
}

.text-reveal span:nth-child(4) {
    animation-delay: 0.2s;
}

.text-reveal span:nth-child(5) {
    animation-delay: 0.25s;
}

.text-reveal span:nth-child(6) {
    animation-delay: 0.3s;
}

.text-reveal span:nth-child(7) {
    animation-delay: 0.35s;
}

.text-reveal span:nth-child(8) {
    animation-delay: 0.4s;
}

.text-reveal span:nth-child(9) {
    animation-delay: 0.45s;
}

.text-reveal span:nth-child(10) {
    animation-delay: 0.5s;
}

/* ==========================================
   22. SCROLL-TRIGGERED ANIMATIONS
   ========================================== */
.scroll-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================
   23. COSMIC STARS BACKGROUND
   ========================================== */
.cosmic-stars {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

[data-theme="light"] .cosmic-stars {
    display: none;
}

/* ==========================================
   24. PERFORMANCE OPTIMIZATIONS
   ========================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* =========================================
   ADSENSE AD SLOTS - PREMIUM STYLING
   Mobile & Desktop Optimized
   Version: 1.0
   ========================================= */

/* ==========================================
   1. AD CONTAINER BASE STYLES
   ========================================== */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.6),
            rgba(26, 26, 46, 0.5));
    border: 1px solid rgba(27, 152, 224, 0.1);
    transition: all 0.4s ease;
}

.ad-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(27, 152, 224, 0.05) 0%,
            transparent 50%,
            rgba(155, 89, 182, 0.05) 100%);
    pointer-events: none;
}

/* Ad Label */
.ad-container::after {
    content: 'Advertisement';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

[data-theme="light"] .ad-container {
    background: linear-gradient(145deg,
            rgba(248, 250, 252, 0.9),
            rgba(241, 245, 249, 0.8));
    border-color: rgba(0, 102, 204, 0.08);
}

/* ==========================================
   2. AD SLOT VARIATIONS
   ========================================== */

/* Header Ad - Below Header (Leaderboard) */
.ad-slot-header {
    min-height: 90px;
    max-height: 100px;
    margin: 15px auto;
    max-width: 728px;
    padding: 10px;
}

/* In-Content Ad - Between Content Sections */
.ad-slot-content {
    min-height: 250px;
    max-height: 280px;
    margin: 30px auto;
    max-width: 336px;
    padding: 15px;
}

/* Sidebar Ad - Sticky in Sidebar */
.ad-slot-sidebar {
    min-height: 250px;
    max-height: 280px;
    margin: 20px 0;
    width: 100%;
    padding: 12px;
}

/* Footer Ad - Before Footer */
.ad-slot-footer {
    min-height: 90px;
    max-height: 100px;
    margin: 30px auto 20px;
    max-width: 728px;
    padding: 10px;
}

/* Mobile-Only Ad - Shows only on mobile */
.ad-slot-mobile {
    display: none;
    min-height: 100px;
    max-height: 120px;
    margin: 20px auto;
    width: calc(100% - 20px);
    padding: 10px;
}

/* Desktop-Only Ad - Shows only on desktop */
.ad-slot-desktop {
    min-height: 90px;
    max-height: 250px;
    margin: 20px auto;
    max-width: 728px;
    padding: 10px;
}

/* ==========================================
   3. AD PLACEHOLDER CONTENT
   ========================================== */
.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.4;
    gap: 10px;
    min-height: inherit;
    position: relative;
    z-index: 1;
}

.ad-placeholder i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ad-placeholder span {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Animated border for placeholder */
.ad-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(27, 152, 224, 0.2);
    border-radius: 12px;
    animation: dashRotate 20s linear infinite;
}

@keyframes dashRotate {
    0% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: 1000;
    }
}

/* ==========================================
   4. RESPONSIVE AD ADJUSTMENTS
   ========================================== */
@media (max-width: 992px) {

    .ad-slot-header,
    .ad-slot-footer {
        max-width: 468px;
        min-height: 60px;
        max-height: 70px;
    }

    .ad-slot-desktop {
        max-width: 468px;
    }

    .ad-slot-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {

    .ad-slot-header,
    .ad-slot-footer,
    .ad-slot-desktop {
        max-width: 320px;
        min-height: 50px;
        max-height: 60px;
    }

    .ad-slot-mobile {
        display: flex;
        max-width: calc(100% - 30px);
    }

    .ad-slot-content {
        max-width: 300px;
        min-height: 200px;
    }

    .ad-container::after {
        font-size: 0.55rem;
        top: 5px;
        right: 8px;
    }
}

@media (max-width: 480px) {

    .ad-slot-header,
    .ad-slot-footer,
    .ad-slot-desktop {
        min-height: 50px;
        max-height: 50px;
        border-radius: 12px;
    }

    .ad-slot-content {
        max-width: 100%;
        margin: 20px 0;
    }

    .ad-slot-mobile {
        min-height: 80px;
        max-height: 100px;
    }
}

/* ==========================================
   5. ANCHOR AD STYLES (Bottom Sticky)
   ========================================== */
.ad-anchor-bottom {
    position: fixed;
    bottom: 70px;
    /* Above mobile nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    width: calc(100% - 20px);
    max-width: 728px;
    min-height: 50px;
    max-height: 100px;
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.98),
            rgba(26, 26, 46, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(27, 152, 224, 0.2);
    border-radius: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    /* Will be shown via JS */
    padding: 10px;
}

.ad-anchor-bottom.visible {
    display: flex;
}

.ad-anchor-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.ad-anchor-close:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    transform: scale(1.1);
}

[data-theme="light"] .ad-anchor-bottom {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98),
            rgba(248, 250, 252, 0.95));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .ad-anchor-bottom {
        bottom: 80px;
        /* Account for mobile nav */
        max-width: calc(100% - 20px);
        border-radius: 12px;
    }
}

/* ==========================================
   6. INTERSTITIAL AD OVERLAY (Optional)
   ========================================== */
.ad-interstitial {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ad-interstitial.visible {
    display: flex;
    opacity: 1;
}

.ad-interstitial-content {
    position: relative;
    max-width: 600px;
    width: 90%;
    padding: 20px;
}

.ad-interstitial-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ad-interstitial-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.ad-interstitial-timer {
    color: var(--primary-blue);
    font-weight: 700;
}

/* ==========================================
   7. AD LOADING SKELETON
   ========================================== */
.ad-loading {
    background: linear-gradient(90deg,
            rgba(27, 152, 224, 0.05) 25%,
            rgba(27, 152, 224, 0.1) 50%,
            rgba(27, 152, 224, 0.05) 75%);
    background-size: 200% 100%;
    animation: adLoading 1.5s infinite;
}

@keyframes adLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   8. NATIVE AD STYLE
   ========================================== */
.ad-native {
    background: linear-gradient(145deg,
            rgba(18, 18, 32, 0.8),
            rgba(26, 26, 46, 0.7));
    border: 1px solid rgba(27, 152, 224, 0.15);
    border-radius: 16px;
    padding: 20px;
    margin: 25px 0;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.4s ease;
}

.ad-native:hover {
    border-color: rgba(27, 152, 224, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.ad-native-image {
    width: 120px;
    height: 80px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    overflow: hidden;
}

.ad-native-content {
    flex: 1;
}

.ad-native-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.ad-native-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.ad-native-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

[data-theme="light"] .ad-native {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.95),
            rgba(248, 250, 252, 0.9));
    border-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 480px) {
    .ad-native {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .ad-native-image {
        width: 100%;
        height: 120px;
    }
}

/* ==========================================
   9. VIDEO AD CONTAINER
   ========================================== */
.ad-video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    margin: 30px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(27, 152, 224, 0.2);
}

.ad-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    color: #fff;
}

.ad-video-play {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(27, 152, 224, 0.4);
}

.ad-video-play:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(27, 152, 224, 0.6);
}

.ad-video-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

/* ==========================================
   10. PRINT STYLES - HIDE ADS
   ========================================== */
@media print {

    .ad-container,
    .ad-slot-header,
    .ad-slot-content,
    .ad-slot-sidebar,
    .ad-slot-footer,
    .ad-slot-mobile,
    .ad-slot-desktop,
    .ad-anchor-bottom,
    .ad-interstitial,
    .ad-native,
    .ad-video-container {
        display: none !important;
    }
}

/* ==========================================
   11. COPY ANIMATION - GREEN TICK BOUNCE
   ========================================== */
@keyframes tickBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Share Button Styling */
.btn-share {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-share:hover {
    background: linear-gradient(135deg, #128C7E, #25D366) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3) !important;
}

.btn-share i {
    font-size: 1.2rem;
}

/* ==========================================
   12. STRATEGIC AD PLACEMENT - 2 ADS ONLY
   ========================================== */

/* AD 1: Below Tool */
.ad-below-tool {
    max-width: 728px;
    margin: 40px auto;
    padding: 20px;
    background: linear-gradient(145deg,
            rgba(20, 25, 45, 0.8),
            rgba(15, 20, 35, 0.9));
    border-radius: 16px;
    border: 1px solid rgba(27, 152, 224, 0.15);
    text-align: center;
}

.ad-below-tool .ad-placeholder-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* AD 2: Footer Section */
.ad-footer-section {
    max-width: 728px;
    margin: 30px auto 50px;
    padding: 20px;
    background: linear-gradient(145deg,
            rgba(20, 25, 45, 0.8),
            rgba(15, 20, 35, 0.9));
    border-radius: 16px;
    border: 1px solid rgba(27, 152, 224, 0.15);
    text-align: center;
}

.ad-footer-section .ad-placeholder-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 25px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* Light Theme Ads */
[data-theme="light"] .ad-below-tool,
[data-theme="light"] .ad-footer-section {
    background: linear-gradient(145deg,
            rgba(248, 250, 252, 0.95),
            rgba(255, 255, 255, 0.98));
    border-color: rgba(0, 102, 204, 0.1);
}

[data-theme="light"] .ad-placeholder-minimal {
    color: rgba(0, 0, 0, 0.25);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Hide Footer Ad on Mobile for Speed */
@media (max-width: 768px) {
    .ad-footer-section {
        display: none;
    }

    .ad-below-tool {
        margin: 25px 15px;
        padding: 15px;
    }
}

/* Fix alignment issues: Center tool header descriptions and upload area texts */
.tool-header p,
.upload-area p,
.upload-content p {
    text-align: center !important;
}


/* Chatbot: Hide toggle from header on mobile — moved inside hamburger menu */
@media (max-width: 768px) {
    #chatbot-toggle {
        display: none !important;
    }
    .header-right {
        margin-right: 0 !important;
    }
    #chatbot-container {
        position: fixed !important;
        top: 75px !important;
        bottom: auto !important;
        right: 15px !important;
        left: 15px !important;
        width: auto !important;
        max-width: none !important;
        height: 60vh !important;
        max-height: 400px !important;
        z-index: 10000 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    }
}

@media (max-width: 480px) {
    #chatbot-container {
        top: 68px !important;
        right: 10px !important;
        left: 10px !important;
        height: 55vh !important;
    }
}
