:root {
    /* Variables Modo Claro (Default) */
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --text-color: #333;
    --bg-gradient: radial-gradient(circle, rgba(238,242,243,1) 0%, rgba(220,229,235,1) 100%);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --card-text: #333;
    --muted-text: #6c757d;
}

body.dark-mode {
    /* Variables Modo Oscuro */
    --primary-color: #6ea8fe; /* Azul más claro para contraste */
    --secondary-color: #adb5bd;
    --text-color: #f8f9fa;
    --bg-gradient: radial-gradient(circle, #1a1a2e 0%, #16213e 100%);
    --glass-bg: rgba(22, 33, 62, 0.75); /* Azul oscuro translúcido */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --card-text: #f8f9fa;
    --muted-text: #ced4da;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #eef2f3;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #1a1a2e;
}

/* Fondo Matemático (Canvas) */
#math-canvas {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1; /* Detrás de todo */
    background: var(--bg-gradient);
    transition: background 0.5s ease;
}

.content-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-footer {
    margin-top: auto;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--card-text);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s, border 0.3s;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
}

/* Textos específicos */
.text-muted {
    color: var(--muted-text) !important;
}

/* Tipografía y Detalles */
.text-gradient {
    background: -webkit-linear-gradient(45deg, #003366, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .text-gradient {
    background: -webkit-linear-gradient(45deg, #6ea8fe, #9ec5fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0056b3, #003366);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
}

body.dark-mode .icon-wrapper {
    background: linear-gradient(135deg, #3d8bfd, #0d6efd);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.custom-list {
    list-style: none;
    padding: 0;
}

.custom-list li {
    padding: 8px 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.custom-list li i {
    color: #0056b3;
    margin-right: 10px;
}

body.dark-mode .custom-list li i {
    color: #6ea8fe;
}

.alert-custom {
    background: rgba(0, 86, 179, 0.1);
    border-left: 4px solid #0056b3;
    color: #003366;
    border-radius: 8px;
}

body.dark-mode .alert-custom {
    background: rgba(110, 168, 254, 0.1);
    border-left: 4px solid #6ea8fe;
    color: #e0e0e0;
}

/* Botones */
.btn-primary {
    background: linear-gradient(90deg, #003366 0%, #0056b3 100%);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #002244 0%, #004494 100%);
    transform: scale(1.05);
}

body.dark-mode .btn-primary {
    background: linear-gradient(90deg, #0d6efd 0%, #3d8bfd 100%);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

body.dark-mode .btn-primary:hover {
    background: linear-gradient(90deg, #0b5ed7 0%, #0a58ca 100%);
}

.pulse-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(0, 86, 179, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0); }
}

body.dark-mode .pulse-button {
    animation: pulse-dark 2s infinite;
}

@keyframes pulse-dark {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

/* Footer */
.glass-footer {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    color: #333;
}

body.dark-mode .glass-footer {
    background: rgba(22, 33, 62, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

/* Animaciones de Entrada */
.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botón Flotante Dark Mode */
.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 1.2rem;
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.1);
}
