/* =========================================
   ROOT VARIABLES
   ========================================= */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --accent-gold: #d4a853;
    --accent-bronze: #8b6f47;
    --text-primary: #f5f5f5;
    --text-secondary: #888;
    --Memphis-orange: #ff6b35;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: default;
}

/* =========================================
   GRAIN TEXTURE OVERLAY
   ========================================= */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* =========================================
   NAVIGATION
   ========================================= */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--accent-gold);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.logo::after {
    content: 'TM';
    position: absolute;
    font-size: 0.4em;
    top: 0;
    right: -1.5em;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-gold);
}

.nav-links a:hover::after {
    width: 100%;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, rgba(10, 10, 15, 0.6) 0%, rgba(10, 10, 15, 0.15) 100%),
                      url('assets/jt-hero.jpg');
    background-size: cover;
    background-position: center 20%;
    z-index: -1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-subtitle {
    font-size: 1rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.5s;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-title span {
    display: block;
    transform: translateY(100%);
    animation: slideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title span:nth-child(2) {
    animation-delay: 0.2s;
    color: transparent;
    -webkit-text-stroke: 2px var(--text-primary);
}

.hero-year {
    position: absolute;
    bottom: 10%;
    right: 10%;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    transform: rotate(90deg);
    transform-origin: right center;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 2s;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-gold), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* =========================================
   DISCOGRAPHY SECTION
   ========================================= */
.discography {
    padding: 5rem 4rem 10rem;
    position: relative;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '01';
    position: absolute;
    top: -2rem;
    left: -1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    color: var(--accent-gold);
    opacity: 0.5;
}

.discography-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
    position: relative;
    z-index: 1;
}

/* =========================================
   ALBUM GRID & CARDS
   ========================================= */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.album-card {
    position: relative;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s ease;
}

.album-card:hover {
    z-index: 5;
    transform: translateY(-10px) scale(1.02);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.album-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.album-card:hover .album-cover {
    transform: scale(0.95);
}

.album-card:hover .album-cover::before {
    opacity: 1;
}

.vinyl-record {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 90%;
    height: 90%;
    background: repeating-radial-gradient(#111 0, #111 2px, #222 3px, #222 4px);
    border-radius: 50%;
    transform: translateY(-50%) translateX(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.vinyl-record::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    background: var(--accent-gold);
    border-radius: 50%;
    border: 8px solid #111;
}

.album-card:hover .vinyl-record {
    transform: translateY(-50%) translateX(30%);
}

.album-info {
    margin-top: 1.5rem;
    position: relative;
    z-index: 3;
}

.album-year {
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.album-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.album-card:hover .album-name {
    color: var(--accent-gold);
}

.album-tracks {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.album-card:hover .album-tracks {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   CSPC DASHBOARD (RIGHT PANEL)
   ========================================= */
.cspc-dashboard {
    position: sticky;
    top: 90px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 8px;
    align-self: start;
}

.cspc-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.cspc-title {
    font-size: 2rem;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

.cspc-header a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ff3333;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.stat-group {
    margin-bottom: 2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

.stat-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.3rem;
}

/* =========================================
   ERA BUTTON
   ========================================= */
.era-btn {
    display: inline-block;
    padding: 12px 20px;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
}

.era-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* =========================================
   TIMELINE SECTION
   ========================================= */
.timeline {
    padding: 10rem 4rem;
    background: var(--bg-secondary);
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--accent-gold), transparent);
    opacity: 0.3;
}

.timeline-title::before {
    content: '02';
}

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    position: relative;
}

.timeline-item {
    padding: 3rem;
    border: 1px solid rgba(212, 168, 83, 0.1);
    border-radius: 8px;
    position: relative;
    transition: all 0.4s ease;
    background: rgba(10, 10, 10, 0.5);
}

.timeline-item:hover {
    border-color: var(--accent-gold);
    transform: translateX(10px);
    box-shadow: 0 10px 40px rgba(212, 168, 83, 0.1);
}

.timeline-item:nth-child(even) {
    margin-top: 6rem;
}

.timeline-item:nth-child(even):hover {
    transform: translateX(-10px);
}

.timeline-date {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.timeline-event {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-desc {
    color: var(--text-secondary);
    line-height: 1.6;
}


/* =========================================
   ANALYTICS ROW (TABLE WRAPPER)
   ========================================= */
.analytics-row {
    margin-top: 50px;
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes scrollPulse {
    0%, 100% {
        transform: scaleY(1);
        opacity: 1;
    }
    50% {
        transform: scaleY(0.5);
        opacity: 0.5;
    }
}

@keyframes progress {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 51, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0); }
}

/* =========================================
   CUSTOM SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-bronze);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* =========================================
   TABLET (max-width: 1024px)
   ========================================= */
@media (max-width: 1024px) {
    .discography-layout {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   MOBILE (max-width: 768px)
   ========================================= */
@media screen and (max-width: 768px) {

    /* Base */
    html, body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }

    body {
        padding-top: 90px;
    }

    section {
        padding: 30px 15px;
        box-sizing: border-box;
    }

    /* Navigation */
    nav {
        padding: 10px;
        flex-direction: column;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .logo {
        margin-bottom: 8px;
        font-size: 1.2rem;
    }

    .nav-links {
        display: flex !important;
        flex-direction: row;
        gap: 15px;
        align-items: center;
        padding: 5px 2px 10px 2px;
        margin: 0;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        justify-content: flex-start;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links li a {
        font-size: 0.8rem;
        padding: 5px;
        color: var(--text-secondary) !important;
        font-weight: 400 !important;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .nav-links li a:hover {
        color: var(--text-secondary) !important;
    }

    /* Hero */
    .hero-title {
        font-size: 13vw;
        text-align: center;
        line-height: 1.1;
    }

    .hero-title span {
        display: block;
    }

    /* Discography Layout */
    .discography, .timeline {
        padding: 30px 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .discography-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 0 !important;
    }

    .album-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .cspc-dashboard {
        position: static !important;
        padding: 15px !important;
        margin: 0 !important;
    }

    .stat-group {
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 15px;
    }

    /* Timeline */
    .timeline-grid {
        grid-template-columns: 1fr;
    }

    .timeline-item:nth-child(even) {
        margin-top: 0;
    }

    .timeline::before {
        left: 20px;
    }


    /* Other Pages */
    .analytics-container {
        padding: 100px 15px 30px 15px !important;
        width: 100vw !important;
        box-sizing: border-box !important;
    }

    .hero-stats {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .hero-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #lifetime-gross {
        font-size: 11vw !important;
        letter-spacing: -1px !important;
    }

    .tour-row {
        display: flex !important;
        flex-direction: column !important;
        text-align: center;
        gap: 15px !important;
        padding: 20px !important;
    }

    .stat-box {
        align-items: center !important;
        text-align: center !important;
    }

    .prediction-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    canvas#albumShareChart {
        min-width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    /* =========================================
       MOBİL TABLOLAR: Küçük ama tam görünüm
       Geleneksel tablo yapısı korunur, %100 genişlikte sığar.
       ========================================= */

    /* Kapsayıcı: normal akış, kaydırma yok */
    .analytics-row,
    #song-table-container {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    /* Tablo %100 genişlikte, orijinal HTML yapısı korunur */
    table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: auto !important;
    }

    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
    }

    tr {
        display: table-row !important;
        background: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    th, td {
        display: table-cell !important;
        padding: 8px 4px !important;
        text-align: right !important;
        border: none !important;
        font-size: 0.65rem !important;
        /* Sayı sütunları: satır içinde kalsın (fmtNum ile kısaltılmış) */
        white-space: nowrap !important;
        line-height: 1.3 !important;
    }

    th {
        color: var(--accent-gold) !important;
        text-transform: uppercase !important;
        font-size: 0.6rem !important;
        letter-spacing: 0 !important;
        border-bottom: 1px solid rgba(212, 168, 83, 0.3) !important;
        padding-bottom: 6px !important;
    }

    /* İlk sütun: sola hizalı, uzun isimler wrap yapabilir */
    th:first-child,
    td:first-child {
        text-align: left !important;
        color: #fff !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        padding-left: 0 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    /* Grand Total satırı vurgusu — sadece EAS tablosunda */
    #eas-table-body tr:last-child td {
        font-weight: 800 !important;
        color: var(--accent-gold) !important;
        border-top: 1px solid var(--accent-gold) !important;
        background: rgba(212, 168, 83, 0.08) !important;
    }

    /* Sahte td::before etiketleri hiçbir şekilde gösterilmez */
    td::before {
        display: none !important;
    }
}

/* =========================================
   DESKTOP GUARD: td::before etiketleri masaüstünde kesinlikle gizli
   ========================================= */
@media screen and (min-width: 769px) {
    td::before {
        display: none !important;
    }
}
