:root {
    /* --- TEMA DARK (Por defecto) --- */
    --bg-main: #0b1120;
    --text-main: #e0e0e0;
    --text-title: #ffffff;
    --text-muted: #a0a0a0;
    --card-bg: rgba(17, 25, 40, 0.75);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.5);
    --primary-red: #ff0000;
    --primary-red-glow: rgba(255, 0, 0, 0.5);
    --primary-red-hover: #cc0000;
    --section-bg: rgba(10, 15, 25, 0.95);
    --input-bg: #1a2332;
    --input-border: #2c3e50;
    --input-text: #e0e0e0;
    --placeholder-color: rgba(255, 255, 255, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.5);
}

[data-theme='light'] {
    /* --- TEMA LIGHT --- */
    --bg-main: #f8f9fa;
    --text-main: #212529;
    --text-title: #1a1d21;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --primary-red: #b91d1d;
    /* Un rojo un poco más oscuro y serio para light */
    --primary-red-glow: rgba(185, 29, 29, 0.2);
    --primary-red-hover: #991b1b;
    --section-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #212529;
    --placeholder-color: rgba(0, 0, 0, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- TITLES --- */
.video-title {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    color: var(--text-title);
}

[data-theme='dark'] .video-title {
    text-shadow: 0 0 10px var(--primary-red-glow);
}

.video-icon-red {
    color: var(--primary-red);
}

/* --- VIDEO CARD --- */
.video-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--primary-red-glow);
    border-color: var(--primary-red);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--card-border);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-body {
    padding: 1rem;
}

.video-desc {
    font-size: 0.95rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- FORM --- */
.add-section {
    background: var(--section-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px var(--shadow-color);
}

[data-theme='dark'] .add-section {
    border-color: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.15);
}

.form-control {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

.form-control::placeholder {
    color: var(--placeholder-color) !important;
}

.form-control:focus {
    border-color: var(--primary-red) !important;
    box-shadow: 0 0 0 0.25rem var(--primary-red-glow) !important;
}

.btn-youtube {
    background: linear-gradient(45deg, var(--primary-red), var(--primary-red-hover));
    color: white !important;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-youtube:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--primary-red-glow);
    color: white !important;
}

/* --- ALERT OVERRIDES --- */
[data-theme='light'] .alert.bg-success {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    border-color: #badbcc !important;
}

[data-theme='light'] .alert.bg-danger {
    background-color: #f8d7da !important;
    color: #842029 !important;
    border-color: #f5c2c7 !important;
}

[data-theme='light'] .alert.bg-warning {
    background-color: #fff3cd !important;
    color: #664d03 !important;
    border-color: #ffecb5 !important;
}

/* --- THEME TOGGLE --- */
.theme-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--primary-red);
}

/* --- MISC --- */
.welcome-banner {
    background: rgba(25, 135, 84, 0.15);
    border-left: 3px solid #198754;
    border-radius: 6px;
}

[data-theme='light'] .welcome-banner {
    background: #e9f7ef;
}

.text-muted-theme {
    color: var(--text-muted) !important;
}

.empty-state {
    color: var(--text-muted);
}