:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --critical: #ef4444;
    --high: #f97316;
    --medium: #eab308;
    --low: #22c55e;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.tv-header {
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.95);
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 200px;
    width: auto;
    object-fit: contain;
}

.clock {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
}

.tv-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.news-slide {
    width: 90%;
    max-width: 1400px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 4rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    position: absolute;
    display: none;
}

.news-slide.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.slide-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.badge {
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--critical);
    border: 1px solid var(--critical);
}

.badge.high {
    background: rgba(249, 115, 22, 0.2);
    color: var(--high);
    border: 1px solid var(--high);
}

.badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--medium);
    border: 1px solid var(--medium);
}

.badge.low {
    background: rgba(34, 197, 94, 0.2);
    color: var(--low);
    border: 1px solid var(--low);
}

.category-badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.slide-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.slide-summary {
    font-size: 2rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    border-left: 5px solid var(--accent);
    padding-left: 2rem;
}

.slide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2rem;
    color: #64748b;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 8px;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
}

.error-message {
    font-size: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Avatar Styles */
.avatar-container {
    position: absolute;
    bottom: 80px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.avatar-visual {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--accent), #1e293b);
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.avatar-face {
    width: 100%;
    height: 100%;
    position: relative;
}

.avatar-eyes {
    position: absolute;
    top: 40%;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 25px;
}

.eye {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: blink 4s infinite;
}

.avatar-mouth {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #fff;
    border-radius: 10px;
    transition: all 0.1s;
}

.avatar-container.speaking .avatar-mouth {
    animation: talk 0.3s infinite alternate;
    height: 15px;
    border-radius: 50%;
}

.avatar-container.speaking .avatar-visual {
    box-shadow: 0 0 50px var(--accent);
}

.avatar-container.muted .avatar-visual {
    filter: grayscale(100%);
    opacity: 0.5;
    box-shadow: none;
}

.avatar-container.muted .sound-wave {
    display: none;
}

.sound-wave {
    display: flex;
    gap: 5px;
    height: 40px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container.speaking .sound-wave {
    opacity: 1;
}

.bar {
    width: 6px;
    background: var(--accent);
    border-radius: 10px;
    animation: wave 0.5s infinite ease-in-out;
}

.bar:nth-child(1) {
    height: 20px;
    animation-delay: 0.1s;
}

.bar:nth-child(2) {
    height: 30px;
    animation-delay: 0.2s;
}

.bar:nth-child(3) {
    height: 40px;
    animation-delay: 0.3s;
}

.bar:nth-child(4) {
    height: 25px;
    animation-delay: 0.4s;
}

.bar:nth-child(5) {
    height: 15px;
    animation-delay: 0.5s;
}

@keyframes blink {

    0%,
    96%,
    100% {
        transform: scaleY(1);
    }

    98% {
        transform: scaleY(0.1);
    }
}

@keyframes talk {
    0% {
        height: 4px;
        width: 40px;
    }

    100% {
        height: 20px;
        white-space: nowrap;
    }
}

@keyframes pulse {
    50% {
        opacity: 0.5;
    }
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(2.5);
    }
}

.ai-status.processing {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
    animation: pulse 1s infinite;
}

.ai-status.done {
    background: rgba(34, 197, 94, 0.2);
    color: var(--low);
    border: 1px solid var(--low);
}

.ai-status {
    position: absolute;
    bottom: 140px;
    /* Acima do avatar (120px + margem) */
    right: 0;
    width: auto;
    min-width: 250px;
    text-align: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0;
    background: rgba(15, 23, 42, 0.9);
    /* Fundo mais sólido para leitura */
    z-index: 200;
}

.cache-stats {
    position: absolute;
    bottom: -60px;
    /* Bem abaixo do avatar */
    left: 50%;
    transform: translateX(-50%);
    /* Centralizar */
    width: max-content;
    min-width: 200px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    gap: 15px;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 200;
    /* Z-index alto */
}

/* Settings Modal */
.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

.settings-btn:hover {
    color: var(--text-primary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.settings-modal {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.btn-save {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #2563eb;
}