/* ============================================================
   Módulo: Documentos Institucionales — Ted.Student
   Modal de aceptación + sección Mis Documentos en perfil
   ============================================================ */

/* ── Modal container ── */
#documentModal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 16px 56px rgba(10,60,100,.2), 0 4px 16px rgba(0,0,0,.1);
    overflow: hidden;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

/* ── Header institucional ── */
#documentModal .doc-modal-header {
    background: linear-gradient(150deg, #0a3c64 0%, #0d4f87 100%);
    padding: 20px 24px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
#documentModal .doc-modal-header::before {
    content: '';
    position: absolute;
    top: -30px; right: -20px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 65%);
    pointer-events: none;
}
#documentModal .doc-modal-header .doc-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    position: relative;
}
#documentModal .doc-modal-header .doc-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    position: relative;
    line-height: 1.3;
}
#documentModal .doc-modal-header .doc-version {
    font-size: .75rem;
    opacity: .7;
    position: relative;
}

/* Contador de documentos pendientes */
.doc-pending-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .7rem;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    margin-top: 8px;
    position: relative;
}
.doc-pending-count::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulse-badge 1.8s infinite;
    flex-shrink: 0;
}

/* ── Cuerpo: área de lectura con scroll ── */
#documentModal .doc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 0;
}

/* Overlay degradado al fondo para indicar que hay más contenido */
#documentModal .doc-scroll-wrapper {
    position: relative;
}
#documentModal .doc-scroll-wrapper::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 32px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
    margin-top: -32px;
}

/* Contenido del documento */
#documentModal .doc-content {
    font-size: .88rem;
    color: #2d3748;
    line-height: 1.7;
}
#documentModal .doc-content h4 {
    font-size: .92rem;
    font-weight: 700;
    color: #0a3c64;
    margin: 18px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e8eef5;
}
#documentModal .doc-content p { margin-bottom: 10px; text-align: justify; hyphens: auto; }
#documentModal .doc-content ol,
#documentModal .doc-content ul {
    padding-left: 22px;
    margin-bottom: 10px;
}
#documentModal .doc-content li { margin-bottom: 5px; text-align: justify; hyphens: auto; }
#documentModal .doc-content strong { color: #1a2a3a; }

/* ── Footer: checkbox + botón ── */
#documentModal .doc-modal-footer {
    padding: 14px 24px 20px;
    border-top: 1px solid #e8eef5;
    background: #f7fafc;
    flex-shrink: 0;
}
#documentModal .doc-accept-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}
#documentModal .doc-accept-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: #0a3c64;
    margin-top: 2px;
    cursor: pointer;
}
#documentModal .doc-accept-check .check-label {
    font-size: .82rem;
    color: #4a5568;
    line-height: 1.4;
}
#documentModal .doc-accept-check .check-label strong {
    color: #0a3c64;
}
#documentModal .btn-doc-accept {
    width: 100%;
    background: #0a3c64;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#documentModal .btn-doc-accept:hover:not(:disabled) {
    background: #0d4f87;
    transform: translateY(-1px);
}
#documentModal .btn-doc-accept:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}
#documentModal .btn-doc-accept.loading {
    pointer-events: none;
}

/* ── Pantalla de confirmación ── */
.doc-accepted-screen {
    text-align: center;
    padding: 40px 24px;
}
.doc-accepted-screen .accepted-icon {
    font-size: 3.5rem;
    margin-bottom: 14px;
    display: block;
    animation: popIn .45s cubic-bezier(.34,1.56,.64,1);
}
.doc-accepted-screen h5 {
    font-weight: 700;
    color: #0a3c64;
    margin-bottom: 6px;
}
.doc-accepted-screen p { color: #718096; font-size: .88rem; }

/* ── Mis Documentos — tarjetas en perfil ── */
.doc-card {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .2s, border-color .2s;
}
.doc-card:hover {
    box-shadow: 0 4px 20px rgba(10,60,100,.08);
    border-color: #c0d4e8;
}
.doc-card .doc-icon {
    width: 44px; height: 44px;
    min-width: 44px;
    background: #eef4fb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #0a3c64;
}
.doc-card .doc-info { flex: 1; min-width: 0; }
.doc-card .doc-info .doc-name {
    font-size: .92rem;
    font-weight: 600;
    color: #1a2a3a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-card .doc-info .doc-meta {
    font-size: .75rem;
    color: #a0aec0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.doc-card .doc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.doc-status-badge.accepted {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.doc-status-badge.pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.doc-card .btn-doc-download {
    background: none;
    border: 1px solid #c0d4e8;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .78rem;
    color: #0a3c64;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background .18s, border-color .18s;
    white-space: nowrap;
    flex-shrink: 0;
}
.doc-card .btn-doc-download:hover {
    background: #eef4fb;
    border-color: #0a3c64;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .6; transform: scale(1.3); }
}
