/* ========================================
   02. DOCUMENT UPLOAD — CONFIGURATION
   ======================================== */

.gs-upload {
    --upload-blue: var(--primary-700, #006cff);
    --upload-border: var(--neutral-100, #dae5f2);
    --upload-muted: var(--neutral-600, #748499);
    --upload-duration: 8s;

    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;

    gap: 1cqw;
    padding: 1.5cqw;

    overflow: hidden;

    background: #eaf0f3;
    color: #0d1014;

    font-family: var(--navbar-font, Roboto, sans-serif);
    font-size: 1.35cqw;
    line-height: 1.4;

    pointer-events: none;
    user-select: none;
}

.gs-upload svg {
    display: block;

    flex-shrink: 0;

    width: 2cqw;
    height: 2cqw;
}


/* ========================================
   UPLOAD — APPLICATION HEADING
   ======================================== */

.gs-upload__title {
    flex-shrink: 0;

    margin: 0;

    font-size: 2.1cqw;
    font-weight: 700;

    color: var(--upload-blue);
}


/* ========================================
   UPLOAD — WORKSPACE
   ======================================== */

.gs-upload__workspace {
    position: relative;

    display: flex;
    flex-direction: column;

    flex: 1;
    min-height: 0;

    padding: 1.4cqw;

    border-radius: 0.9cqw;

    background: #ffffff;

    box-shadow:
        0 0.6cqw 2cqw rgba(30, 55, 85, 0.08);
}

.gs-upload__interface {
    display: flex;
    flex-direction: column;

    flex: 1;
    min-height: 0;

    gap: 1.2cqw;
}


/* ========================================
   UPLOAD — TOOLBAR
   ======================================== */

.gs-upload__toolbar {
    position: relative;

    display: flex;
    align-items: center;

    flex-shrink: 0;

    min-height: 4.8cqw;

    gap: 0.8cqw;
    padding: 0.7cqw 1cqw;

    border: 1px dashed var(--upload-blue);
    border-radius: 0.8cqw;

    background: #edf5ff;

    white-space: nowrap;
}

.gs-upload__toolbar > strong {
    font-size: 1.3cqw;
    font-weight: 600;
}

.gs-upload__cloud {
    color: var(--upload-blue);
}

.gs-upload__cloud svg {
    width: 2.5cqw;
    height: 2.5cqw;
}

.gs-upload__or {
    color: var(--upload-muted);
}

.gs-upload__choose {
    display: inline-flex;
    align-items: center;

    gap: 0.7cqw;
    padding: 0.65cqw 1cqw;

    border: 1px solid #7db4ff;
    border-radius: 0.5cqw;

    color: var(--upload-blue);

    font-size: 1.2cqw;
    font-weight: 600;
}

.gs-upload__choose > span {
    font-size: 1.7cqw;
    line-height: 1;
}

.gs-upload__formats {
    min-width: 0;

    margin-left: auto;
    overflow: hidden;

    color: var(--upload-muted);

    font-size: 1.05cqw;
    text-overflow: ellipsis;
}


/* ========================================
   UPLOAD — ACTION TOOLBAR
   ======================================== */

.gs-upload__actions {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    min-height: 3cqw;

    gap: 1.6cqw;
    padding: 0 0.6cqw;

    color: #3e90ff;
}

.gs-upload__action-disabled {
    opacity: 0.25;
}

.gs-upload__separator {
    width: 1px;
    height: 2cqw;

    background: var(--upload-border);
}


/* ========================================
   UPLOAD — NAVIGATION
   ======================================== */

.gs-upload__navigation {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    gap: 0.8cqw;

    min-height: 3cqw;
}

.gs-upload__breadcrumb {
    display: flex;
    align-items: center;

    flex: 1;
    min-width: 0;

    gap: 0.65cqw;
    overflow: hidden;

    color: var(--upload-muted);

    font-size: 1.15cqw;
    white-space: nowrap;
}

.gs-upload__breadcrumb svg {
    width: 1.65cqw;
    height: 1.65cqw;
}

.gs-upload__back {
    display: grid;
    place-items: center;

    width: 2.5cqw;
    height: 2.5cqw;

    border: 1px solid var(--upload-border);
    border-radius: 0.5cqw;
}

.gs-upload__search {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    width: 19%;
    height: 2.8cqw;

    gap: 0.6cqw;
    padding: 0 0.65cqw;

    border: 1px solid #bfcee3;
    border-radius: 0.5cqw;

    color: var(--upload-muted);

    font-size: 1.05cqw;
    white-space: nowrap;
}

.gs-upload__search svg {
    width: 1.4cqw;
    height: 1.4cqw;
}

.gs-upload__filter {
    display: grid;
    place-items: center;

    flex-shrink: 0;

    width: 2.8cqw;
    height: 2.8cqw;

    border-radius: 0.5cqw;

    background: #edf5ff;
    color: var(--upload-blue);
}

.gs-upload__filter svg {
    width: 1.6cqw;
    height: 1.6cqw;
}


/* ========================================
   UPLOAD — TABLE
   ======================================== */

.gs-upload__table-container {
    position: relative;

    flex: 1;
    min-height: 0;

    overflow: hidden;

    border: 1px solid var(--upload-border);
    border-radius: 0.6cqw;
}

.gs-upload__table {
    width: 100%;

    border-collapse: collapse;
    table-layout: fixed;

    font-size: 1.2cqw;
    text-align: left;
}

.gs-upload__table th,
.gs-upload__table td {
    overflow: hidden;

    padding: 0.75cqw 0.4cqw;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.gs-upload__table th {
    height: 3.8cqw;

    background: #edf1f7;

    font-size: 1.15cqw;
    font-weight: 700;

    border-bottom: 1px solid var(--upload-border);
}

.gs-upload__table td {
    height: 4.2cqw;

    border-bottom: 1px solid var(--upload-border);
}

.gs-upload__table th:first-child,
.gs-upload__table td:first-child {
    text-align: center;
}

.gs-upload__checkbox {
    display: inline-block;

    width: 1.55cqw;
    height: 1.55cqw;

    border: 1px solid #748499;
    border-radius: 0.3cqw;

    background: #ffffff;

    vertical-align: middle;
}

.gs-upload__row-actions {
    display: flex;
    align-items: center;

    gap: 0.4cqw;

    color: #3e90ff;
}

.gs-upload__row-actions svg {
    width: 1.25cqw;
    height: 1.25cqw;
}


/* ========================================
   UPLOAD — PDF FILE ICON
   ======================================== */

.gs-upload-pdf {
    display: inline-flex;

    flex-shrink: 0;

    width: 2.1cqw;
    height: 2.7cqw;

    vertical-align: middle;
}

.gs-upload-pdf svg {
    width: 100%;
    height: 100%;
}


/* ========================================
   UPLOAD — EMPTY FOLDER
   ======================================== */

.gs-upload__empty {
    position: absolute;

    inset: 3.8cqw 0 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 1cqw;

    color: var(--upload-muted);

    font-size: 1.5cqw;
}

.gs-upload__empty svg {
    width: 5cqw;
    height: 5cqw;

    color: #bfcee3;
}


/* ========================================
   UPLOAD — TABLE FOOTER
   ======================================== */

.gs-upload__footer {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-shrink: 0;

    min-height: 2.4cqw;

    color: var(--upload-muted);

    font-size: 1.1cqw;
}

.gs-upload__count-filled {
    position: absolute;

    left: 0;

    opacity: 0;
}

.gs-upload__pagination {
    margin-left: auto;

    padding: 0.35cqw 0.7cqw;

    border: 1px solid #bfcee3;
    border-radius: 0.35cqw;
}


/* ========================================
   UPLOAD — DRAG AND DROP OVERLAY
   ======================================== */

.gs-upload__overlay {
    position: absolute;
    z-index: 4;

    inset: 1.4cqw;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border: 0.25cqw dashed var(--upload-blue);
    border-radius: 0.9cqw;

    background: rgba(220, 235, 255, 0.85);

    backdrop-filter: blur(0.35cqw);
    -webkit-backdrop-filter: blur(0.35cqw);

    opacity: 0;
    visibility: hidden;
}

.gs-upload__overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 90%;

    gap: 1.6cqw;

    text-align: center;
}

.gs-upload__overlay-icon {
    display: grid;
    place-items: center;

    width: 7.5cqw;
    height: 7.5cqw;

    border-radius: 50%;

    background: #18a3ff;
    color: #ffffff;
}

.gs-upload__overlay-icon svg {
    width: 3.8cqw;
    height: 3.8cqw;
}

.gs-upload__overlay-title {
    font-size: 2.2cqw;
    font-weight: 700;

    color: #272e38;
}

.gs-upload__destination {
    display: flex;
    align-items: center;

    gap: 0.8cqw;
    padding: 1.3cqw 1.8cqw;

    border-left: 0.35cqw solid var(--upload-blue);
    border-radius: 0.7cqw;

    background: rgba(255, 255, 255, 0.85);

    box-shadow:
        0 0.4cqw 0.8cqw rgba(13, 30, 55, 0.09);

    font-size: 1.35cqw;
}

.gs-upload__destination svg,
.gs-upload__destination strong {
    color: var(--upload-blue);
}

.gs-upload__overlay-formats {
    max-width: 65%;

    margin: 0;

    font-size: 1.25cqw;
    line-height: 1.5;

    color: #424b57;
}


/* ========================================
   UPLOAD — DRAGGED FILE
   ======================================== */

.gs-upload__drag-file {
    position: absolute;
    z-index: 6;

    top: 0;
    left: 0;

    display: flex;
    align-items: center;

    gap: 0.7cqw;
    padding: 0.8cqw 1.2cqw;

    border: 1px solid #7db4ff;
    border-radius: 0.6cqw;

    background: #ffffff;
    color: #272e38;

    box-shadow:
        0 0.7cqw 2cqw rgba(13, 30, 55, 0.18);

    font-size: 1.4cqw;
    font-weight: 500;

    opacity: 0;
}

.gs-upload__drag-file .gs-upload-pdf {
    width: 3cqw;
    height: 3.8cqw;
}

.gs-upload__drag-file .gs-upload__cursor {
    position: absolute;

    right: -0.5cqw;
    bottom: -1.5cqw;

    width: 2.8cqw;
    height: 3.2cqw;
}


/* ========================================
   UPLOAD — UPLOAD SUMMARY
   ======================================== */

.gs-upload__summary {
    position: absolute;
    z-index: 3;

    top: 1.4cqw;
    right: 1.4cqw;
    left: 1.4cqw;

    display: flex;
    flex-direction: column;

    gap: 0.8cqw;
    padding: 1.2cqw;

    border: 1px solid #c2dbff;
    border-radius: 0.7cqw;

    background: #edf5ff;

    box-shadow:
        0 0.5cqw 1.4cqw rgba(13, 30, 55, 0.08);

    opacity: 0;
    visibility: hidden;
}

.gs-upload__summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1cqw;

    font-size: 1.4cqw;
}

.gs-upload__summary-header > span {
    color: #748499;

    font-size: 1.1cqw;
}

.gs-upload__summary-file {
    display: flex;
    align-items: center;

    gap: 0.9cqw;
    padding: 0.8cqw;

    border-radius: 0.5cqw;

    background: #ffffff;

    font-size: 1.2cqw;
}

.gs-upload__file-size {
    color: var(--upload-muted);
}

.gs-upload__progress-track {
    flex: 1;

    height: 0.6cqw;

    overflow: hidden;

    border-radius: 999px;
    background: #dae5f2;
}

.gs-upload__progress-fill {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;
    background: var(--upload-blue);
}

.gs-upload__upload-status {
    color: var(--upload-blue);

    font-size: 1.15cqw;
    font-weight: 600;
}


/* ========================================
   UPLOAD — DOCUMENT EXTRACTION
   ======================================== */

.gs-upload__document-row,
.gs-upload__extracted,
.gs-upload__number-extracted {
    opacity: 0;
}

.gs-upload__table td:nth-child(3) {
    position: relative;
}

.gs-upload__number-extracted {
    position: absolute;

    top: 50%;
    left: 0.4cqw;

    transform: translateY(-50%);
}

.gs-upload__quality {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 2.9cqw;
    height: 2.7cqw;

    overflow: hidden;

    border-radius: 0.65cqw;

    background: #f9e0e3;
    color: #ff2a3e;

    font-size: 0.95cqw;
    font-weight: 700;
}

.gs-upload__quality-high {
    position: absolute;

    opacity: 0;
}


/* ========================================
   UPLOAD — AI PROCESSING NOTIFICATION
   ======================================== */

.gs-upload__mining,
.gs-upload__success {
    position: absolute;
    z-index: 5;

    right: 3cqw;
    bottom: 5cqw;

    display: flex;
    align-items: center;

    gap: 1cqw;
    padding: 1.3cqw 1.6cqw;

    border: 1px solid #dae5f2;
    border-radius: 0.8cqw;

    background: #ffffff;

    box-shadow:
        0 0.7cqw 2.2cqw rgba(13, 30, 55, 0.12);

    opacity: 0;
    visibility: hidden;

    transform: translateY(1cqw);
}

.gs-upload__mining > div:last-child,
.gs-upload__success > div:last-child {
    display: flex;
    flex-direction: column;

    gap: 0.35cqw;
}

.gs-upload__mining strong,
.gs-upload__success strong {
    font-size: 1.45cqw;
    font-weight: 700;
}

.gs-upload__mining span,
.gs-upload__success span {
    color: var(--upload-muted);

    font-size: 1.15cqw;
}

.gs-upload__mining-spinner {
    width: 3.2cqw;
    height: 3.2cqw;

    border: 0.35cqw solid #dcebff;
    border-top-color: var(--upload-blue);
    border-radius: 50%;
}

.gs-upload__success {
    border-color: #ccebc6;
}

.gs-upload__success-icon {
    display: grid;
    place-items: center;

    width: 3.8cqw;
    height: 3.8cqw;

    border-radius: 50%;

    background: #e0f5dc;
    color: #117e00;
}

.gs-upload__success strong {
    color: #117e00;
}


/* ========================================
   UPLOAD — ANIMATION ACTIVATION
   ======================================== */

/* PDF enters the workspace */

.getting-laptop__view.is-active .gs-upload__drag-file {
    animation:
        gs-upload-drag var(--upload-duration) linear both;
}

/* Workspace becomes a dropzone */

.getting-laptop__view.is-active .gs-upload__overlay {
    animation:
        gs-upload-overlay var(--upload-duration) linear both;
}

/* Upload summary */

.getting-laptop__view.is-active .gs-upload__summary {
    animation:
        gs-upload-summary var(--upload-duration) linear both;
}

.getting-laptop__view.is-active .gs-upload__progress-fill {
    animation:
        gs-upload-progress 1.3s ease 2.4s both;
}

/* Document appears */

.getting-laptop__view.is-active .gs-upload__empty,
.getting-laptop__view.is-active .gs-upload__count-empty {
    animation:
        gs-upload-hide 0.2s ease 3.8s forwards;
}

.getting-laptop__view.is-active .gs-upload__document-row,
.getting-laptop__view.is-active .gs-upload__count-filled {
    animation:
        gs-upload-show 0.35s ease 3.8s forwards;
}

/* AI processing */

.getting-laptop__view.is-active .gs-upload__mining {
    animation:
        gs-upload-mining var(--upload-duration) linear both;
}

.getting-laptop__view.is-active .gs-upload__mining-spinner {
    animation:
        gs-upload-spin 0.7s linear 4.1s 4;
}

/* Extracted values */

.getting-laptop__view.is-active .gs-upload__extracted,
.getting-laptop__view.is-active .gs-upload__number-extracted,
.getting-laptop__view.is-active .gs-upload__quality-high {
    animation:
        gs-upload-show 0.4s ease 6.3s forwards;
}

.getting-laptop__view.is-active .gs-upload__number-initial,
.getting-laptop__view.is-active .gs-upload__quality-low {
    animation:
        gs-upload-hide 0.2s ease 6.3s forwards;
}

.getting-laptop__view.is-active .gs-upload__quality {
    animation:
        gs-upload-quality 0.4s ease 6.3s forwards;
}

/* Final success notification */

.getting-laptop__view.is-active .gs-upload__success {
    animation:
        gs-upload-notification 0.4s ease 6.8s both;
}


/* ========================================
   UPLOAD — KEYFRAMES
   ======================================== */

@keyframes gs-upload-drag {

    0%, 5% {
        opacity: 0;
        transform: translate(92cqw, 4cqw);
    }

    10% {
        opacity: 1;
        transform: translate(75cqw, 8cqw);
    }

    22%, 26% {
        opacity: 1;
        transform: translate(39cqw, 15cqw);
    }

    30%, 100% {
        opacity: 0;
        transform:
            translate(39cqw, 27cqw)
            scale(0.7);
    }

}

@keyframes gs-upload-overlay {

    0%, 8% {
        opacity: 0;
        visibility: hidden;
    }

    12%, 26% {
        opacity: 1;
        visibility: visible;
    }

    30%, 100% {
        opacity: 0;
        visibility: hidden;
    }

}

@keyframes gs-upload-summary {

    0%, 28% {
        opacity: 0;
        visibility: hidden;
    }

    32%, 46% {
        opacity: 1;
        visibility: visible;
    }

    49%, 100% {
        opacity: 0;
        visibility: hidden;
    }

}

@keyframes gs-upload-progress {

    from {
        width: 0;
    }

    to {
        width: 100%;
    }

}

@keyframes gs-upload-show {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}

@keyframes gs-upload-hide {

    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }

}

@keyframes gs-upload-mining {

    0%, 49% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(1cqw);
    }

    53%, 76% {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    80%, 100% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.5cqw);
    }

}

@keyframes gs-upload-spin {

    to {
        transform: rotate(360deg);
    }

}

@keyframes gs-upload-quality {

    from {
        background: #f9e0e3;
        color: #ff2a3e;
    }

    to {
        background: #e0f5dc;
        color: #117e00;
    }

}

@keyframes gs-upload-notification {

    from {
        opacity: 0;
        visibility: hidden;
        transform: translateY(1cqw);
    }

    to {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

}


/* ========================================
   UPLOAD — REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    .gs-upload *,
    .gs-upload *::before,
    .gs-upload *::after {
        animation: none !important;
        transition: none !important;
    }

    .gs-upload__drag-file,
    .gs-upload__overlay,
    .gs-upload__summary,
    .gs-upload__empty,
    .gs-upload__mining,
    .gs-upload__number-initial,
    .gs-upload__quality-low,
    .gs-upload__count-empty {
        opacity: 0;
        visibility: hidden;
    }

    .gs-upload__document-row,
    .gs-upload__extracted,
    .gs-upload__number-extracted,
    .gs-upload__quality-high,
    .gs-upload__count-filled,
    .gs-upload__success {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .gs-upload__number-extracted {
        transform: translateY(-50%);
    }

    .gs-upload__quality {
        background: #e0f5dc;
        color: #117e00;
    }

}
