/* ================================================
   Top 100 Reggae Charts - iTunes
   Professional Dark Theme
   ================================================ */

/* Reset & Base */
.reggae-charts-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    background-color: #0d0d0d;
    color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.reggae-charts-container * {
    box-sizing: border-box;
}

/* ================================================
   Header
   ================================================ */
.reggae-charts-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    position: relative;
}

.reggae-charts-header-inner {
    padding: 28px 32px 20px;
}

.reggae-charts-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 13px;
    color: #d4af37;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Reggae flag stripe */
.reggae-flag-stripe {
    display: flex;
    height: 4px;
}

.stripe-green {
    flex: 1;
    background-color: #009B3A;
}

.stripe-gold {
    flex: 1;
    background-color: #FED100;
}

.stripe-red {
    flex: 1;
    background-color: #CE2025;
}

/* ================================================
   Controls Bar (Tabs + Country Selector)
   ================================================ */
.reggae-charts-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: #141414;
    border-bottom: 1px solid #222;
    gap: 16px;
    flex-wrap: wrap;
}

/* Tabs */
.reggae-charts-tabs {
    display: flex;
    gap: 4px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 3px;
}

.reggae-tab-btn {
    padding: 10px 28px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.reggae-tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.reggae-tab-btn.active {
    background: #d4af37;
    color: #0d0d0d;
}

/* Country Selector */
.reggae-charts-country-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.country-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}

.reggae-country-select {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #333;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 180px;
    transition: border-color 0.2s ease;
}

.reggae-country-select:hover,
.reggae-country-select:focus {
    border-color: #d4af37;
    outline: none;
}

.reggae-country-select option {
    background: #1a1a1a;
    color: #ffffff;
}

/* ================================================
   Loading State
   ================================================ */
.reggae-charts-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
}

.reggae-charts-loading p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.reggae-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #222;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: reggae-spin 0.8s linear infinite;
}

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

/* ================================================
   Error State
   ================================================ */
.reggae-charts-error {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2a1a1a;
    color: #CE2025;
    font-size: 24px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.reggae-charts-error p {
    color: #999;
    font-size: 16px;
    margin: 4px 0;
}

.reggae-charts-error .error-sub {
    font-size: 14px;
    color: #666;
}

/* ================================================
   Chart Content
   ================================================ */
.reggae-chart-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #141414;
    border-bottom: 1px solid #1e1e1e;
}

.chart-count {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.chart-country-badge {
    font-size: 12px;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Chart List */
.reggae-chart-list {
    padding: 0;
}

/* Chart Item (Row) */
.reggae-chart-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid #1a1a1a;
    transition: background-color 0.15s ease;
    gap: 16px;
}

.reggae-chart-item:hover {
    background-color: #151515;
}

.reggae-chart-item:last-child {
    border-bottom: none;
}

/* Rank */
.reggae-chart-rank {
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.rank-number {
    font-size: 18px;
    font-weight: 700;
    color: #888;
    font-variant-numeric: tabular-nums;
}

.reggae-chart-item:nth-child(-n+3) .rank-number {
    color: #d4af37;
    font-size: 20px;
}

/* Artwork */
.reggae-chart-artwork {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reggae-chart-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info */
.reggae-chart-info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.chart-item-name {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.chart-item-artist {
    margin: 0 0 2px;
    font-size: 13px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-item-album {
    margin: 0 0 2px;
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.chart-item-tracks {
    margin: 0 0 2px;
    font-size: 12px;
    color: #777;
}

.chart-item-label {
    margin: 0 0 4px;
    font-size: 11px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Star Rating */
.reggae-star-rating {
    display: inline-flex;
    gap: 2px;
}

.reggae-star {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
    user-select: none;
    line-height: 1;
}

.reggae-star:hover,
.reggae-star.filled {
    color: #d4af37;
}

.reggae-star:hover {
    transform: scale(1.2);
}

.reggae-rating-text {
    font-size: 11px;
    color: #666;
    margin-left: 6px;
}

/* Actions */
.reggae-chart-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.reggae-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: #1DB954;
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.reggae-download-btn:hover {
    background: #1ed760;
    transform: scale(1.02);
    color: #ffffff;
    text-decoration: none;
}

.reggae-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: transparent;
    color: #b3b3b3;
    border: 1px solid #333;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reggae-share-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

/* ================================================
   Share Modal
   ================================================ */
.reggae-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reggae-share-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.reggae-share-dialog {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid #282828;
}

.reggae-share-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #282828;
}

.reggae-share-dialog-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.reggae-share-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #282828;
    color: #888;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
}

.reggae-share-close-btn:hover {
    background: #333;
    color: #fff;
}

/* Size Toggle */
.reggae-share-size-options {
    display: flex;
    gap: 4px;
    padding: 16px 24px;
    background: #151515;
}

.reggae-size-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #333;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reggae-size-btn:hover {
    border-color: #555;
    color: #ccc;
}

.reggae-size-btn.active {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

/* Canvas Preview */
.reggae-share-preview-container {
    padding: 20px 24px;
    display: flex;
    justify-content: center;
    background: #111;
}

#reggae-plaque-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Share Action Buttons */
.reggae-share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px 24px 24px;
}

.reggae-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reggae-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.download-btn {
    background: #d4af37;
    color: #0d0d0d;
    grid-column: 1 / -1;
}

.download-btn:hover {
    background: #e0c04a;
}

.twitter-btn {
    background: #1a1a2e;
    color: #ffffff;
}

.twitter-btn:hover {
    background: #242444;
}

.facebook-btn {
    background: #1a2744;
    color: #4a90d9;
}

.facebook-btn:hover {
    background: #223355;
}

.whatsapp-btn {
    background: #1a3a2a;
    color: #25D366;
}

.whatsapp-btn:hover {
    background: #224433;
}

.instagram-btn {
    background: linear-gradient(135deg, #2a1a3a 0%, #3a1a2a 100%);
    color: #E1306C;
}

.instagram-btn:hover {
    background: linear-gradient(135deg, #3a2a4a 0%, #4a2a3a 100%);
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 768px) {
    .reggae-charts-container {
        border-radius: 0;
    }

    .reggae-charts-header-inner {
        padding: 20px 16px 14px;
    }

    .logo-text h1 {
        font-size: 20px;
    }

    .reggae-charts-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 10px;
    }

    .reggae-charts-tabs {
        width: 100%;
    }

    .reggae-tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }

    .reggae-charts-country-wrap {
        width: 100%;
    }

    .reggae-country-select {
        width: 100%;
        min-width: unset;
    }

    .reggae-chart-item {
        padding: 12px 16px;
        gap: 10px;
    }

    .reggae-chart-rank {
        width: 32px;
    }

    .rank-number {
        font-size: 15px;
    }

    .reggae-chart-item:nth-child(-n+3) .rank-number {
        font-size: 16px;
    }

    .reggae-chart-artwork {
        width: 56px;
        height: 56px;
    }

    .chart-item-name {
        font-size: 14px;
    }

    .chart-item-artist {
        font-size: 12px;
    }

    .chart-item-label {
        display: none;
    }

    .reggae-chart-actions {
        flex-direction: column;
        gap: 6px;
    }

    .reggae-download-btn,
    .reggae-share-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Modal responsive */
    .reggae-share-dialog {
        max-width: 100%;
        border-radius: 12px;
    }

    .reggae-share-actions {
        grid-template-columns: 1fr;
    }

    .download-btn {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    .reggae-chart-item {
        flex-wrap: wrap;
        padding: 12px 12px;
    }

    .reggae-chart-info {
        flex-basis: calc(100% - 108px);
    }

    .reggae-chart-actions {
        flex-direction: row;
        width: 100%;
        padding-left: 96px;
        margin-top: 4px;
    }

    .reggae-chart-artwork {
        width: 48px;
        height: 48px;
        border-radius: 4px;
    }

    .reggae-chart-rank {
        width: 28px;
    }

    .rank-number {
        font-size: 14px;
    }

    .chart-item-name {
        font-size: 13px;
    }

    .chart-item-album,
    .chart-item-tracks {
        display: none;
    }

    .reggae-star {
        font-size: 12px;
    }
}

/* ================================================
   Scrollbar Styling
   ================================================ */
.reggae-charts-container::-webkit-scrollbar,
.reggae-share-dialog::-webkit-scrollbar {
    width: 6px;
}

.reggae-charts-container::-webkit-scrollbar-track,
.reggae-share-dialog::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.reggae-charts-container::-webkit-scrollbar-thumb,
.reggae-share-dialog::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.reggae-charts-container::-webkit-scrollbar-thumb:hover,
.reggae-share-dialog::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ================================================
   Top 3 Special Styling
   ================================================ */
.reggae-chart-item:nth-child(1) {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
}

.reggae-chart-item:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.05) 0%, transparent 60%);
}

.reggae-chart-item:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.05) 0%, transparent 60%);
}

.reggae-chart-item:nth-child(1):hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, rgba(21, 21, 21, 1) 60%);
}

.reggae-chart-item:nth-child(2):hover {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.08) 0%, rgba(21, 21, 21, 1) 60%);
}

.reggae-chart-item:nth-child(3):hover {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.08) 0%, rgba(21, 21, 21, 1) 60%);
}

/* ================================================
   Animation
   ================================================ */
.reggae-chart-item {
    animation: reggae-fadeIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes reggae-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for first 20 visible items */
.reggae-chart-item:nth-child(1) { animation-delay: 0.02s; }
.reggae-chart-item:nth-child(2) { animation-delay: 0.04s; }
.reggae-chart-item:nth-child(3) { animation-delay: 0.06s; }
.reggae-chart-item:nth-child(4) { animation-delay: 0.08s; }
.reggae-chart-item:nth-child(5) { animation-delay: 0.10s; }
.reggae-chart-item:nth-child(6) { animation-delay: 0.12s; }
.reggae-chart-item:nth-child(7) { animation-delay: 0.14s; }
.reggae-chart-item:nth-child(8) { animation-delay: 0.16s; }
.reggae-chart-item:nth-child(9) { animation-delay: 0.18s; }
.reggae-chart-item:nth-child(10) { animation-delay: 0.20s; }
.reggae-chart-item:nth-child(11) { animation-delay: 0.22s; }
.reggae-chart-item:nth-child(12) { animation-delay: 0.24s; }
.reggae-chart-item:nth-child(13) { animation-delay: 0.26s; }
.reggae-chart-item:nth-child(14) { animation-delay: 0.28s; }
.reggae-chart-item:nth-child(15) { animation-delay: 0.30s; }
.reggae-chart-item:nth-child(16) { animation-delay: 0.32s; }
.reggae-chart-item:nth-child(17) { animation-delay: 0.34s; }
.reggae-chart-item:nth-child(18) { animation-delay: 0.36s; }
.reggae-chart-item:nth-child(19) { animation-delay: 0.38s; }
.reggae-chart-item:nth-child(20) { animation-delay: 0.40s; }

/* Items after 20 appear immediately */
.reggae-chart-item:nth-child(n+21) {
    animation-delay: 0s;
    animation-duration: 0.15s;
}
