/* ============================================
   FILES/FILE.CSS — Single File Viewer Page
   ============================================ */

/* === BODY === */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Cabin Condensed', sans-serif;
    min-height: 100vh;
}

/* === READING PROGRESS BAR === */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 2000;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.1s ease;
}

/* === MAIN LAYOUT === */
.main-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    gap: 40px;
    align-items: start;
}

.article-wrapper {
    min-width: 0;
}

/* === BREADCRUMB === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 10px;
    color: var(--border);
}

/* === ARTICLE HEADER === */
.article-header {
    margin-bottom: 1.25rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--dark);
    letter-spacing: -0.02em;
}

/* === META ROW === */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 13px;
    color: var(--gray);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    color: var(--primary);
    font-size: 12px;
}

/* === TYPE BADGE === */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.type-pdf {
    background: #fee2e2;
    color: #dc2626;
}

.type-docx {
    background: #dbeafe;
    color: #1d4ed8;
}

.type-xlsx {
    background: #dcfce7;
    color: #16a34a;
}

/* === ACTION BAR === */
.action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.15s;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-order {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--secondary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-order:hover {
    background: #d97706;
}

/* === DESCRIPTION === */
.file-description {
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

/* === PDF VIEWER === */
.pdf-viewer-container {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 1.5rem;
}

.pdf-viewer-header {
    background: var(--dark);
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pdf-viewer-header i {
    color: var(--primary);
}

.viewer-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.viewer-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viewer-action-btn:hover {
    border-color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.12);
}

.viewer-action-btn.is-disabled,
.viewer-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.viewer-action-btn.is-success {
    border-color: #86efac;
    background: rgba(34, 197, 94, 0.2);
}

.pdf-iframe {
    width: 100%;
    height: 700px;
    border: none;
    display: block;
    background: #fff;
}

.pdf-fallback {
    padding: 2rem;
    text-align: center;
    background: var(--bg-soft);
}

.pdf-fallback p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* === SOCIAL SHARING === */
.social-sharing {
    display: flex;
    gap: 8px;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.social-sharing span {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-right: 4px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}

.social-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.social-btn.facebook {
    background: #3b5998;
}

.social-btn.twitter {
    background: #000;
}

.social-btn.linkedin {
    background: #0077b5;
}

.social-btn.whatsapp {
    background: #25D366;
}

/* === SIDEBAR === */
.sidebar {
    position: relative;
    min-height: 100vh;
}

.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.file-cta-card {
    border: 1px solid rgba(2, 179, 255, 0.45);
    background:
        radial-gradient(circle at 92% 12%, rgba(255, 123, 0, 0.20), transparent 32%),
        linear-gradient(160deg, rgba(2, 179, 255, 0.14), rgba(255, 123, 0, 0.10));
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(2, 179, 255, 0.22);
    position: relative;
    overflow: hidden;
}

.file-cta-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.file-cta-card h3 {
    margin: 0 0 6px;
    color: var(--dark);
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.file-cta-card p {
    margin: 0;
    color: var(--text);
    font-size: 0.79rem;
    line-height: 1.42;
}

.file-cta-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.file-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.15;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.file-cta-btn i {
    font-size: 0.8rem;
}

.file-cta-btn:hover {
    transform: translateY(-1px);
}

.file-cta-btn-primary {
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #fff;
    box-shadow: 0 8px 18px rgba(2, 179, 255, 0.3);
}

.file-cta-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.file-cta-btn-secondary {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(2, 179, 255, 0.3);
    color: var(--dark);
}

.file-cta-btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 6px 14px rgba(2, 179, 255, 0.18);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 24px;
    }

    .sidebar {
        height: auto;
    }

    .sidebar-stack {
        position: static !important;
        width: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .pdf-iframe {
        height: 500px;
    }

    .article-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .pdf-iframe {
        height: 380px;
    }

    .viewer-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .file-cta-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .file-cta-btn {
        font-size: 0.74rem;
        padding: 8px 8px;
    }
}
