/**
 * Top 20 Musical - Estilos Frontend
 * Inspirado en el diseño de la imagen proporcionada
 */

/* Contenedor principal */
.top20-musical-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Header del Top 20 */
.top20-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(139, 159, 74, 0.3);
}

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

.top20-title {
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    letter-spacing: -2px;
    text-transform: uppercase;
    flex-grow: 1;
}

.top20-title span {
    color: #8B9F4A;
    font-size: 5rem;
}

.top20-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(139, 159, 74, 0.4);
}

.top20-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 159, 74, 0.6);
    background: linear-gradient(135deg, #9AAF5A 0%, #7A8F4A 100%);
}

.top20-btn span {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.top20-btn:hover span {
    transform: translateX(5px);
}

/* Grid de tarjetas - AHORA ES UN CARRUSEL HORIZONTAL */
.top20-grid-wrapper {
    position: relative;
    padding: 0 60px;
    margin: 0 -20px;
}

.top20-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 15px 20px 30px 20px;
    scrollbar-width: thin;
    scrollbar-color: #8B9F4A #1a1a2e;
    scroll-snap-type: x mandatory;
}

/* Ocultar scrollbar en algunos navegadores pero mantener funcionalidad */
.top20-grid::-webkit-scrollbar {
    height: 6px;
}

.top20-grid::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
    border-radius: 10px;
}

.top20-grid::-webkit-scrollbar-thumb {
    background: #8B9F4A;
    border-radius: 10px;
}

.top20-grid::-webkit-scrollbar-thumb:hover {
    background: #9AAF5A;
}

/* Controles de navegación del Grid */
.top20-grid-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.top20-grid-nav:hover {
    transform: translateY(-50%) scale(1.15);
    background: linear-gradient(135deg, #9AAF5A 0%, #7A8F4A 100%);
    opacity: 1;
    box-shadow: 0 8px 20px rgba(139, 159, 74, 0.6);
}

.top20-grid-nav:active {
    transform: translateY(-50%) scale(1.05);
}

.top20-grid-prev {
    left: 5px;
}

.top20-grid-next {
    right: 5px;
}

/* Tarjeta individual - MÁS COMPACTA */
.top20-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    flex: 0 0 220px;
    scroll-snap-align: start;
}

.top20-card:hover {
    transform: translateY(-15px) scale(1.05);
    z-index: 10;
}

.top20-card-inner {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #0f0f1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.3s ease;
}

.top20-card:hover .top20-card-inner {
    box-shadow: 0 20px 50px rgba(139, 159, 74, 0.4);
}

/* Imagen de la tarjeta */
.top20-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Aspecto cuadrado 1:1 */
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
}

.top20-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.top20-card:hover .top20-card-image img {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(0.7);
}

.top20-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
}

/* Overlay de reproducción */
.top20-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.top20-card:hover .top20-play-overlay {
    opacity: 1;
}

.top20-play-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0;
}

.top20-play-btn:hover {
    transform: scale(1.15);
}

.top20-play-btn svg {
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

/* Badge de posición - MÁS PEQUEÑO */
.top20-position-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.position-number {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Contenido de la tarjeta - MÁS COMPACTO */
.top20-card-content {
    padding: 15px;
    background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 100%);
}

.top20-song-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top20-artist {
    font-size: 0.8rem;
    color: #8B9F4A;
    margin: 0;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal de video */
.top20-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top20-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.top20-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.top20-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    border: 3px solid #1a1a2e;
    border-radius: 50%;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.top20-modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: linear-gradient(135deg, #9AAF5A 0%, #7A8F4A 100%);
}

.top20-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Aspecto 16:9 */
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.top20-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .top20-title {
        font-size: 3rem;
    }
    
    .top20-title span {
        font-size: 4rem;
    }
    
    .top20-card {
        flex: 0 0 200px;
    }
    
    .top20-grid-wrapper {
        padding: 0 50px;
    }
}

@media (max-width: 768px) {
    .top20-header {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .top20-title {
        font-size: 2.5rem;
    }
    
    .top20-title span {
        font-size: 3rem;
    }
    
    .top20-btn {
        width: 100%;
        justify-content: center;
    }
    
    .top20-card {
        flex: 0 0 180px;
    }
    
    .top20-grid-wrapper {
        padding: 0 45px;
    }
    
    .top20-grid-nav {
        width: 38px;
        height: 38px;
    }
    
    .top20-modal-content {
        width: 95%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .top20-musical-container {
        padding: 20px 10px;
    }
    
    .top20-title {
        font-size: 2rem;
    }
    
    .top20-title span {
        font-size: 2.5rem;
    }
    
    .top20-card {
        flex: 0 0 150px;
    }
    
    .top20-grid-wrapper {
        padding: 0 35px;
    }
    
    .top20-grid-nav {
        width: 32px;
        height: 32px;
    }
    
    .top20-grid-prev {
        left: 2px;
    }
    
    .top20-grid-next {
        right: 2px;
    }
    
    .top20-card-content {
        padding: 12px;
    }
    
    .top20-song-title {
        font-size: 0.85rem;
    }
    
    .top20-artist {
        font-size: 0.75rem;
    }
    
    .top20-position-badge {
        width: 35px;
        height: 35px;
    }
    
    .position-number {
        font-size: 1.1rem;
    }
}

/* Compatibilidad con Elementor */
.elementor-widget-container .top20-musical-container {
    background: transparent;
    padding: 0;
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.top20-card-inner:hover .top20-position-badge {
    animation: pulse 1s infinite;
}

/* ========================================
   ESTILO LIST: Lista Vertical
   ======================================== */

.top20-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top20-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(90deg, #0f0f1e 0%, #1a1a2e 100%);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.top20-list-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(139, 159, 74, 0.3);
    background: linear-gradient(90deg, #1a1a2e 0%, #0f0f1e 100%);
}

.top20-list-position {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.top20-list-position .position-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
}

.top20-list-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.top20-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.top20-list-item:hover .top20-list-image img {
    transform: scale(1.1);
}

.top20-no-image-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
    font-size: 2rem;
}

.top20-list-content {
    flex-grow: 1;
    min-width: 0;
}

.top20-list-content .top20-song-title {
    font-size: 1.3rem;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top20-list-content .top20-artist {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top20-list-play-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #8B9F4A;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.top20-list-play-btn:hover {
    color: #ffffff;
    transform: scale(1.2);
}

/* ========================================
   ESTILO CAROUSEL: Carrusel Horizontal
   ======================================== */

.top20-carousel-wrapper {
    position: relative;
    padding: 0 60px;
}

.top20-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 15px 0 30px 0;
    scrollbar-width: thin;
    scrollbar-color: #8B9F4A #1a1a2e;
    scroll-snap-type: x mandatory;
}

.top20-carousel::-webkit-scrollbar {
    height: 6px;
}

.top20-carousel::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
    border-radius: 10px;
}

.top20-carousel::-webkit-scrollbar-thumb {
    background: #8B9F4A;
    border-radius: 10px;
}

.top20-carousel::-webkit-scrollbar-thumb:hover {
    background: #9AAF5A;
}

.top20-carousel-item {
    flex: 0 0 220px;
    scroll-snap-align: start;
}

.top20-carousel-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #0f0f1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.top20-carousel-item:hover .top20-carousel-card {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 50px rgba(139, 159, 74, 0.4);
}

.top20-carousel-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
}

.top20-carousel-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.top20-carousel-item:hover .top20-carousel-image img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

.top20-carousel-content {
    padding: 15px;
    background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 100%);
}

.top20-carousel-content .top20-song-title {
    font-size: 0.95rem;
    margin: 0 0 6px 0;
}

.top20-carousel-content .top20-artist {
    font-size: 0.8rem;
    margin: 0;
}

.top20-carousel-prev,
.top20-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.top20-carousel-prev:hover,
.top20-carousel-next:hover {
    transform: translateY(-50%) scale(1.15);
    background: linear-gradient(135deg, #9AAF5A 0%, #7A8F4A 100%);
    opacity: 1;
    box-shadow: 0 8px 20px rgba(139, 159, 74, 0.6);
}

.top20-carousel-prev:active,
.top20-carousel-next:active {
    transform: translateY(-50%) scale(1.05);
}

.top20-carousel-prev {
    left: 5px;
}

.top20-carousel-next {
    right: 5px;
}

/* ========================================
   BOTÓN VER MÁS (Preview Mode)
   ======================================== */

.top20-view-more-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(139, 159, 74, 0.3);
}

.top20-view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 18px 45px;
    background: linear-gradient(135deg, #8B9F4A 0%, #6A7F3A 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(139, 159, 74, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.top20-view-more-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(139, 159, 74, 0.7);
    background: linear-gradient(135deg, #9AAF5A 0%, #7A8F4A 100%);
}

.top20-view-more-btn span {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.top20-view-more-btn:hover span {
    transform: translateX(8px);
}

/* ========================================
   RESPONSIVE STYLES - LIST
   ======================================== */

@media (max-width: 768px) {
    .top20-list-item {
        gap: 15px;
        padding: 15px;
    }
    
    .top20-list-position {
        width: 50px;
        height: 50px;
    }
    
    .top20-list-position .position-number {
        font-size: 1.5rem;
    }
    
    .top20-list-image {
        width: 60px;
        height: 60px;
    }
    
    .top20-list-content .top20-song-title {
        font-size: 1.1rem;
    }
    
    .top20-list-content .top20-artist {
        font-size: 0.9rem;
    }
}

/* ========================================
   RESPONSIVE STYLES - CAROUSEL
   ======================================== */

@media (max-width: 1024px) {
    .top20-carousel-item {
        flex: 0 0 200px;
    }
    
    .top20-carousel-wrapper {
        padding: 0 50px;
    }
}

@media (max-width: 768px) {
    .top20-carousel-wrapper {
        padding: 0 45px;
    }
    
    .top20-carousel-item {
        flex: 0 0 180px;
    }
    
    .top20-carousel-prev,
    .top20-carousel-next {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .top20-carousel-wrapper {
        padding: 0 35px;
    }
    
    .top20-carousel-item {
        flex: 0 0 150px;
    }
    
    .top20-carousel-prev,
    .top20-carousel-next {
        width: 32px;
        height: 32px;
    }
    
    .top20-carousel-prev {
        left: 2px;
    }
    
    .top20-carousel-next {
        right: 2px;
    }
    
    .top20-view-more-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
}

