/* =========================================
   src/main/resources/static/css/styles.css
   Estilo: EduTech Dark Cyan (SaaS Moderno)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta de colores EduTech */
    --bg-main: #0b0f19;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(0, 229, 255, 0.15);

    /* Acentos Cyan/Azul Neón */
    --neon-blue: #00e5ff;
    --neon-blue-hover: #00b3cc;
    --neon-glow: 0 0 15px rgba(0, 229, 255, 0.3);

    /* Estados */
    --status-active: #10b981; /* Verde esmeralda */
    --status-inactive: #ef4444; /* Rojo suave */

    /* Texto */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
}

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

body {
    font-family: 'Inter', sans-serif; /* Inter es más estándar para dashboards SaaS */
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at top right, #112230, #0b0f19 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Layout Principal --- */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    flex: 1; /* Permite que el footer baje */
    display: flex;
    flex-direction: column;
}

/* --- Navegación (Header) --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--neon-blue);
    font-size: 1.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

nav a:hover {
    color: var(--neon-blue);
}

nav a.active {
    color: var(--neon-blue);
    border-bottom: 2px solid var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    cursor: pointer;
    font: inherit;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 190px;
    background: #111827;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 20;
}

.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--neon-blue);
}

/* --- Contenedores (Cards) --- */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.glass-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-card h2 i {
    color: var(--neon-blue);
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid;
}

.alert p {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--status-active);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--status-inactive);
}

.compact-alert {
    justify-content: center;
    align-items: center;
}

/* --- Estadísticas --- */

.progress-container {
    width: 100%;
    background-color: rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
    height: 12px;
}
.progress-bar {
    height: 100%;
    background-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon-blue);
}

.stat-icon {
    font-size: 2rem;
    color: var(--neon-blue);
    background: rgba(0, 229, 255, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Formularios --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: start;
}

.form-grid-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.5);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--neon-blue);
    color: #000; /* Contraste fuerte */
    font-weight: 600;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--neon-glow);
}

.btn-primary:hover {
    background-color: var(--neon-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

.form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.actions-cell {
    white-space: nowrap;
}

.action-link {
    color: var(--text-secondary);
    margin-right: 0.75rem;
    text-decoration: none;
}

.btn-icon {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
}

.action-link.delete {
    color: var(--status-inactive);
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
}

.action-button:hover {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.program-name {
    font-weight: 500;
    color: #fff;
}

.program-id {
    color: var(--text-primary);
    font-weight: 600;
}

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

.table-empty {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.container-narrow {
    max-width: 860px;
    padding-top: 3rem;
}

.dashboard-narrow {
    max-width: 800px;
    margin: 0 auto;
}

.help-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.top-space {
    margin-top: 1rem;
}

.spaced-group {
    margin-bottom: 1.5rem;
}

.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.link-muted {
    color: var(--text-secondary);
    text-decoration: none;
}

.link-muted:hover {
    color: var(--neon-blue);
}

.course-highlight {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.course-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.course-head h3 {
    color: var(--neon-blue);
    margin: 0;
}

.course-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.progress-block {
    margin-top: 2rem;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-value {
    color: var(--neon-blue);
}

.config-card p {
    color: var(--text-secondary);
}

.distribution-card {
    margin-top: -0.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.status-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.status-item strong {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.summary-item {
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.summary-item strong {
    color: var(--text-primary);
}

.summary-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
}

.filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--neon-blue);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-inactive);
    text-decoration: none;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.filter-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ff6b6b;
}

.dark-modal {
    background: #111827;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.dark-modal .modal-header,
.dark-modal .modal-footer {
    border-color: rgba(255, 255, 255, 0.08);
}

.modal-note {
    color: var(--text-secondary);
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

/* --- Tablas --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

td {
    font-size: 0.95rem;
    color: var(--text-primary);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-active);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-inactive);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* --- Footer --- */
footer {
    width: 100%;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
/* --- Firma de Desarrolladora (Footer) --- */
.dev-signature {
    color: var(--neon-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    transition: all 0.3s ease;
    cursor: default;
}

.dev-signature:hover {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
}
/* --- Página de Error --- */
.error-container {
    text-align: center;
    margin-top: 10vh;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: var(--neon-glow);
    line-height: 1;
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .container {
        padding: 0 1.25rem;
    }

    header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    nav {
        width: 100%;
        order: 3;
    }

    nav ul {
        gap: 1rem;
        overflow-x: auto;
        padding-bottom: 0.4rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .glass-card {
        padding: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.8rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .stat-info p {
        font-size: 1.35rem;
    }

    th, td {
        padding: 0.75rem 0.55rem;
    }

    .course-highlight {
        padding: 1.25rem;
    }

    .course-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

