/* ========================================
   ESTILOS: mod-expediente.php
   ======================================== */

/* ====== RESET Y BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ====== CONTENEDOR PRINCIPAL ====== */
.contenedor {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ====== ENCABEZADO ====== */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.header img {
    max-width: 200px;
    margin-bottom: 15px;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.header p {
    color: #555;
    font-size: 1rem;
}

/* ====== BARRA DE NAVEGACIÓN ====== */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-bar span {
    color: #666;
    font-size: 0.9rem;
}

/* ====== INPUT DNI (PANTALLA INICIAL) ====== */
.dni-box {
    text-align: center;
    margin: 30px auto;
    max-width: 400px;
}

.dni-box label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.dni-box input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    border: 2px solid #3498db;
    border-radius: 8px;
    text-align: center;
    transition: 0.3s;
}

.dni-box input[type="text"]:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 8px rgba(52,152,219,0.4);
}

.dni-box button {
    margin-top: 15px;
    padding: 12px 30px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.dni-box button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.dni-box small {
    display: block;
    margin-top: 5px;
    color: #666;
}

/* ====== SECCIÓN DE CONSULTA ====== */
.seccion-consulta {
    margin: 20px auto;
    max-width: 500px;
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.seccion-consulta h3 {
    color: #856404;
    margin-bottom: 12px;
    font-size: 1rem;
}

.seccion-consulta form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.seccion-consulta input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.seccion-consulta button {
    padding: 10px 20px;
    background: #ffc107;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.seccion-consulta button:hover {
    background: #e0a800;
}

.seccion-consulta .nota-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.85rem;
}

/* ====== FORMULARIO DATOS PERSONALES ====== */
.form-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.form-datos .campo-full {
    grid-column: 1 / 3;
}

.form-datos label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
    font-size: 0.9rem;
}

.form-datos input,
.form-datos select,
.form-datos textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: 0.3s;
}

.form-datos input:focus,
.form-datos select:focus,
.form-datos textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52,152,219,0.3);
}

.form-datos textarea {
    resize: vertical;
    min-height: 80px;
}

.form-datos small {
    color: #e67e22;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ====== ESTADO ALUMNO ====== */
.estado-box {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.estado-box label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.estado-box select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* ====== BOTONES GENERALES ====== */
.btn-volver {
    background: #95a5a6;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-volver:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-volver-inicio {
    background: #e74c3c;
}

.btn-volver-inicio:hover {
    background: #c0392b;
}

.btn-guardar {
    padding: 12px 40px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-guardar:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* ====== SECCIÓN DE GESTIÓN ====== */
.seccion-gestion {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px solid #3498db;
}

.gestion-box {
    margin: 30px 0;
}

.gestion-box h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.botones-gestion {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.botones-gestion button {
    padding: 15px 10px;
    background: #16a085;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.botones-gestion button:hover {
    background: #1abc9c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.botones-gestion button.activo {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.3);
}

/* ====== SECCIÓN DE SUBIDA ====== */
.seccion-upload {
    margin-top: 20px;
}

.upload-box {
    background: #fafafa;
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    text-align: center;
}

.upload-box h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.upload-box .instrucciones {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    text-align: left;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.upload-box .instrucciones ol {
    margin-top: 8px;
    padding-left: 20px;
}

.upload-box input[type="file"] {
    margin: 15px 0;
    padding: 10px;
}

.upload-box button {
    padding: 12px 30px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.upload-box button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.upload-box button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ====== INFO DEL ARCHIVO SELECCIONADO ====== */
.file-info {
    display: none;
    margin: 10px 0;
    padding: 10px;
    background: #e8f4f8;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2c3e50;
    text-align: left;
}

/* ====== TEXTO INFORMATIVO PEQUEÑO ====== */
.upload-nota {
    font-size: 0.85rem;
    color: #666;
    margin: 5px 0;
}

/* ====== MENSAJES ====== */
.mensaje {
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
}

.mensaje.ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensaje.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ====== BARRA DE PROGRESO (Overlay) ====== */
.upload-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.upload-overlay.visible {
    display: flex;
}

.upload-progress-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.upload-progress-box h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.upload-progress-box .subtitulo {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container {
    background: #ecf0f1;
    border-radius: 25px;
    height: 28px;
    overflow: hidden;
    margin: 15px 0 10px;
    border: 1px solid #bdc3c7;
}

.progress-bar {
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    height: 100%;
    width: 0%;
    border-radius: 25px;
    transition: width 0.2s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255,255,255,0.2) 25%, transparent 25%,
        transparent 50%, rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%, transparent 75%, transparent
    );
    background-size: 30px 30px;
    animation: stripes 1s linear infinite;
}

@keyframes stripes {
    0%   { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.progress-percent {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 5px 0;
}

.progress-info {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 5px;
}

.progress-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

/* ====== CENTRADO DE BOTONES ====== */
.centrado {
    text-align: center;
    margin-top: 20px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .form-datos {
        grid-template-columns: 1fr;
    }
    .form-datos .campo-full {
        grid-column: 1;
    }
    .botones-gestion {
        grid-template-columns: 1fr 1fr;
    }
    .nav-bar {
        flex-direction: column;
        text-align: center;
    }
    .upload-progress-box {
        padding: 20px 25px;
    }
}

@media (max-width: 480px) {
    .botones-gestion {
        grid-template-columns: 1fr;
    }
    .contenedor {
        padding: 20px 15px;
    }
    .progress-percent {
        font-size: 1.2rem;
    }
}

/* ====== ESTILOS REEMPLAZO DE ARCHIVO ====== */
.reemplazo-info {
    margin-top: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #16a085;
    border-radius: 8px;
    text-align: center;
}

.reemplazo-info p {
    margin: 5px 0;
    color: #2c3e50;
    font-size: 0.95rem;
}

.reemplazo-info em {
    color: #16a085;
    font-weight: 600;
    word-break: break-all;
}

.btn-reemplazar {
    position: relative;
    background: #16a085;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 3px 8px rgba(22,160,133,0.3);
}

.btn-reemplazar:hover {
    background: #138d75;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(22,160,133,0.4);
}

.btn-reemplazar[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    width: 280px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-reemplazar[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #2c3e50;
    z-index: 100;
}

.reemplazo-box {
    background: linear-gradient(135deg, #e0f7f4 0%, #b2dfdb 100%);
    border: 2px solid #16a085;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
}

.reemplazo-box h3 {
    color: #00695c;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.reemplazo-box .info-reemplazo {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    border: 1px solid #b2dfdb;
}

.reemplazo-box .info-reemplazo p {
    margin: 5px 0;
    color: #2c3e50;
    font-size: 0.95rem;
}

.reemplazo-box .info-reemplazo strong {
    color: #00695c;
}

.reemplazo-box .info-reemplazo em {
    color: #16a085;
    font-weight: 600;
    word-break: break-all;
}

.reemplazo-box .instrucciones {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    text-align: left;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.reemplazo-box .instrucciones ul {
    margin-top: 8px;
    padding-left: 20px;
}

.reemplazo-box .instrucciones li {
    margin: 4px 0;
    color: #5d4037;
}

.reemplazo-box input[type="file"] {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    margin: 15px auto;
    display: block;
    border: 2px dashed #16a085;
    border-radius: 8px;
    background: #fff;
}

.reemplazo-box .file-info {
    display: none;
    margin: 10px auto;
    padding: 10px;
    background: #e8f5f3;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #00695c;
    text-align: left;
    max-width: 500px;
}

#btnReemplazarArchivo {
    background: #16a085;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(22,160,133,0.3);
}

#btnReemplazarArchivo:hover {
    background: #138d75;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(22,160,133,0.4);
}

#btnReemplazarArchivo:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.archivo-link {
    color: #16a085;
    text-decoration: none;
    font-weight: 600;
}

.archivo-link:hover {
    text-decoration: underline;
    color: #138d75;
}

.form-inline {
    margin: 0;
}

.header-img-small {
    max-width: 120px;
}

.mensaje-reemplazo {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #0d47a1;
    line-height: 1.5;
    text-align: left;
}

.mensaje-reemplazo strong {
    color: #0d47a1;
}

.reemplazo-info h3 {
    color: #00695c;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.reemplazo-info p {
    margin: 6px 0;
    color: #2c3e50;
    font-size: 0.95rem;
    text-align: left;
}
