/* =========================================
   1. CONFIGURACIÓN GENERAL Y RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0f2f5; /* Gris muy tenue de fondo */
    color: #4a4a4a;
    line-height: 1.6;
    /* Permite scroll si el contenido es largo */
    min-height: 100vh; 
}

/* Animaciones Generales */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}

/* =========================================
   2. ESTILOS DEL LOGIN (index.php)
   ========================================= */

/* Contenedor para centrar el login vertical y horizontalmente */
.login-container {
    width: 100%;
    min-height: 100vh; /* Ocupa toda la pantalla */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

.logo-wrapper {
    margin-bottom: 30px;
}

.logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.welcome-text h2 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
    letter-spacing: 1px;
}

.welcome-text p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 40px;
}

/* Input Animado (Floating Label) */
.input-group {
    position: relative;
    margin-bottom: 40px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 15px 0;
    font-size: 1.1rem;
    color: #333;
    border: none;
    border-bottom: 2px solid #ddd;
    outline: none;
    background: transparent;
    transition: border-color 0.3s;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 2px;
}

.input-group label {
    position: absolute;
    top: 15px;
    left: 0;
    font-size: 1rem;
    color: #999;
    pointer-events: none;
    transition: 0.3s ease all;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: -10px;
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
}

.input-group input:focus {
    border-bottom-color: #555;
}

/* Botón Login */
.btn-login {
    width: 100%;
    padding: 15px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(74, 74, 74, 0.2);
}

.btn-login:hover {
    background-color: #2c2c2c;
    box-shadow: 0 15px 25px rgba(74, 74, 74, 0.4);
    transform: translateY(-2px);
}

.footer-text {
    margin-top: 40px;
    font-size: 0.7rem;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* =========================================
   3. BARRA DE NAVEGACIÓN (Navbar)
   ========================================= */
.navbar {
    background-color: #ffffff;
    width: 100%;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 50px;
    width: auto;
}

.btn-logout {
    text-decoration: none;
    color: #4a4a4a;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 20px;
    border: 2px solid #4a4a4a;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: #4a4a4a;
    color: white;
}


/* =========================================
   4. ESTILOS DEL PERFIL (perfil.php)
   ========================================= */
.main-content {
    margin-top: 100px; /* Espacio para el navbar fijo */
    padding: 20px;
    display: flex;
    justify-content: center;
    padding-bottom: 60px;
}

.profile-card {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Cabecera limpia (Sin foto) */
.profile-header-clean {
    text-align: center;
    padding: 60px 30px 40px;
    background-color: #ffffff;
}

.institution-name {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
}

.profile-header-clean .user-name {
    font-size: 2.2rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

/* Insignia CURP */
.curp-badge {
    display: inline-block;
    background-color: #f0f2f5;
    color: #555;
    padding: 8px 20px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border: 1px solid #e1e1e1;
}

/* Sección de Especialidad */
.specialty-section {
    background-color: #4a4a4a;
    color: white;
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

/* Triángulo decorativo */
.specialty-section::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #4a4a4a;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 15px;
}

.specialty-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.specialty-period {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Área de botones de acción */
.action-area {
    padding: 40px;
    text-align: center;
    background: #fff;
}

.btn-view-titles {
    background-color: #fff;
    color: #4a4a4a;
    border: 2px solid #4a4a4a;
    padding: 15px 35px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.btn-view-titles:hover {
    background-color: #4a4a4a;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.profile-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.7rem;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #fff;
}


/* =========================================
   5. VENTANA MODAL (POP-UP)
   ========================================= */
.modal-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background-color: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    padding: 40px;
    position: relative;
    text-align: center;
}

.animate-zoom {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.btn-close:hover {
    color: #333;
}

.modal-logo {
    width: 60px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    color: #333;
    font-size: 1.5rem;
}

.modal-header p {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.titles-list {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.title-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.title-item:last-child {
    border-bottom: none;
}

.title-item:hover {
    background-color: #fafafa;
}

.title-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.title-info h4 {
    margin: 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.title-info span {
    font-size: 0.8rem;
    color: #888;
}

/* =========================================
   ESTILOS DEL DASHBOARD ADMIN
   ========================================= */

.dashboard-container {
    width: 100%;
    max-width: 1000px;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    font-family: 'Cinzel', serif;
    color: #333;
}

/* Botón Agregar */
.btn-add {
    background-color: #4a4a4a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: 0.3s;
}

.btn-add:hover {
    background-color: #222;
}

/* Tabla Elegante */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
}

.admin-table th {
    text-align: left;
    padding: 15px;
    background-color: #f9f9f9;
    color: #888;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.admin-table tr:hover {
    background-color: #fafafa;
}

/* Botones de Acción */
.btn-action {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 5px;
    transition: 0.2s;
}

.btn-edit {
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    font-size: 0.8rem;
}

.btn-edit:hover { background-color: #bbdefb; }

.btn-delete {
    color: #e53935;
    font-size: 1rem;
}

.btn-delete:hover { color: #b71c1c; transform: scale(1.1); }