/* Enhanced Index/Homepage Styles with Music Controls */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary-color: #06b6d4;
    --secondary-dark: #0891b2;
    --tertiary-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #0f172a;
    --background-light: #1e293b;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-lighter: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.6);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--background), #1e1b4b);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

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

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, var(--background) 0%, #1e1b4b 50%, var(--background) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* Floating Orbs */
.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.4));
    filter: blur(2px);
    animation: float 20s infinite ease-in-out;
}

.orb:nth-child(1) {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.orb:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: -10s;
}

.orb:nth-child(4) {
    width: 120px;
    height: 120px;
    top: 20%;
    right: 30%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-30px) translateX(20px) rotate(90deg); }
    50% { transform: translateY(-60px) translateX(-20px) rotate(180deg); }
    75% { transform: translateY(-30px) translateX(-40px) rotate(270deg); }
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 25s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% { opacity: 0.6; transform: scale(1); }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-100vh) translateX(200px) rotate(360deg) scale(0);
        opacity: 0;
    }
}

/* Header Section */
.header-section {
    text-align: center;
    padding: 3rem 1rem 2rem;
    position: relative;
}

.logo-container {
    position: relative;
    margin-bottom: 2rem;
    display: inline-block;
}

.logo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    animation: logoFloat 4s ease-in-out infinite alternate;
}

.logo:hover {
    transform: scale(1.1) rotateY(15deg);
    box-shadow: 0 30px 60px -15px rgba(99, 102, 241, 0.4);
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255,255,255,0.3), transparent);
    animation: spin 6s linear infinite;
}

.logo::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent);
}

.logo img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    object-fit: cover;
}

@keyframes logoFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(5deg); }
}

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

/* Main Title */
.main-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--tertiary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: titleGlow 3s ease-in-out infinite alternate;
    letter-spacing: -2px;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    line-height: 1.7;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    position: relative;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
    padding: 0 1rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-10px); }
    70% { transform: translateY(-5px); }
    90% { transform: translateY(-3px); }
}

/* Category Section */
.category-section {
    margin: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius-lg);
    padding: 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--tertiary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-header {
    padding: 2rem 2rem 1rem;
    position: relative;
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.category-body {
    padding: 0 2rem 2rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface-light);
    border-top: 1px solid var(--surface-lighter);
}

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

.category-stat-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: block;
}

.category-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.category-difficulty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.difficulty-dots {
    display: flex;
    gap: 0.25rem;
}

.difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-lighter);
}

.difficulty-dot.active {
    background: var(--tertiary-color);
}

.difficulty-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Play Button */
.play-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem auto 0;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.play-button:hover::before {
    width: 300px;
    height: 300px;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
}

.play-button:active {
    transform: translateY(-1px);
}

.play-icon {
    font-size: 1.2rem;
}

/* Admin Section */
.admin-section {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.admin-button {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.admin-button:hover {
    background: var(--surface-light);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* MUSIC CONTROLS - Enhanced Integration */
.music-controls {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    animation: slideUp 0.8s ease-out;
}

.music-controls:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.music-toggle {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

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

.music-toggle:hover::before {
    left: 100%;
}

.music-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.music-toggle.muted {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.music-toggle.muted:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.music-icon {
    font-size: 1rem;
    transition: var(--transition);
}

.music-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.music-toggle:hover .music-icon {
    transform: scale(1.1) rotate(5deg);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
}

.music-controls:hover .volume-icon {
    color: var(--primary-color);
}

.volume-slider {
    width: 80px;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
    position: relative;
}

.volume-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    width: var(--volume-width, 30%);
    transition: var(--transition);
}

.volume-slider:hover {
    height: 8px;
    margin: -1px 0;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    border: 2px solid white;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.music-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.music-controls.playing .music-visualizer {
    opacity: 1;
}

.visualizer-bar {
    width: 2px;
    height: 8px;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 1px;
    animation: visualize 1.5s ease-in-out infinite;
}

.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes visualize {
    0%, 100% { height: 4px; opacity: 0.4; }
    50% { height: 12px; opacity: 1; }
}

.music-controls.playing .music-icon {
    animation: musicPulse 2s ease-in-out infinite;
}

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

.music-controls.volume-changing {
    transform: scale(1.02);
}

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

/* Features Section */
.features-section {
    margin: 6rem 0 4rem;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.05));
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--surface-light);
    position: relative;
    overflow: hidden;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Coming Soon Card */
.category-card.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.category-card.coming-soon:hover {
    transform: translateY(-5px) scale(1.01);
}

.category-card.coming-soon .play-button:disabled {
    background: var(--surface-lighter);
    color: var(--text-muted);
    cursor: not-allowed;
}

.category-card.coming-soon .play-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--surface-light);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-section {
        padding: 2rem 1rem;
    }

    .logo {
        width: 120px;
        height: 120px;
    }

    .logo img {
        width: 80px;
        height: 80px;
    }

    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .category-grid {
        grid-template-columns