/*
 * Archive View — Dedicated Stylesheet
 * Client Portal · Documenti Archivio
 * Font: Plus Jakarta Sans · Helios flyout tokens
 */

/* ═══════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════ */

.docs-archive-view {
    padding: 32px 28px !important;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Header */
.docs-archive-view .archive-header {
    padding: 0 4px;
    margin-bottom: 24px;
    background: none;
    border: none;
    border-radius: 0;
}
.docs-archive-view .archive-header::before { display: none; }

.docs-archive-view .archive-tagline {
    font-size: 11px;
    font-weight: 600;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.docs-archive-view .archive-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0d0d0d;
    margin: 0 0 4px;
    letter-spacing: -0.03em;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .archive-subtitle {
    font-size: 14px;
    color: #737373;
    margin: 0;
}

/* Upload links data container — hidden, data only */
.docs-archive-view .upload-links-panel {
    display: none !important;
}

/* Card color tints by source */
.docs-archive-view .timeline-card.tc-studio {
    background: #f0f4ff;
}
.docs-archive-view .timeline-card.tc-studio:active { background: #e4eafc; }
.docs-archive-view .timeline-card.tc-studio .timeline-card-tagline { color: #6b7eff; }

.docs-archive-view .timeline-card.tc-client {
    background: #f0fdf4;
}
.docs-archive-view .timeline-card.tc-client:active { background: #dcfce7; }
.docs-archive-view .timeline-card.tc-client .timeline-card-tagline { color: #16a34a; }

.docs-archive-view .timeline-card.tc-pending {
    background: #fffbf0;
}
.docs-archive-view .timeline-card.tc-pending:active { background: #fef3dc; }
.docs-archive-view .timeline-card.tc-pending .timeline-card-tagline { color: #b45309; }

/* Expiry tags */
.tl-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 6px;
    vertical-align: 1px;
    letter-spacing: 0.01em;
    text-transform: none;
}
.tl-tag-expired {
    background: #fef2f2;
    color: #dc2626;
}
.tl-tag-urgent {
    background: #fff7ed;
    color: #c2410c;
}
.tl-tag-soon {
    background: #fffbeb;
    color: #a16207;
}

/* Primary action button (Carica) */
.docs-archive-view .tl-btn-primary {
    background: #0d0d0d;
    color: #fff;
    border: none;
}

.docs-archive-view .tl-btn-primary:active {
    opacity: 0.8;
    background: #0d0d0d;
}

/* ═══════════════════════════════════════════════
   FILTER CHIPS
   ═══════════════════════════════════════════════ */

.docs-archive-view .archive-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 0 4px;
    background: transparent;
    border: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.docs-archive-view .filter-chip {
    padding: 7px 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 100px;
    background: #fff;
    color: #737373;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .filter-chip i { display: none; }

.docs-archive-view .filter-chip.active {
    background: #0d0d0d;
    color: #fff;
    border-color: #0d0d0d;
}

/* ═══════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════ */

.docs-archive-view .archive-timeline {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 0 4px;
}

.docs-archive-view .timeline-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: av-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes av-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Period Label */
.docs-archive-view .timeline-period {
    font-size: 11px;
    font-weight: 700;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 2px 12px;
    background: none;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Items Grid — 2-col on desktop */
.docs-archive-view .timeline-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 640px) {
    .docs-archive-view .timeline-items {
        grid-template-columns: 1fr 1fr;
    }
}

/* Item */
.docs-archive-view .timeline-item {
    display: flex;
    cursor: pointer;
    animation: av-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Card — summary card aligned to the Helios flyout language */
.docs-archive-view .timeline-card {
    flex: 1;
    background: #f7f7f8;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: none;
    transition: background 0.12s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .timeline-item:active .timeline-card {
    background: #ededef;
}

/* Card content */
.docs-archive-view .timeline-card-tagline {
    font-size: 11px;
    font-weight: 600;
    color: #a3a3a3;
    margin-bottom: 4px;
    line-height: 1;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .timeline-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0d0d0d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    line-height: 1.4;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .timeline-desc {
    font-size: 12px;
    color: #737373;
    line-height: 1.4;
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action buttons */
.docs-archive-view .timeline-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.docs-archive-view .tl-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: #3b3d45;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background 0.12s ease;
}

.docs-archive-view .tl-btn:active {
    background: #f5f5f5;
}

.docs-archive-view .tl-btn-muted {
    color: #a3a3a3;
    border-color: transparent;
    background: transparent;
}

.docs-archive-view .tl-btn-muted:active {
    background: #f5f5f5;
}

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */

.docs-archive-view .archive-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 16px;
    background: #f7f7f8;
    border: none;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .ap-info {
    font-size: 13px;
    color: #737373;
    font-variant-numeric: tabular-nums;
}

.docs-archive-view .ap-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.docs-archive-view .ap-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #3b3d45;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background 0.12s ease;
}

.docs-archive-view .ap-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.docs-archive-view .ap-btn.active {
    background: #0d0d0d;
    color: #fff;
    font-weight: 700;
}

.docs-archive-view .ap-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
    font-size: 13px;
    color: #737373;
}

.docs-archive-view .ap-per-page select {
    height: 28px;
    padding: 0 24px 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #3b3d45;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23a3a3a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.docs-archive-view .ap-per-page select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 13, 13, 0.15);
}

@media (max-width: 600px) {
    .docs-archive-view .archive-pagination {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    .docs-archive-view .ap-per-page { justify-self: center; }
    .docs-archive-view .ap-info { text-align: center; }
}

/* ═══════════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════════ */

.docs-archive-view .archive-skeleton {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 4px;
}

@media (min-width: 640px) {
    .docs-archive-view .archive-skeleton {
        grid-template-columns: 1fr 1fr;
    }
}

.docs-archive-view .skel-period {
    width: 90px;
    height: 10px;
    border-radius: 5px;
    background: #e5e5e5;
    grid-column: 1 / -1;
    animation: av-skel 1.2s ease-in-out infinite;
}

.docs-archive-view .skel-card {
    background: #f7f7f8;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: av-skel 1.2s ease-in-out infinite;
}

.docs-archive-view .skel-line {
    height: 10px;
    border-radius: 5px;
    background: #e5e5e5;
}

.docs-archive-view .skel-w30 { width: 30%; }
.docs-archive-view .skel-w40 { width: 40%; }
.docs-archive-view .skel-w50 { width: 50%; }
.docs-archive-view .skel-w60 { width: 60%; }
.docs-archive-view .skel-w80 { width: 80%; }

@keyframes av-skel {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */

.docs-archive-view .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: #f7f7f8;
    border: none;
    border-radius: 10px;
}

.docs-archive-view .empty-state p {
    font-size: 14px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0 0 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.docs-archive-view .empty-state .empty-hint {
    font-size: 12px;
    color: #a3a3a3;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 767px) {
    .docs-archive-view {
        padding: 20px 16px !important;
    }
}
