/* Base and Variables */
:root {
    --bg-color: #19468E; /* Matches Dashboard */
    --text-main: #f0f2f5;
    --text-muted: #8b949e;
    --accent-color: #00e5ff;
    --accent-hover: #00b3cc;
    --secondary-bg: #161b22;
    --border-color: #30363d;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    transition: padding-bottom 0.4s ease;
}

body.player-bar-active {
    padding-bottom: 85px; /* Same height as the bar */
}

@media screen and (max-width: 600px) {
    body.player-bar-active {
        padding-bottom: 200px; /* Taller on mobile as bar stacks */
    }
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: var(--accent-hover);
}

/* Layout Structure */
.top-menu {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #19468E;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

@media screen and (max-width: 768px) {
    .top-menu {
        padding: 1rem 1rem;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
}

.logo {
    max-height: 50px;
    width: auto;
}

.admin-links a {
    margin-left: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.admin-links a:hover {
    color: var(--text-main);
}

/* Main wrapper: Optimized for all screens */
.site-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 2rem auto;
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 150px);
    padding: 0 1.5rem;
}

/* Corpo Principal - Sidebar */
.corpo-principal {
    width: 25%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 100px;
    height: fit-content;
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

/* Corpo Secundario - rest (80% minus gap) */
.corpo-secundario {
    flex: 1;
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
    background: transparent; /* No overlay here */
    border-radius: 0;
    overflow: hidden;
    position: relative;
    box-shadow: none; /* Shadow removed to prevent staircase effect */
    color: #ffffff;
    padding: 0 !important;
}

/* Site Footer */
.footer-site {
    background-color: var(--bg-color);
    padding: 2.5rem 2rem 2.5rem 2rem; /* Further reduced from 5rem to be very compact */
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    margin-top: 2rem;
}
.footer-content p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
}
@media screen and (max-width: 768px) {
    .footer-site {
        padding: 3rem 1.5rem 10rem 1.5rem;
    }
}

.ao-vivo-banner {
    padding: 1.5rem 0; /* Align with carousel padding */
}
.ao-vivo-banner img {
    width: 100%;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}
.ao-vivo-banner img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

/* Top 10 List */
.top10-container {
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 20px;
    padding: 2rem 1.5rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 1.5rem; /* Reduced from 2rem */
}
.top10-container h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.top10-list {
    list-style: none;
    margin-top: 1rem;
}
.song-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 6px;
}
.song-item:hover {
    background: rgba(25, 70, 142, 0.05);
}
.song-item .position {
    font-weight: 800;
    color: var(--accent-color);
    width: 30px;
    font-size: 1.1rem;
}
.song-item .title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}
.song-item .play-icon {
    opacity: 0;
    color: var(--accent-color);
    transition: opacity 0.3s ease;
}
.song-item:hover .play-icon {
    opacity: 1;
}

/* Main Carousel */
.carousel-container {
    width: 100% !important;
    aspect-ratio: 1080 / 491;
    position: relative;
    overflow: hidden;
    background: transparent;
    margin: 0 !important;
    padding: 1.5rem 0 1.5rem 0 !important; /* Unified 1.5rem gap top AND bottom */
    border-radius: 0 !important; 
}
.carousel-slide {
    position: absolute;
    top: 1.5rem; /* Gap at top */
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem; /* Gap at bottom to show background */
    width: auto;
    height: auto;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    display: block;
    border-radius: 20px; /* Rounded corners on the slide itself */
    overflow: hidden;
}
.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.carousel-slide img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover !important; 
    display: block;
}
.carousel-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #fff;
    background: rgba(255,255,255,0.05);
    font-size: 1.5rem;
}

/* Audio Player Bottom Bar */
.barra-player {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    height: 110px;
    background: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(15px);
    border-top: 2px solid var(--accent-color);
    padding: 0 2%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
}
.barra-player.show {
    bottom: 0;
}
body.player-bar-active {
    padding-bottom: 110px; /* Same height as the bar */
}
.player-info {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    max-width: 250px;
}
.now-playing-label {
    font-size: 0.7rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}
.player-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audio-controls {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    max-width: 850px;
    height: 80px;
}
.audio-controls iframe {
    background: transparent !important;
    border-radius: 50px;
    width: 100%;
}
.player-actions {
    flex: 0 0 auto;
}
.player-next {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255,255,255,0.1);
    flex: 0 0 auto;
}
.next-label {
    font-size: 0.7rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}
.next-program-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    padding: 6px 15px 6px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    text-decoration: none;
}
.next-program-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}
.next-program-item img {
    width: 80px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}
.next-program-info {
    display: flex;
    flex-direction: column;
}
.next-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.next-time {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 800;
}
.btn-estudio {
    background: var(--accent-color);
    color: #000 !important;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}
.btn-estudio:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 229, 255, 0.5);
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    transition: color 0.3s ease;
}
.close-btn:hover {
    color: #ff4757;
}

/* Ao Vivo Page */
.aovivo-page {
    padding: 3rem;
    text-align: center;
}
.live-stream-placeholder {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    aspect-ratio: 16/9;
    background: radial-gradient(circle, #0a0a0c 0%, #161b22 100%);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
}
.pulse-ring {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    animation: pulse 2s infinite;
    z-index: 0;
}
.live-stream-placeholder p {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 1.5rem;
    z-index: 1;
    margin-bottom: 2rem;
}
.live-stream-placeholder audio {
    z-index: 1;
}
@keyframes pulse {
    0% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 20px rgba(0, 229, 255, 0); }
    100% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

/* Dashboards Basic Forms */
.dashboard-container {
    width: 95%;
    max-width: 1200px;
    margin: 2rem auto;
    background: var(--secondary-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@media screen and (max-width: 768px) {
    .dashboard-container {
        width: 100%;
        margin: 1rem 0;
        padding: 1.5rem;
        border-radius: 0;
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

@media screen and (max-width: 600px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    .header-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.dashboard-container h1 {
    color: var(--accent-color);
    margin: 0;
    font-size: 2rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
}
.btn {
    padding: 0.8rem 1.5rem;
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.3s;
}
.btn:hover {
    background: var(--accent-hover);
}
.btn-danger {
    background: #ff4757;
    color: white;
}
.btn-danger:hover {
    background: #e04050;
}
.alert {
    padding: 1rem;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}
.admin-table th, .admin-table td {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

@media screen and (max-width: 850px) {
    .admin-table th, .admin-table td {
        padding: 1rem 0.5rem;
    }
}

.admin-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: rgba(0,0,0,0.1);
}

.table-thumb {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    aspect-ratio: 1/1; /* Thumbnail should be square or small */
}

@media screen and (max-width: 600px) {
    .table-thumb {
        width: 80px;
    }
}

.actions-cell {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.glass-module {
    background: rgba(255, 255, 255, 0.1); 
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}

/* Program Grid styles */
.programacao-section { 
    width: calc(100% - 3rem); 
    margin: 0 1.5rem 2rem 1.5rem;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.program-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    color: #333;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.program-header {
    background: #19468E;
    color: #fff;
    padding: 1rem;
}
.program-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}
.program-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}
.program-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(25, 70, 142, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}
.program-image-wrapper:hover .play-overlay { opacity: 1; }
.program-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.program-card .description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8) !important; /* White for better contrast */
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7rem;
    line-height: 1.35rem;
}
.program-card .schedule {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #ffffff !important; /* Full white */
    font-weight: 600;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.program-card .schedule i {
    color: var(--accent-color) !important; /* Keep icons cyan */
    margin-right: 5px;
}
.program-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.82) !important;
}

.program-description, 
.program-description * {
    color: rgba(255, 255, 255, 0.95) !important;
}
.program-meta {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #19468E;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* Mobile Responsiveness */
@media screen and (max-width: 1024px) {
    .site-wrapper {
        width: 100%;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    .corpo-principal {
        width: 30%;
        min-width: 250px;
    }
}

@media screen and (max-width: 850px) {
    .site-wrapper {
        flex-direction: column;
        padding: 0 0.5rem;
    }
    
    .corpo-principal {
        width: 100%;
        min-width: auto;
        order: 1;
        position: static;
        padding: 0 0.5rem;
    }
    
    .corpo-secundario {
        width: 100%;
        order: 2;
        padding: 0 0.5rem !important;
    }

    .program-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .program-grid {
        grid-template-columns: 1fr;
    }
    
    .top-menu {
        flex-direction: column;
        text-align: center;
    }

    .barra-player {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
        height: auto;
        bottom: -300px;
        align-items: center;
        text-align: center;
    }
    
    .barra-player.show {
        bottom: 0;
    }

    .player-info {
        max-width: 100%;
    }

    .audio-controls {
        width: 100%;
        justify-content: center;
    }

    .player-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .player-next {
        display: none;
    }

    .player-title {
        font-size: 1rem;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        margin: 0;
    }
    
    .carousel-container {
        aspect-ratio: 16 / 9;
    }
}

/* Visibility utilities */
.visible-xs { display: none; }
.hidden-xs { display: block; }
@media screen and (max-width: 768px) {
    .visible-xs { display: block; }
    .hidden-xs { display: none; }
}
