/* 
 * FlowLatin - Single Post CSS (Consolidated)
 * -----------------------------------------
 * Centralizes layout and platform-specific styles for all single posts.
 */

/* 1. LAYOUT BASE & CONTAINERS */
/* Centrar solo el contenedor de contenido, no el header global */
.single .site-content > .ast-container {
    display: block !important;
    margin: 0 auto !important;
    max-width: 1200px !important;
}

/* Fix para scroll en single */
body.single .ast-container,
body.single .site-content,
body.single .ast-container .ast-row {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    position: relative !important;
}

.single-post-content {
    margin-bottom: 30px;
}

.single-post-content article {
    background: rgba(26, 26, 40, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    margin-bottom: 0.01px !important;
}

.fl-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 2. HEADER - INLINE & PREMIUM */
.post-header-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 0 20px 0;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.fl-header-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: stretch;
    margin-bottom: 30px;
}

/* Exclusive Premium Header (Desktop Only) */
.fl-premium-exclusive-header {
    display: none;
    grid-template-columns: 140px 1fr 140px;
    align-items: start; /* Anclar al borde superior para mayor estabilidad */
    justify-items: center;
    margin-bottom: 35px;
    padding: 25px;
    background: rgba(26, 26, 40, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

.fl-premium-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.fl-premium-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fl-premium-title-box {
    background: #ff0404;
    padding: 15px 35px; /* Proporción más profesional */
    border-radius: 8px;
    margin-bottom: 12px; /* Reducido para mayor cercanía a los datos */
    box-shadow: 0 5px 15px rgba(255,4,4,0.3);
    width: fit-content; /* Dinámico según el texto */
    max-width: 700px; /* Ancho máximo para evitar barras gigantes */
    margin-left: auto;
    margin-right: auto;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: auto; /* Revertido de Phase 2 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.fl-premium-title {
    font-size: clamp(22px, 3.2vw, 32px) !important;
    text-wrap: balance;
    line-height: 1.1 !important;
    margin: 0 !important;
    font-weight: 900 !important;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}


.fl-premium-category-label {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.3s ease;
    margin-bottom: 15px; /* Moved from inline PHP */
    margin-top: 2px; /* Pequeño ajuste para no pegar al cuadro rojo */
}

/* Reducir margen si no hay productores para que no afecte el centrado visual vertical */
.fl-premium-content-wrapper:not(.has-producers) .fl-premium-category-label {
    margin-bottom: 0;
    margin-top: 0;
}

.fl-premium-category-label:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    letter-spacing: 3px;
}

@media (min-width: 901px) {
    body.single.user-has-premium .fl-premium-exclusive-header {
        display: grid;
    }
    body.single.user-has-premium .fl-premium-exclusive-header + .post-header-inline {
        display: none !important;
    }
}

/* 3. PANELS & THUMBNAILS */
.fl-thumbnail {
    flex: 0 0 300px;
    padding: 20px;
    background: rgba(31, 41, 55, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.fl-info-panel, .fl-player-panel {
    min-width: 300px;
    padding: 20px;
    background: rgba(31, 41, 55, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.fl-info-panel { flex: 1; display: flex; flex-direction: column; }
.fl-player-panel { margin-bottom: 20px; }

/* Thumbnail hover effect */
.post-thumbnail img { transition: transform 0.3s ease; }
.post-thumbnail img:hover { transform: scale(1.02); }

/* 4. PREMIUM BLOCKING & MESSAGES */
.mensaje-bloqueo-premium {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    margin: 20px 0;
}

.icono-bloqueo { font-size: 24px; }
.contenido-bloqueo strong { color: #dc2626; display: block; margin-bottom: 5px; }

/* 5. COMPONENTS (SONG LISTS, DOWNLOADS, PLAYER) */
.song-list { display: flex; flex-direction: column; flex: 1; }
.song-list > div { transition: all 0.3s ease; }
.song-list > div:hover {
    background: rgba(75, 85, 99, 0.5) !important;
    transform: translateX(5px);
}

/* Download Buttons (Standard) */
.download-buttons a,
.download-buttons .download-button {
    display: block;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-bottom: 6px;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    font-size: 0.9em;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.download-buttons a:hover,
.download-buttons .download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.6);
}

/* Premium Enabled text */
.download-buttons p.premium-active-msg {
    color: #10b981 !important;
    text-align: center;
    padding: 8px 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin: 6px 0;
    font-size: 0.85em;
    line-height: 1.2;
}

/* Full Pack Download Button (RED) */
.standard-content div[style*="text-align: right"] a[target="_blank"],
.fl-full-pack-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #dc2626, #000000) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 5px !important;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    border: 2px solid #ffffff !important;
    transition: all 0.3s ease;
}

.fl-full-pack-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* 6. PLATFORM-SPECIFIC PLAYER PATCHES (Sonaar Grid) */
.fl-col-play { 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    position: relative !important; 
    line-height: 0 !important;
    padding: 0 !important;
    min-height: 50px !important;
    overflow: visible !important;
}

/* Override sonaar player complexity */
.fl-col-play article.iron_widget_radio,
.fl-col-play .iron-audioplayer,
.fl-col-play .srp_player_boxed,
.fl-col-play .album-player,
.fl-col-play .srp_player_grid,
.fl-col-play .srp_control_box {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    height: auto !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 50px !important;
    overflow: visible !important;
}

/* Circular Play Button */
.fl-col-play .srp_play,
.fl-col-play .srp-play-button,
.fl-col-play .srp-play-button-label-container { 
    width: 40px !important; 
    height: 40px !important; 
    min-width: 40px !important;
    min-height: 40px !important;
    background: transparent !important; 
    border: 2px solid #555 !important; 
    border-radius: 50% !important;
    font-size: 14px !important; 
    color: #fff !important; 
    transition: all 0.2s !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important; 
    padding: 0 !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    text-decoration: none !important;
}

/* Specific logic for Font Awesome playback icons in singles */
.fl-col-play .srp_play i,
.fl-col-play .srp-play-button i {
    font-size: 16px !important;
}

.fl-col-play .srp_play .play-icon,
.fl-col-play .srp-play-button .play-icon { display: block !important; }

.fl-col-play .srp_play .pause-icon,
.fl-col-play .srp-play-button .pause-icon { display: none !important; }

/* Playing State */
.fl-col-play :is(.srp_play.fl-playing, .srp-play-button.fl-playing, .iron-audioplayer.iron-playing .srp_play) .play-icon {
    display: none !important;
}
.fl-col-play :is(.srp_play.fl-playing, .srp-play-button.fl-playing, .iron-audioplayer.iron-playing .srp_play) .pause-icon {
    display: block !important;
}

/* Loading State */
.fl-col-play :is(.srp_play.fl-loading-audio, .srp-play-button.fl-loading-audio) i:not(.spinner-icon) {
    display: none !important;
}

.fl-col-play .srp-play-button-label,
.fl-col-play .srp-pause-button-label { display: none !important; }

/* Platform Accents */
.category-beatport .fl-col-play .srp_play:hover,
.category-beatport .fl-col-play .srp-play-button:hover,
.category-beatport .iron-audioplayer.iron-playing .srp_play,
.category-beatport .iron-audioplayer.iron-playing .srp-play-button { 
    border-color: #00ff66 !important; 
    color: #00ff66 !important; 
}

.category-traxsource .fl-col-play .srp_play:hover,
.category-traxsource .fl-col-play .srp-play-button:hover,
.category-traxsource .iron-audioplayer.iron-playing .srp_play,
.category-traxsource .iron-audioplayer.iron-playing .srp-play-button { 
    border-color: #FF6B35 !important; 
    color: #FF6B35 !important; 
}

/* 7. RESPONSIVE OPTIMIZATIONS */
@media (max-width: 768px) {
    .fl-single-container { padding: 10px 0 !important; }
    .fl-header-wrapper { margin-bottom: 15px; gap: 15px; padding: 0 10px; flex-direction: column; }
    
    .fl-thumbnail {
        flex: 0 0 120px !important;
        min-width: 120px !important;
        padding: 10px !important;
        margin: 0 auto !important;
    }
    
    .fl-thumbnail img { max-width: 100px !important; height: auto !important; }

    .fl-info-panel { min-width: 100% !important; padding: 15px !important; border-radius: 8px !important; }

    .fl-player-panel {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }
    .fl-player-panel h3 { display: none !important; }

    /* Center headers in mobile */
    body.single .post-header-inline {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
        justify-content: center !important;
    }
    
    body.single .post-header-inline .ast-single-post-category { order: 2; width: 100%; text-align: center; }
    body.single .post-header-inline .title-banner-box { order: 1; width: 100%; text-align: center; }
    
    body.single .post-header-inline .ast-single-post-category .ast-button {
        display: inline-block !important;
        margin: 0 auto !important;
    }

    /* Full pack button mobile */
    .standard-content div[style*="text-align: right"] { text-align: center !important; }
    .standard-content div[style*="text-align: right"] a[target="_blank"] { width: 100%; max-width: 280px; justify-content: center; }
}

/* Producer Cards Mini */
.mini-productor-card:hover img { transform: scale(1.1); border-color: #ef4444 !important; }
.mini-productor-card:hover span { color: #ef4444 !important; }

@media (max-width: 480px) {
    .mini-productor-card { width: 70px !important; }
    .productor-img-wrapper { width: 55px !important; height: 55px !important; }
}

/* 8. CATEGORY-SPECIFIC UNIQUE STYLES (MIGRATED) */

/* Pools & Especiales - Centrar botón de descarga del pack */
body.single .contenedor-boton-comprimido-externo {
    text-align: center !important;
    margin: 0 auto 20px auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

body.single .contenedor-boton-comprimido-externo a.boton-comprimido {
    width: 100% !important;
    max-width: 300px !important;
    justify-content: center !important;
}

/* Freepacks - Admin Editor & Recommended Grid */
.admin-freepacks-editor {
    background: rgba(239, 68, 68, 0.05);
    border: 2px solid #ef4444;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.admin-checkbox-grid::-webkit-scrollbar { width: 6px; }
.admin-checkbox-grid::-webkit-scrollbar-thumb { background: #ef4444; border-radius: 3px; }

.home-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.home-posts-grid .home-post-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 48px rgba(255, 0, 0, 0.6) !important;
}

@media (max-width: 1024px) {
    .home-posts-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 640px) {
    .home-posts-grid { grid-template-columns: 1fr !important; }
}

/* Flyers - Layout & Specific Download Button */
.flyers-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
    align-items: start;
}

.category-dflyers .download-button {
    display: inline-block;
    background: white;
    color: #ff0000;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.category-dflyers .download-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3) !important;
}

/* Anuncio - Hover específico */
.category-anuncio .ast-button:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(246, 59, 59, 0.4) !important;
    background: #ce2222 !important;
}

@media (max-width: 768px) {
    .flyers-content-wrapper {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* 9. PLAYLIST TABS SYSTEM (MULTI-PLAYLIST) */
.fl-playlist-tabs {
    margin: 25px 0;
    width: 100%;
}

.fl-tab-buttons {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid rgba(255, 0, 0, 0.3);
    margin-bottom: 20px;
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.fl-tab-buttons::-webkit-scrollbar {
    height: 4px;
}

.fl-tab-buttons::-webkit-scrollbar-thumb {
    background: #ff0000ff;
    border-radius: 2px;
}

.fl-tab-btn {
    padding: 12px 24px;
    background: rgba(26, 26, 40, 0.6);
    margin-bottom: 6px;
    color: #94a3b8;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fl-tab-btn:hover {
    color: #fff;
    background: rgba(255, 0, 0, 0.1);
}

.fl-tab-btn.active {
    color: #fff !important;
    border-bottom-color: #ff0000ff !important;
    background: #ff0000ff !important;
    box-shadow: 0 -4px 10px rgba(255, 0, 0, 0.2);
}

.fl-tab-pane {
    display: none;
    animation: fadeInTab 0.3s ease-in-out;
}

.fl-tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .tab-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
}
