/* ============================================================
   CLANWARE - ESTILOS CORPORATIVOS PREMIUM (SEGURIDAD + UI)
   Versión: 4.0 Final
   ============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e5e7eb;
    min-height: 100vh;
    
    /* CONFIGURACIÓN DE FONDO CON IMAGEN Y CAPA DE OSCURIDAD */
    background: 
        linear-gradient(rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.85)), 
        url('fondo-infraestructura2.png'); 
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* ================================
   LOGIN Y ACCESO (NUEVO)
================================ */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

.login-box h2 {
    color: #38bdf8;
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error-msg {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ================================
   CABECERA Y BOTÓN LOGOUT
================================ */
.admin-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.main-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.3));
}

.btn-logout {
    text-decoration: none;
    color: #f87171;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1.5px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    padding: 6px 14px;
    border-radius: 5px;
    transition: 0.3s;
}

.btn-logout:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
}

/* ================================
   FORMULARIO DE GESTIÓN
================================ */
.upload-form h3 {
    margin: 0 0 15px 0;
    color: #38bdf8;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.upload-form input, .upload-form select {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #94a3b8;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.upload-form button {
    background: #38bdf8;
    color: #020617;
    font-weight: bold;
    cursor: pointer;
    border: none;
    padding: 11px 25px;
    border-radius: 8px;
    transition: 0.3s;
}

.upload-form button:hover { 
    background: #7dd3fc;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* ================================
   GRID Y TARJETAS TÉCNICAS
================================ */
.ano {
    margin: 50px 0 25px 0;
    color: #38bdf8;
    font-size: 1.2rem;
    border-left: 4px solid #38bdf8;
    padding-left: 15px;
    text-transform: uppercase;
}

.lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 22px;
    list-style: none;
    padding: 0;
}

.pdf-item {
    position: relative;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    transition: 0.3s ease;
}

.pdf-item:hover {
    border-color: #38bdf8;
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.item-content { display: flex; align-items: stretch; }

.pdf-link {
    display: flex;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: #f1f5f9;
    flex: 1;
    overflow: hidden;
}

/* ZONA DE ACCIÓN IZQUIERDA */
.icon-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 65px;
    padding-right: 5px;
}

.icono-archivo { font-size: 2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }

.btn-descarga-new {
    text-decoration: none;
    font-size: 0.95rem;
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    opacity: 0.6;
    transition: 0.3s;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-descarga-new:hover {
    opacity: 1;
    background: rgba(56, 189, 248, 0.3);
    transform: scale(1.1);
}

/* DETALLES DE TEXTO */
.detalles {
    margin-left: 10px;
    border-left: 1px solid rgba(56, 189, 248, 0.2);
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.detalles .titulo { 
    font-weight: 600; 
    font-size: 0.95rem; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.detalles .meta { color: #94a3b8; font-size: 0.8rem; margin-top: 5px; }

/* ================================
   PREVIEW (HOVER)
================================ */
.preview {
    opacity: 0; visibility: hidden; position: absolute; bottom: calc(100% + 15px); left: 50%;
    transform: translateX(-50%) translateY(10px); width: 450px; height: 310px;
    background: #0f172a; border: 2px solid #38bdf8; border-radius: 12px; padding: 8px;
    z-index: 1000; pointer-events: none; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.pdf-item:hover .preview { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.preview iframe, .preview img { width: 100%; height: 100%; border-radius: 6px; background: white; border: none; }

.no-preview {
    height: 100%; display: flex; flex-direction: column; justify-content: center; 
    align-items: center; text-align: center; color: #64748b;
}

/* ================================
   FOOTER
================================ */
.pie-pagina {
    margin-top: 100px;
    padding: 35px 0;
    border-top: 1px solid rgba(56, 189, 248, 0.15);
}

.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-info p { margin: 0; font-size: 0.95rem; color: #94a3b8; }
.footer-info strong { color: #38bdf8; }
.footer-tag { color: rgba(148, 163, 184, 0.4); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 3px; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .header-flex { flex-direction: column-reverse; }
    .header-right { align-items: center; width: 100%; }
    .form-row { flex-direction: column; width: 100%; }
    .lista { grid-template-columns: 1fr; }
    .preview { display: none !important; }
    .footer-content { flex-direction: column; gap: 20px; }
}