/* =============================================
   NEXTHIT MOBILE-FIRST PROFESSIONAL OPTIMIZATIONS
   ============================================= */

/* 0. LOGO OPTIMIZATION - NO VISIBLE SQUARE */
.logo img {
    background: transparent !important;
    mix-blend-mode: screen; /* Removes white background */
    border-radius: 50%; /* Makes it circular if needed */
    padding: 5px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1) 0%, transparent 100%) !important;
    box-shadow: none !important;
}

/* Alternative: If logo should stay rectangular but blend in */
.nexthit-header .logo img {
    background: transparent !important;
    mix-blend-mode: lighten; /* Blends white into background */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Alternative 2: Pure transparent approach */
@supports (mix-blend-mode: multiply) {
    .logo img {
        mix-blend-mode: multiply; /* Best for dark backgrounds */
        filter: brightness(1.2) contrast(1.1);
    }
}

/* 1. BASE MOBILE-FIRST STYLES */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(230, 57, 70, 0.2);
}

body {
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. HERO SECTION MOBILE OPTIMIZATION */
.hero {
    min-height: 100vh;
    padding: 80px 20px 40px;
    background-attachment: scroll !important; /* Mobile Performance */
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 60px 15px 30px;
    }

    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }

    .hero .subtitle {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        padding: 0 10px;
    }

    .cta-buttons {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 0 20px;
    }

    .cta-buttons a,
    .cta-buttons button {
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto;
        min-height: 48px; /* WCAG Touch Target */
        font-size: 1rem !important;
        padding: 14px 20px !important;
    }
}

/* 3. SPOTIFY SECTION MOBILE OPTIMIZATION */
.spotify-container {
    max-width: 100% !important;
    margin: 20px auto !important;
    padding: 20px !important;
    border-radius: 16px !important;
}

@media (max-width: 768px) {
    .spotify-container {
        padding: 15px !important;
        margin: 15px 10px !important;
    }

    .spotify-header {
        flex-direction: row !important; /* Keep horizontal on mobile */
        align-items: center !important;
        gap: 12px !important;
    }

    .spotify-header svg {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0;
    }

    .spotify-header h3 {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    .spotify-header p {
        font-size: 0.85rem !important;
        margin: 3px 0 0 0 !important;
    }

    .spotify-cta {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .spotify-cta a {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px;
        font-size: 0.95rem !important;
    }
}

/* 4. RANKING LIST MOBILE OPTIMIZATION */
.ranking-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .ranking-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 20px;
    }
}

@media (min-width: 1200px) {
    .ranking-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

.track-item {
    background: rgba(20, 20, 20, 0.8) !important;
    border: 2px solid rgba(230, 57, 70, 0.3) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
}

@media (max-width: 768px) {
    .track-item {
        padding: 15px !important;
        border-radius: 12px !important;
    }

    .track-item h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }

    .track-item .artist {
        font-size: 0.9rem !important;
    }

    .track-item .stats {
        font-size: 0.85rem !important;
        gap: 10px !important;
    }
}

.track-item:hover {
    transform: translateY(-5px) !important;
    border-color: #E63946 !important;
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4) !important;
}

/* 5. SECTION TITLE MOBILE OPTIMIZATION */
.section-title {
    font-size: 2rem !important;
    text-align: center;
    margin-bottom: 30px !important;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: 20px !important;
        padding: 0 15px;
    }

    .section-title .subtitle {
        font-size: 0.95rem !important;
        padding: 0 10px;
        display: block;
        margin-top: 10px;
    }
}

/* 6. SEO CONTENT MOBILE OPTIMIZATION */
.seo-content {
    padding: 60px 0 !important;
}

@media (max-width: 768px) {
    .seo-content {
        padding: 40px 0 !important;
    }

    .seo-content h2 {
        font-size: 1.8rem !important;
        padding: 0 15px !important;
        margin-bottom: 30px !important;
    }

    .seo-content h3 {
        font-size: 1.4rem !important;
        margin-bottom: 15px !important;
    }

    .seo-content > div > div {
        padding: 25px 20px !important;
        margin-bottom: 25px !important;
        border-radius: 12px !important;
    }

    .seo-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }
}

/* 7. FOOTER MOBILE OPTIMIZATION */
.nexthit-footer {
    padding: 40px 20px !important;
}

@media (max-width: 768px) {
    .nexthit-footer {
        padding: 30px 15px !important;
    }

    .footer-content {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .footer-links {
        text-align: center !important;
    }

    .footer-links h4 {
        font-size: 1.2rem !important;
        margin-bottom: 15px !important;
    }

    .footer-links a {
        display: block !important;
        padding: 10px 0 !important;
        font-size: 0.95rem !important;
    }
}

/* 8. TOUCH TARGET OPTIMIZATION (WCAG AA) */
@media (max-width: 768px) {
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }

    .play-button,
    .like-button,
    .download-button {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 12px !important;
    }
}

/* 9. IMAGE OPTIMIZATION */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .track-item img {
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    }
}

/* 10. LOADING STATES & PERFORMANCE */
.ranking-list:empty::before {
    content: 'Lade Songs...';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 11. SCROLL PERFORMANCE */
.hero,
.spotify-container,
.track-item {
    will-change: transform;
}

@media (max-width: 768px) {
    .hero,
    .spotify-container,
    .track-item {
        will-change: auto; /* Better mobile performance */
    }
}

/* 12. DARK MODE OPTIMIZATION */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000000;
        color: #FFFFFF;
    }
}

/* 13. RESPONSIVE TYPOGRAPHY SCALE */
:root {
    --font-scale: 1;
}

@media (max-width: 768px) {
    :root {
        --font-scale: 0.9;
    }
}

@media (max-width: 480px) {
    :root {
        --font-scale: 0.85;
    }
}

/* 14. CONTAINER MAX-WIDTH CONTROL */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

/* 15. SAFE AREA FOR NOTCHED DEVICES */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .hero {
        padding-top: max(80px, env(safe-area-inset-top));
    }

    .nexthit-footer {
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}
