:root {
    /* --- TEMA DARK (Por defecto) --- */
    --bg-main: #05070a;
    --text-main: #e0e0e0;
    --text-title: #ffffff;
    --card-bg: rgba(10, 20, 30, 0.85);
    --card-border: rgba(0, 255, 0, 0.2);
    --matrix-green: #00ff00;
    --matrix-green-glow: rgba(0, 255, 0, 0.5);
    --input-bg: rgba(255, 255, 255, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.8);
    --modal-bg: #1a1d21;
    --modal-border: #2d3238;
}

[data-theme='light'] {
    /* --- TEMA LIGHT --- */
    --bg-main: #f8f9fa;
    --text-main: #212529;
    --text-title: #1a1d21;
    --card-bg: #ffffff;
    --card-border: rgba(0, 100, 0, 0.2);
    --matrix-green: #006400;
    /* Darker green for light mode */
    --matrix-green-glow: rgba(0, 100, 0, 0.2);
    --input-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --modal-border: #dee2e6;
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* --- CLASES ESPECÍFICAS --- */

.font-tech {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 50px var(--shadow-color);
    max-width: 800px;
    margin: 4rem auto;
    transition: all 0.3s ease;
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.form-control:focus {
    background: var(--input-bg);
    border-color: var(--matrix-green);
    color: var(--text-main);
    box-shadow: 0 0 10px var(--matrix-green-glow);
}

.section-title {
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green-glow);
}

[data-theme='light'] .section-title {
    text-shadow: none;
}

.description-text {
    color: var(--text-main);
}

.text-muted-themed {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme='light'] .text-muted-themed {
    color: #6c757d;
}

/* Placeholder fix for light mode */
.form-control::placeholder {
    color: var(--text-main);
    opacity: 0.5;
}

[data-theme='light'] .form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.btn-matrix {
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s;
}

.btn-matrix:hover {
    background: var(--matrix-green);
    color: var(--bg-main);
    box-shadow: 0 0 20px var(--matrix-green-glow);
}

/* --- SELECTOR DE TEMA --- */
.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(--matrix-green);
}

/* --- PROTECCIÓN DEL HEADER --- */
.navbar .container-fluid,
header .container-fluid,
nav .container-fluid {
    max-width: none !important;
    width: 100% !important;
}

[data-theme='light'] .content-wrapper .text-success,
[data-theme='light'] .content-wrapper .text-info {
    color: var(--matrix-green) !important;
}

[data-theme='light'] .content-wrapper .text-light {
    color: var(--text-main) !important;
}

[data-theme='light'] .content-wrapper .text-white-50 {
    color: #6c757d !important;
}