/* ========================================
   Upload Dashboard Layout
   ======================================== */
.upload-page {
    max-width: 1100px;
    margin: 0 auto;
}

.upload-page h1 {
    font-family: var(--font-heading), sans-serif;
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

/* ========================================
   Progress Section
   ======================================== */
.progress-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-title {
    font-family: var(--font-heading), sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
}

.progress-count {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.progress-count strong {
    color: var(--color-primary);
}

.progress-bar-track {
    width: 100%;
    height: 14px;
    background: var(--color-border);
    border-radius: 7px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #555555);
    border-radius: 7px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-percentage {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* ========================================
   Card Grid
   ======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ========================================
   Document Card
   ======================================== */
.doc-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    box-shadow: var(--shadow-md);
}

.doc-card.status-uploaded {
    border-left-color: var(--color-accent);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--color-danger-light);
    color: var(--color-danger);
    transition: all var(--transition);
}

.doc-card.status-uploaded .card-icon-wrap {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.card-icon-wrap svg {
    width: 20px;
    height: 20px;
}

.card-title {
    font-family: var(--font-heading), sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

/* Card Status Badge */
.card-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-heading), sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.625rem;
    border-radius: 99px;
    margin-bottom: 0.875rem;
}

.card-status.missing {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.card-status.uploaded {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.drop-zone:hover {
    border-color: var(--color-primary);
    background: rgba(23, 23, 23, 0.03);
}

.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(23, 23, 23, 0.06);
    border-style: solid;
}

.drop-zone-icon {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.drop-zone-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.drop-zone-text strong {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
}

.drop-zone-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    opacity: 0.7;
}

/* File List inside Card */
.card-file-list {
    list-style: none;
    margin-top: 0.75rem;
}

.card-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
}

.card-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.card-file-info svg {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.card-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-file-size {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.card-file-remove {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 0.125rem;
    opacity: 0.6;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

.card-file-remove:hover {
    opacity: 1;
}

.card-file-remove svg {
    width: 16px;
    height: 16px;
}

/* Upload spinner overlay */
.card-uploading {
    position: relative;
}

.card-uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hidden file input */
.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   Upload Page Actions
   ======================================== */
.upload-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* ========================================
   Responsive Cards
   ======================================== */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .progress-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .upload-actions {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .upload-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
