/* ===================================================================
   Gigsplay Music Charts - Top 5 Widget Styles (Responsive)
   Desktop: Carousel (clickable, no JS scroll)
   Mobile/Tablet: List (Compact Vertical)
   Version: 1.1.1
   =================================================================== */

/* === Common Styles === */
.gmc-widget-top5 {
    width: 100vw;
    max-width: none;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 40px 20px;
    box-sizing: border-box;
    background: #f9f9f9;
}

.gmc-widget-top5 .gmc-widget-header,
.gmc-widget-top5 .gmc-widget-content,
.gmc-widget-top5 .gmc-widget-footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gmc-widget-top5 * {
    box-sizing: border-box;
}

/* === Header === */
.gmc-widget-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.gmc-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #000, transparent);
    max-width: 300px;
}

.gmc-widget-title {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    white-space: nowrap;
    color: #000;
}

/* ===================================================================
   DESKTOP: CAROUSEL LAYOUT (no JS, CSS only, CLICKABLE)
   =================================================================== */
@media (min-width: 769px) {
    .gmc-widget-content {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        scrollbar-color: #ccc #f9f9f9;
        padding-bottom: 10px;
    }
    
    /* Webkit scrollbar styling */
    .gmc-widget-content::-webkit-scrollbar {
        height: 8px;
    }
    
    .gmc-widget-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .gmc-widget-content::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 10px;
    }
    
    .gmc-widget-content::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    
    .gmc-song-item {
        flex: 0 0 calc(20% - 12px);
        min-width: 200px;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    
    /* Link wrapper for desktop */
    .gmc-song-link {
        display: flex;
        flex-direction: column;
        text-decoration: none;
        color: inherit;
        position: relative;
        transition: transform 0.3s ease;
    }
    
    .gmc-song-link:hover {
        transform: translateY(-10px);
    }
    
    /* Rank Badge - Desktop Carousel */
    .gmc-rank-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.85);
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 18px;
        z-index: 10;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .gmc-rank-badge.gmc-rank-top {
        background: linear-gradient(135deg, #FFD700, #FFA500);
        color: #000;
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    }
    
    /* Cover - Desktop Carousel */
    .gmc-song-cover {
        position: relative;
        width: 100%;
        padding-bottom: 100%;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        background: #f0f0f0;
    }
    
    .gmc-song-cover img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .gmc-song-link:hover .gmc-song-cover img {
        transform: scale(1.1);
    }
    
    /* Song Info - Desktop Carousel */
    .gmc-song-info {
        padding: 15px 0;
        text-align: center;
    }
    
    .gmc-song-link .gmc-song-title {
        font-size: 16px;
        font-weight: 700;
        margin: 0 0 5px 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #000;
    }
    
    .gmc-song-link .gmc-song-artist {
        font-size: 14px;
        color: #666;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Play Button - Hidden on Desktop Carousel */
    .gmc-song-play {
        display: none;
    }
}

/* ===================================================================
   MOBILE & TABLET: LIST LAYOUT (Compact Vertical)
   =================================================================== */
@media (max-width: 768px) {
    .gmc-widget-header {
        justify-content: center;
        margin-bottom: 20px;
        gap: 20px;
    }
    
    .gmc-header-line {
        display: block;
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, transparent, #000, transparent);
        max-width: 100px;
    }
    
    .gmc-widget-title {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
    
    /* List Container */
    .gmc-widget-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    /* List Item */
    .gmc-song-item {
        display: flex;
        align-items: center;
        gap: 0;
        padding: 12px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        position: relative;
        transition: all 0.3s ease;
    }
    
    .gmc-song-item:hover {
        background: #f8f8f8;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateX(5px);
    }
    
    /* Link wrapper for mobile */
    .gmc-song-link {
        display: flex;
        align-items: center;
        gap: 15px;
        flex: 1;
        text-decoration: none;
        color: inherit;
    }
    
    /* Rank Badge - Mobile List */
    .gmc-rank-badge {
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.85);
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .gmc-rank-badge.gmc-rank-top {
        background: linear-gradient(135deg, #FFD700, #FFA500);
        color: #000;
    }
    
    /* Cover - Mobile List */
    .gmc-song-cover {
        width: 60px;
        height: 60px;
        border-radius: 8px;
        overflow: hidden;
        flex-shrink: 0;
        background: #f0f0f0;
    }
    
    .gmc-song-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Song Info - Mobile List */
    .gmc-song-info {
        flex: 1;
        min-width: 0;
    }
    
    .gmc-song-title {
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 3px 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #000;
    }
    
    .gmc-song-artist {
        font-size: 13px;
        color: #666;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Play Button - Mobile List (Circle with stroke) */
    .gmc-song-play {
        width: 36px;
        height: 36px;
        border: 2.5px solid #e5e5e5;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: #fff;
        transition: all 0.25s ease;
        text-decoration: none;
        color: #777;
        margin-left: auto;
    }
    
    .gmc-song-item:hover .gmc-song-play {
        border-color: #333;
        background: #fafafa;
    }
    
    .gmc-song-play svg {
        width: 16px;
        height: 16px;
        stroke: currentColor;
        stroke-width: 2.5;
        fill: none;
        margin-left: 3px;
    }
    
    .gmc-song-item:hover .gmc-song-play svg {
        stroke: #000;
    }
}

/* Mobile Small Adjustments */
@media (max-width: 480px) {
    .gmc-widget-top5 {
        padding: 25px 15px;
    }
    
    .gmc-widget-header {
        gap: 15px;
    }
    
    .gmc-header-line {
        max-width: 60px;
    }
    
    .gmc-song-item {
        gap: 0;
        padding: 10px;
    }
    
    .gmc-song-link {
        gap: 12px;
    }
    
    .gmc-rank-badge {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .gmc-song-cover {
        width: 50px;
        height: 50px;
    }
    
    .gmc-song-title {
        font-size: 14px;
    }
    
    .gmc-song-artist {
        font-size: 12px;
    }
    
    /* Play Button - Mobile Small */
    .gmc-song-play {
        width: 36px;
        height: 36px;
        border-width: 2px;
    }
    
    .gmc-song-play svg {
        width: 16px;
        height: 16px;
        stroke-width: 2;
    }
}

/* === Footer === */
.gmc-widget-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.gmc-week-info {
    font-size: 14px;
    color: #666;
}

.gmc-view-all-btn {
    padding: 10px 30px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}

.gmc-view-all-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    .gmc-widget-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .gmc-view-all-btn {
        padding: 8px 24px;
        font-size: 13px;
    }
    
    .gmc-week-info {
        font-size: 12px;
    }
}

/* === Empty State === */
.gmc-widget-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* === Print Styles === */
@media print {
    .gmc-song-play,
    .gmc-view-all-btn {
        display: none !important;
    }
}