/* Radio Stream Hub - Precision Layout v3.4.0 (Fully Responsive) */

#rsh-player-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    min-width: 280px;
    height: 660px;
    background: #090912;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    font-family: 'Be Vietnam', sans-serif;
    color: #fff;
    margin: 20px auto;
    box-sizing: border-box;
}

/* 1. Top Bar */
#rsh-top-bar {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    align-items: center;
    z-index: 120;
}

#rsh-popout-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s;
}

#rsh-popout-btn:hover {
    background: #e94560;
    transform: scale(1.1);
}

#rsh-station-menu-trigger {
    padding: 6px 18px;
    background: #e94560;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsh-arrow {
    font-size: 0.7rem;
    font-style: normal;
    opacity: 1;
    color: #fff;
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.3s;
}

/* 2. Splash Overlay */
#rsh-splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1a1a2e 0%, #090912 100%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#rsh-splash-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: icon-bounce 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(233, 69, 96, 0.5));
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

#rsh-start-btn {
    padding: 14px 28px;
    background: #e94560;
    border: none;
    border-radius: 30px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    max-width: 100%;
    transition: all 0.3s;
}

#rsh-start-btn:hover {
    background: #ff5e78;
    transform: scale(1.05);
}

.rsh-splash-text {
    margin-top: 15px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* 3. Main Player & Preloader */
#rsh-main-player {
    width: 100%;
    height: 400px;
    background: #000;
    position: relative;
}

/* 3b. Now Playing Strip */
#rsh-now-playing {
    height: 55px;
    background: linear-gradient(90deg, rgba(233, 69, 96, 0.18) 0%, rgba(9, 9, 18, 0) 60%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    overflow: hidden;
    position: relative;
    z-index: 40;
}

.rsh-np-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 44px;
}

.rsh-np-dot {
    width: 9px;
    height: 9px;
    background: #e94560;
    border-radius: 50%;
    animation: rsh-live-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.8);
}

@keyframes rsh-live-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 0 8px rgba(233, 69, 96, 0);
    }
}

.rsh-np-label {
    font-size: 0.55rem;
    font-weight: 900;
    color: #e94560;
    letter-spacing: 1px;
    line-height: 1;
}

.rsh-np-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.rsh-np-cover {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    background-image: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s ease, background-image 0.4s ease;
    opacity: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rsh-np-cover::after {
    content: '🎵';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(233, 69, 96, 0.1);
}

.rsh-np-cover.has-cover::after {
    display: none;
}

.rsh-np-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rsh-np-artist {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#rsh-player-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #090912;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 50;
    flex-direction: column;
}

.rsh-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(233, 69, 96, 0.3);
    border-top: 3px solid #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.rsh-loading-text {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #e94560;
    font-weight: 700;
    letter-spacing: 1px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 4. Ads, Ticker, etc. */
#rsh-ad-carousel-container {
    padding: 10px 12px;
    height: 110px;
    background: #111120;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

#rsh-ad-wrapper {
    width: 100%;
    max-width: 330px;
    height: 90px;
    overflow: hidden;
}

#rsh-ad-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#rsh-ticker-container {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 45px;
    background: #000;
    display: flex;
    align-items: center;
}

#rsh-ticker-label {
    background: #e94560;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 900;
}

#rsh-ticker-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

#rsh-ticker-scroll {
    display: inline-block;
    animation: ticker-scroll 450s linear infinite;
    padding-left: 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 7. Global Launcher */
#rsh-floating-launcher {
    position: fixed;
    bottom: 20px;
    left: 20px !important;
    right: auto !important;
    width: 56px;
    height: 56px;
    background: #e94560;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.5);
    z-index: 999999;
    animation: float-btn 4s ease-in-out infinite;
    transition: all 0.3s;
}

#rsh-floating-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    background: #ff5e78;
}

.rsh-launcher-icon {
    font-size: 1.3rem;
}

.rsh-launcher-text {
    font-size: 0.5rem;
    font-weight: 900;
    margin-top: -2px;
}

@keyframes float-btn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 6. List Overlay */
#rsh-station-list-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.98);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

#rsh-station-list-overlay h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

#rsh-station-items {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

#rsh-station-items li {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#rsh-station-items li:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
    transform: translateX(5px);
}

#rsh-close-menu {
    width: 100%;
    padding: 15px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

#rsh-close-menu:hover {
    background: #ff5e78;
}

/* ========================================
   RESPONSIVE DESIGN - TABLETS (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    #rsh-player-container {
        max-width: 400px;
        height: 640px;
    }
    
    #rsh-main-player {
        height: 380px;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE LARGE (480px - 768px)
   ======================================== */
@media (max-width: 768px) {
    #rsh-player-container {
        max-width: 100%;
        width: 100%;
        min-width: 100%;
        height: auto;
        min-height: 600px;
        border-radius: 0;
        margin: 0;
        border-left: none;
        border-right: none;
    }
    
    #rsh-top-bar {
        height: 45px;
        padding: 0 8px;
    }
    
    #rsh-station-menu-trigger {
        font-size: 0.75rem;
        padding: 6px 14px;
    }
    
    #rsh-main-player {
        height: 350px;
    }
    
    #rsh-now-playing {
        height: 60px;
        padding: 0 10px;
        gap: 10px;
    }
    
    .rsh-np-cover {
        width: 46px;
        height: 46px;
    }
    
    .rsh-np-title {
        font-size: 0.9rem;
    }
    
    .rsh-np-artist {
        font-size: 0.75rem;
    }
    
    #rsh-ad-carousel-container {
        height: 100px;
        padding: 8px 10px;
    }
    
    #rsh-ad-wrapper {
        height: 85px;
    }
    
    #rsh-ticker-container {
        height: 40px;
    }
    
    #rsh-ticker-label {
        font-size: 0.65rem;
        padding: 0 10px;
    }
    
    #rsh-ticker-scroll {
        font-size: 0.9rem;
    }
    
    #rsh-splash-icon {
        font-size: 3.5rem;
    }
    
    #rsh-start-btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }
    
    #rsh-floating-launcher {
        bottom: 15px;
        left: 15px;
        width: 52px;
        height: 52px;
    }
    
    .rsh-launcher-icon {
        font-size: 1.2rem;
    }
    
    .rsh-launcher-text {
        font-size: 0.45rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE SMALL (320px - 480px)
   ======================================== */
@media (max-width: 480px) {
    #rsh-player-container {
        min-height: 580px;
    }
    
    #rsh-top-bar {
        height: 42px;
        padding: 0 6px;
    }
    
    #rsh-station-menu-trigger {
        font-size: 0.7rem;
        padding: 5px 12px;
        gap: 8px;
    }
    
    #rsh-popout-btn {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }
    
    #rsh-main-player {
        height: 320px;
    }
    
    #rsh-now-playing {
        height: 58px;
        padding: 0 8px;
        gap: 8px;
    }
    
    .rsh-np-indicator {
        min-width: 38px;
    }
    
    .rsh-np-dot {
        width: 8px;
        height: 8px;
    }
    
    .rsh-np-label {
        font-size: 0.5rem;
    }
    
    .rsh-np-cover {
        width: 42px;
        height: 42px;
    }
    
    .rsh-np-title {
        font-size: 0.8rem;
    }
    
    .rsh-np-artist {
        font-size: 0.7rem;
    }
    
    #rsh-ad-carousel-container {
        height: 90px;
        padding: 6px 8px;
    }
    
    #rsh-ad-wrapper {
        height: 78px;
    }
    
    #rsh-ticker-container {
        height: 38px;
    }
    
    #rsh-ticker-label {
        font-size: 0.6rem;
        padding: 0 8px;
    }
    
    #rsh-ticker-scroll {
        font-size: 0.8rem;
    }
    
    #rsh-splash-icon {
        font-size: 3rem;
    }
    
    #rsh-start-btn {
        padding: 12px 20px;
        font-size: 0.8rem;
    }
    
    .rsh-splash-text {
        font-size: 0.7rem;
    }
    
    #rsh-station-list-overlay {
        padding: 15px;
    }
    
    #rsh-station-list-overlay h3 {
        font-size: 1rem;
    }
    
    #rsh-station-items li {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    #rsh-close-menu {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    #rsh-floating-launcher {
        bottom: 12px;
        left: 12px;
        width: 48px;
        height: 48px;
    }
    
    .rsh-launcher-icon {
        font-size: 1.1rem;
    }
    
    .rsh-launcher-text {
        font-size: 0.4rem;
    }
    
    .rsh-spinner {
        width: 40px;
        height: 40px;
    }
    
    .rsh-loading-text {
        font-size: 0.7rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE EXTRA SMALL (< 320px)
   ======================================== */
@media (max-width: 320px) {
    #rsh-player-container {
        min-height: 560px;
    }
    
    #rsh-top-bar {
        height: 40px;
    }
    
    #rsh-station-menu-trigger {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    
    #rsh-main-player {
        height: 280px;
    }
    
    #rsh-now-playing {
        height: 55px;
    }
    
    .rsh-np-cover {
        width: 38px;
        height: 38px;
    }
    
    .rsh-np-title {
        font-size: 0.75rem;
    }
    
    .rsh-np-artist {
        font-size: 0.65rem;
    }
    
    #rsh-ad-carousel-container {
        height: 80px;
    }
    
    #rsh-ad-wrapper {
        height: 70px;
    }
    
    #rsh-ticker-container {
        height: 35px;
    }
    
    #rsh-floating-launcher {
        bottom: 10px;
        left: 10px;
        width: 44px;
        height: 44px;
    }
    
    .rsh-launcher-icon {
        font-size: 1rem;
    }
}

/* ========================================
   LANDSCAPE MODE (Mobile Horizontal)
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    #rsh-player-container {
        height: 100vh;
        min-height: 100vh;
        max-width: 100%;
    }
    
    #rsh-main-player {
        height: calc(100vh - 250px);
    }
    
    #rsh-ad-carousel-container {
        height: 80px;
    }
}

/* ========================================
   POPUP MODE (Ventana Emergente)
   ======================================== */
body.rsh-popup-mode #rsh-player-container {
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
}

body.rsh-popup-mode #rsh-popout-btn {
    display: none !important;
}

body.rsh-popup-mode #rsh-top-bar {
    height: 50px;
}

body.rsh-popup-mode #rsh-now-playing {
    height: 60px;
}

body.rsh-popup-mode #rsh-main-player {
    height: calc(100vh - 260px);
}

/* ========================================
   DARK MODE SUPPORT (Sistema Operativo)
   ======================================== */
@media (prefers-color-scheme: dark) {
    #rsh-player-container {
        background: #090912;
    }
}

/* ========================================
   TOUCH DEVICES (Optimización para Touch)
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    #rsh-station-items li {
        padding: 18px;
        font-size: 1rem;
    }
    
    #rsh-station-items li:hover {
        transform: none;
    }
    
    #rsh-close-menu {
        padding: 18px;
        font-size: 1rem;
    }
    
    #rsh-start-btn {
        padding: 16px 32px;
        font-size: 1rem;
    }
    
    #rsh-floating-launcher {
        width: 60px;
        height: 60px;
    }
    
    .rsh-launcher-icon {
        font-size: 1.4rem;
    }
}

/* ========================================
   ACCESSIBILITY (Accesibilidad)
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #rsh-floating-launcher {
        animation: none;
    }
    
    #rsh-splash-icon {
        animation: none;
    }
    
    .rsh-np-dot {
        animation: none;
    }
    
    #rsh-ticker-scroll {
        animation: none;
    }
}

/* ========================================
   HIGH DPI SCREENS (Retina Display)
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #rsh-player-container {
        border-width: 0.5px;
    }
    
    .rsh-np-cover {
        border-width: 0.5px;
    }
}