:root {
    --primary-color: #d60000; /* Rojo del logo */
    --bg-dark: #000000;
    --bg-darker: #111111;
    --bg-card: #181818;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --transition-speed: 0.3s;
}

body.light-mode {
    --bg-dark: #f0f0f0;
    --bg-darker: #ffffff;
    --bg-card: #e8e8e8;
    --text-main: #111111;
    --text-muted: #555555;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    position: relative; /* Para el fondo animado */
    overflow-x: hidden;
}

/* Background animado muy llamativo con el logo */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    height: 70vw;
    max-width: 800px;
    max-height: 800px;
    background: url('images/logo.png') center/contain no-repeat;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: heartbeat-spin 10s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 30px var(--primary-color));
}

body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(214,0,0,0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s ease-in-out infinite alternate;
}

@keyframes heartbeat-spin {
    0% { 
        transform: translate(-50%, -50%) rotate(-8deg) scale(0.9); 
        filter: drop-shadow(0 0 10px var(--primary-color)) brightness(1); 
    }
    50% { 
        transform: translate(-50%, -50%) rotate(5deg) scale(1.15); 
        filter: drop-shadow(0 0 80px var(--primary-color)) brightness(1.8); 
    }
    100% { 
        transform: translate(-50%, -50%) rotate(-12deg) scale(1.05); 
        filter: drop-shadow(0 0 40px var(--primary-color)) brightness(1.3); 
    }
}

@keyframes pulse-glow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Navbar Superior */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--bg-darker);
    border-bottom: 2px solid var(--primary-color);
}

.logo-img {
    height: 90px;
    width: auto;
    transition: transform var(--transition-speed);
    filter: drop-shadow(0 0 10px rgba(214, 0, 0, 0.3));
}

.logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(214, 0, 0, 0.6));
}

.social-links a {
    color: var(--text-main);
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: color var(--transition-speed);
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 5%;
}

.content-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.news-section {
    flex: 1;
    min-width: 0;
}

/* Sidebar Ads */
.ads-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ad-widget {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.ad-widget:hover {
    transform: translateY(-5px);
}

.ad-label {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(214, 0, 0, 0.9); /* primary color */
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    border-bottom-left-radius: 4px;
    z-index: 2;
}

.ad-widget img {
    width: 100%;
    height: auto;
    display: block;
}

.sticky-ad {
    position: sticky;
    top: 2rem;
}

@media (max-width: 900px) {
    .content-layout {
        flex-direction: column;
    }
    .ads-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .ad-widget {
        width: 300px;
    }
    .sticky-ad {
        position: static;
    }
}

.section-title {
    margin-bottom: 3rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
}

.section-title h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 3rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
}

.yellow-highlight {
    color: var(--primary-color);
}

/* News Grid (Magazine Style) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}


.news-card {
    background: var(--bg-card);
    border: 1px solid #222;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition-speed);
}

.news-card:hover {
    border-color: var(--primary-color);
}

.news-img-container {
    overflow: hidden;
    position: relative;
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: grayscale(80%);
    transition: filter 0.5s, transform 0.5s;
}

.news-card:hover .news-image {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-date {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.news-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.news-title a:hover {
    color: var(--primary-color);
}

.news-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Header Radio Player */
.header-player {
    display: flex;
    flex: 1;
    max-width: 700px;
    margin: 0 2rem;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.player-info {
    display: flex;
    flex-direction: column;
}

.live-badge {
    color: var(--primary-color);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.station-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.now-playing {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    margin-top: 5px;
    line-height: 1.3;
}
.now-playing strong {
    color: var(--text-main);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: var(--primary-color);
    border: none;
    color: #000;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.control-btn:hover {
    transform: scale(1.1);
    background: #ffd000;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 60px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -3px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #333;
    border-radius: 2px;
}

.progress-bar-fake {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
}

.pulse-animation {
    animation: fill-infinite 5s linear infinite;
}

@keyframes fill-infinite {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Responsive adjustments */
@media (max-width: 850px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    .header-player {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}
@media (max-width: 600px) {
    .now-playing {
        display: none;
    }
    .volume-control {
        display: none;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    height: 85%;
    margin: auto;
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--primary-color);
}

.native-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-dark);
}

.native-content img {
    max-width: 100%;
    height: auto;
}

.close-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition-speed);
}

.close-btn:hover {
    background: #a00000;
}

#news-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    background: #fff; /* Al cargar sitios de terceros suele ser mejor fondo blanco */
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    background: var(--bg-card);
    color: var(--text-color);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    border-top: 1px solid #333;
}
