/* ============================================
   verify.css - Estilos de la pagina de verificacion
   Diseno profesional y responsive
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --success-dark: #166534;
    --error: #dc2626;
    --error-light: #fef2f2;
    --error-dark: #991b1b;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* ============ WRAPPER ============ */
.verify-wrapper {
    width: 100%;
    max-width: 640px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 16px;
}

/* ============ HEADER ============ */
.verify-header {
    padding: 24px 0 16px;
}

.verify-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ============ CONTAINER ============ */
.verify-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

/* ============ STATE CARDS (loading, error, not found) ============ */
.state-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.state-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.state-desc {
    color: var(--text-light);
    font-size: 14px;
    max-width: 360px;
    line-height: 1.5;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-light);
    font-size: 15px;
}

/* State icons */
.state-icon {
    margin-bottom: 8px;
}

.state-icon.error-icon {
    color: var(--error);
}

.state-icon.success-icon {
    color: var(--success);
}

/* ============ SEARCH BOX ============ */
.search-box {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 400px;
    margin-top: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--primary);
}

.btn-search {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--primary-dark);
}

/* ============ STATUS BADGE ============ */
.status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-badge.valid {
    background: var(--success-light);
    color: var(--success-dark);
    border: 2px solid #bbf7d0;
}

.status-badge.revoked {
    background: var(--error-light);
    color: var(--error-dark);
    border: 2px solid #fecaca;
}

.badge-icon {
    font-size: 22px;
    line-height: 1;
}

/* ============ INFO CARDS ============ */
.info-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.card-header svg {
    color: var(--primary);
    flex-shrink: 0;
}

.card-body {
    padding: 4px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.info-value {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

.info-value.course-name {
    color: var(--primary);
    font-weight: 700;
}

.info-value.code-value {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Estado badges inline */
.estado-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado-badge.activo {
    background: var(--success-light);
    color: var(--success-dark);
}

.estado-badge.revocado {
    background: var(--error-light);
    color: var(--error-dark);
}

/* ============ DOWNLOAD SECTION ============ */
.download-section {
    text-align: center;
    padding: 8px 0;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============ PDF PROGRESS ============ */
.pdf-progress {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.pdf-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.pdf-progress-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

/* ============ SEARCH ANOTHER ============ */
.search-another {
    margin-top: 8px;
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-another p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.search-another .search-box {
    margin: 0 auto;
}

/* ============ FOOTER ============ */
.verify-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.verify-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    .verify-wrapper {
        padding: 0 12px;
    }

    .state-card {
        padding: 32px 20px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 16px;
    }

    .info-value {
        text-align: left;
    }

    .search-box {
        flex-direction: column;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .header-title {
        font-size: 17px;
    }

    .status-badge {
        font-size: 14px;
        padding: 12px 16px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .info-row {
        padding: 12px 18px;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .download-section,
    .search-another,
    .verify-footer,
    .pdf-progress {
        display: none !important;
    }
}
