/* --- 1. Main App Container --- */
.ytsc-chart-app {
    background: #000;
/* Add the Webkit prefix for Safari/iOS support */
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #2a2a2a;
    color: #fff;
    margin: 20px auto;
    max-width: 800px;
    font-family: inherit;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

body {
    font-family: 'Poppins', sans-serif;
}
.bebas-neue-regular {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* --- 2. Navigation & Pagination --- */
.chart-nav, .ytsc-pagination {
    display: flex;
    padding: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.chart-nav {
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.period-btn, .ytsc-pagination button {
    text-decoration: none;
    color: #000;
    padding: 15px;
    margin-right: 15px;
    border-radius: 10px;
    background: #ccc;
    transition: 0.15s;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Poppins';
    border: none;
    cursor: pointer;
}

.period-btn:hover, .period-btn.active,
.ytsc-pagination button:hover, .ytsc-pagination button.active {
    background: #444;
    padding: 15px;
    color: #ccc;
    font-weight: bold;
}

.ytsc-pagination button.active {
    background: #ccff00;
    color: #fff;
}

/* --- 3. Unified Card Feed (Vertical Stack) --- */
.ytsc-chart-feed {
    width: 100%;
}

.ytsc-card {
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 30px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.ytsc-card:hover {
    background: #161616;
    border-color: #333333;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.ytsc-card:hover .card-thumb img {
    filter: brightness(1.3);
    transition: filter 0.3s ease;
}

/* --- 4. Video Thumbnail & Badges --- */
.card-thumb {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transform: scale(1.05); 
    filter: brightness(1.1);
}

.badge-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    max-width: 80%;
}

.badge-new, .badge-trending {
    padding: 6px 14px; 
    border-radius: 6px;
    font-size: 12px; 
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6); 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    text-transform: uppercase;
    width: fit-content;
    border: 1px solid #000;
}

.badge-new { background: #26a911; }
.badge-trending {
    background: linear-gradient(45deg, #ff3600, #ff0000); 
    animation: badge-pulse 3s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- 5. Content & Typography --- */
.card-header {
    text-align: center;
    padding: 5px 0 15px 0;
}

.v-title {
    font-weight: 700;
    font-size: 24px;
    color: #fff;
    line-height: 1.4;
}

.card-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 10px 15px; /* Increased padding slightly for the new two-column feel */
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 10px;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* LEFT COLUMN: Rank & Peak */
.stat-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.rank-value {
    font-size: 24px;
    font-weight: 900;
    color: #ff3e3e !important; 
    display: flex;
    align-items: center;
    gap: 8px;
}

.v-peak {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-top: 2px;
}

.v-peak strong {
    color: #ffd700;
}

/* RIGHT COLUMN: Performance & Total Views */
.stat-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 0;
}

.gain-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.gain-number {
    color: #00ff88 !important;
    font-weight: bold;
    font-size: 18px;
    font-family: 'Courier New', Courier, monospace;
    white-space: nowrap;
}

.gain-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #555;
}

.v-total-nested {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    border-top: 1px solid #1a1a1a;
    padding-top: 4px;
    width: 100%;
}

.v-total-nested strong {
    color: #fff;
    font-weight: 700;
}

.rank-arrow.up { color: #00ff88 !important; }
.rank-arrow.down { color: #ff3e3e !important; }
.rank-arrow.neutral { color: #ffcc00 !important; }

.card-footer-spacer {
    height: 10px;
}

/* --- 6. Video Modal --- */
.ytsc-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: #0a0a0a;
    backdrop-filter: blur(8px);
}

.ytsc-modal-content {
    position: relative;
    margin: 15vh auto;
    width: 95%;
    max-width: 900px;
    background: #000;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.ytsc-close {
    position: absolute;
    right: 15px; top: 10px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 100;
}

#ytsc-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    width: 100%;
    background: #000 !important;
}

#ytsc-player-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* --- 7. Mobile Adjustments --- */
@media screen and (max-width: 430px) {
    .ytsc-chart-app { padding: 10px; }
    
    .v-title { 
        font-size: 16px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .rank-value { font-size: 20px !important; }
    .gain-number { font-size: 15px !important; }
    .stat-label, .gain-label { font-size: 12px; }
}