/* ========================================
   03. DOCUMENT OVERVIEW — CONFIGURATION
   ======================================== */

.gs-documents {
    --documents-duration: 10s;
}


/* ========================================
   DOCUMENT OVERVIEW — TABLE ROWS
   ======================================== */

.gs-documents__row {
    background: #ffffff;
}

.gs-documents__row--extra {
    opacity: 0;
    visibility: collapse;
}

.gs-documents__quality {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.9cqw;
    height: 2.7cqw;
    border-radius: 0.65cqw;
    background: #e0f5dc;
    color: #117e00;
    font-size: 0.95cqw;
    font-weight: 700;
}

.gs-documents__more {
    display: grid;
    place-items: center;
    width: 1.8cqw;
    height: 2.4cqw;
    border-radius: 0.4cqw;
}


/* ========================================
   DOCUMENT OVERVIEW — SEARCH
   ======================================== */

.gs-documents__search {
    position: relative;
}

.gs-documents__search-content {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.gs-documents__search-placeholder {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gs-documents__search-value {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    clip-path: inset(0 100% 0 0);
    color: #272e38;
    font-size: 1.2cqw;
    white-space: nowrap;
}


/* ========================================
   DOCUMENT OVERVIEW — COUNTER
   ======================================== */

.gs-documents__counts {
    position: relative;
    flex: 1;
    min-height: 1.7cqw;
}

.gs-documents__counts > span {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
}

.gs-documents__count--all,
.gs-documents__count--filtered {
    opacity: 0;
    visibility: hidden;
}


/* ========================================
   DOCUMENT OVERVIEW — DROPDOWN MENU
   ======================================== */

.gs-documents__menu {
    position: absolute;
    z-index: 4;
    top: 19cqw;
    right: 2cqw;
    display: flex;
    flex-direction: column;
    width: 22cqw;
    padding: 0.4cqw 0;
    border: 1px solid #dae5f2;
    border-radius: 0.6cqw;
    background: #ffffff;
    box-shadow:
        0 0.7cqw 2cqw rgba(13, 30, 55, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5cqw);
}

.gs-documents__menu-item {
    display: flex;
    align-items: center;
    gap: 1cqw;
    padding: 1cqw 1.3cqw;
    color: #424b57;
    font-size: 1.35cqw;
    white-space: nowrap;
}

.gs-documents__menu-item svg {
    width: 1.8cqw;
    height: 1.8cqw;
    color: #3e90ff;
}


/* ========================================
   DOCUMENT OVERVIEW — CURSOR
   ======================================== */

.gs-documents .gs-documents__cursor {
    position: absolute;
    z-index: 6;
    top: 0;
    left: 0;
    width: 2.6cqw;
    height: 3cqw;
    filter: drop-shadow(
        0 0.25cqw 0.25cqw rgba(0, 0, 0, 0.15)
    );
    opacity: 0;
}


/* ========================================
   AUDIT LOG — MODAL BACKDROP
   ======================================== */

.gs-audit {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5cqw;
    background: rgba(13, 30, 55, 0.42);
    backdrop-filter: blur(0.35cqw);
    opacity: 0;
    visibility: hidden;
}


/* ========================================
   AUDIT LOG — MODAL WINDOW
   ======================================== */

.gs-audit__modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 100%;
    padding: 0;
    border: 1px solid var(--neutral-100);
    border-radius: 1.2cqw;
    background: #ffffff;
    box-shadow:
        0 0.5cqw 2cqw rgba(13, 30, 55, 0.08),
        0 2cqw 6cqw rgba(13, 30, 55, 0.18);
    overflow: hidden;
}


/* ========================================
   AUDIT LOG — HEADER
   ======================================== */

.gs-audit__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 2cqw;
    padding: 1.8cqw 2.4cqw;
    border-bottom: 1px solid var(--neutral-100);
    background: #ffffff;
}

.gs-audit__header h3 {
    margin: 0;
    color: var(--neutral-900);
    font-size: 2.3cqw;
    font-weight: 700;
    line-height: 1.3;
}

.gs-audit__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3cqw;
    padding: 0.5cqw 1.2cqw;
    border: 1px solid var(--neutral-200);
    border-radius: 0.6cqw;
    background: #ffffff;
    color: var(--neutral-700);
    font-size: 1.35cqw;
    font-weight: 500;
}


/* ========================================
   AUDIT LOG — BODY
   ======================================== */

.gs-audit__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1.8cqw 2.4cqw;
    overflow: hidden;
}


/* ========================================
   AUDIT LOG — DOCUMENT INFORMATION
   ======================================== */

.gs-audit__info {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    flex-shrink: 0;
    gap: 1.5cqw;
    padding: 1.6cqw 1.8cqw;
    border: 1px solid var(--primary-100);
    border-radius: 0.8cqw;
    background: var(--primary-50);
    color: var(--neutral-800);
    font-size: 1.4cqw;
    line-height: 1.5;
}

.gs-audit__info > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.4cqw;
    overflow-wrap: anywhere;
}

.gs-audit__info strong {
    color: var(--neutral-700);
    font-size: 1.2cqw;
    font-weight: 600;
}


/* ========================================
   AUDIT LOG — DISPLAY OPTION
   ======================================== */

.gs-audit__option {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.9cqw;
    margin-top: 1.8cqw;
    color: var(--neutral-700);
    font-size: 1.4cqw;
    line-height: 1.4;
}

.gs-audit__checkbox {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.7cqw;
    height: 1.7cqw;
    border-radius: 0.35cqw;
    background: var(--primary-700);
    color: #ffffff;
}

.gs-audit__checkbox svg {
    width: 1.2cqw;
    height: 1.2cqw;
    stroke-width: 2.5;
}


/* ========================================
   AUDIT LOG — DATE GROUP
   ======================================== */

.gs-audit__date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-top: 2cqw;
    padding: 1cqw 1.4cqw;
    border: 1px solid var(--neutral-100);
    border-bottom: 0;
    border-radius: 0.8cqw 0.8cqw 0 0;
    background: var(--neutral-50);
    color: var(--neutral-700);
    font-size: 1.4cqw;
    font-weight: 600;
}

.gs-audit__date > span:last-child {
    padding: 0.25cqw 0.7cqw;
    border-radius: 0.4cqw;
    background: #ffffff;
    color: var(--neutral-700);
    font-size: 1.2cqw;
    font-weight: 500;
}


/* ========================================
   AUDIT LOG — TABLE
   ======================================== */

.gs-audit__table {
    width: 100%;
    border: 1px solid var(--neutral-100);
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 1.4cqw;
    line-height: 1.45;
    text-align: left;
}

.gs-audit__table th {
    padding: 1cqw 0.9cqw;
    border-bottom: 1px solid var(--neutral-100);
    background: #f5f7fa;
    color: var(--neutral-700);
    font-size: 1.15cqw;
    font-weight: 600;
    letter-spacing: 0.015em;
}

.gs-audit__table td {
    position: relative;
    padding: 1.2cqw 0.9cqw;
    border-bottom: 1px solid var(--neutral-100);
    background: #ffffff;
    color: var(--neutral-700);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.gs-audit__table tbody tr:nth-child(even) td {
    background: #fafbfd;
}

.gs-audit__table td:nth-child(1),
.gs-audit__table td:nth-child(2) {
    font-weight: 500;
}

.gs-audit__table td:nth-child(3) {
    color: var(--neutral-900);
    font-weight: 600;
}

.gs-audit__table tbody tr:last-child td {
    border-bottom: 0;
}

.gs-audit__table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.8cqw;
}

.gs-audit__table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.8cqw;
}


/* ========================================
   AUDIT LOG — EVENT TIMELINE
   ======================================== */

.gs-audit__time {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1cqw;
    font-size: 1.3cqw;
    white-space: nowrap;
}

.gs-audit__table tbody td:first-child::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1.55cqw;
    width: 1px;
    background: var(--neutral-200);
}

.gs-audit__table tbody tr:first-child
td:first-child::before {
    top: 2.15cqw;
}

.gs-audit__table tbody tr:last-child
td:first-child::before {
    bottom: auto;
    height: 2.15cqw;
}

.gs-audit__dot {
    position: relative;
    flex-shrink: 0;
    width: 1.3cqw;
    height: 1.3cqw;
    border: 0.2cqw solid #ffffff;
    border-radius: 50%;
}

.gs-audit__dot--gray {
    background: var(--neutral-400);
    box-shadow: 0 0 0 0.2cqw var(--neutral-200);
}

.gs-audit__dot--blue {
    background: var(--primary-700);
    box-shadow: 0 0 0 0.2cqw var(--primary-100);
}

.gs-audit__dot--yellow {
    background: #ff9f00;
    box-shadow: 0 0 0 0.2cqw #fff1c2;
}

.gs-audit__dot--green {
    background: var(--success);
    box-shadow: 0 0 0 0.2cqw #e0f5dc;
}

.gs-audit__link {
    color: var(--primary-700);
    font-weight: 500;
}


/* ========================================
   AUDIT LOG — FOOTER
   ======================================== */

.gs-audit__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 1cqw;
    margin-top: 2.8cqw;
    padding: 1.6cqw 2.4cqw;
    border-top: 1px solid var(--neutral-100);
    background: #fafbfd;
}

.gs-audit__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.8cqw;
    padding: 0.8cqw 1.5cqw;
    border-radius: 0.8cqw;
    font-size: 1.35cqw;
    font-weight: 600;
    white-space: nowrap;
}

.gs-audit__button--secondary {
    border: 1px solid var(--primary-700);
    background: #ffffff;
    color: var(--primary-700);
}

.gs-audit__button--primary {
    border: 1px solid var(--primary-700);
    background: var(--primary-700);
    color: #ffffff;
}

/* ========================================
   DOCUMENT OVERVIEW — ANIMATIONS
   ======================================== */

/* New documents appear */

.getting-laptop__view.is-active
.gs-documents__row--extra {
    animation:
        gs-documents-row-in
        0.35s
        ease
        var(--row-delay)
        both,
        gs-documents-row-filter
        0.25s
        ease
        3.3s
        forwards;
}


/* Search field activation */

.getting-laptop__view.is-active
.gs-documents__search {
    animation:
        gs-documents-search-focus
        0.3s
        ease
        1.9s
        forwards;
}

.getting-laptop__view.is-active
.gs-documents__search-placeholder {
    animation:
        gs-upload-hide
        0.2s
        ease
        2.1s
        forwards;
}

.getting-laptop__view.is-active
.gs-documents__search-value {
    animation:
        gs-reg-typing
        0.9s
        steps(6, end)
        2.2s
        both;
}


/* Highlight the searched document */

.getting-laptop__view.is-active
.gs-documents__row--target {
    animation:
        gs-documents-highlight
        0.4s
        ease
        3.5s
        forwards;
}


/* Update document counter */

.getting-laptop__view.is-active
.gs-documents__count--initial {
    animation:
        gs-documents-count-initial
        var(--documents-duration)
        steps(1, end)
        both;
}

.getting-laptop__view.is-active
.gs-documents__count--all {
    animation:
        gs-documents-count-all
        var(--documents-duration)
        steps(1, end)
        both;
}

.getting-laptop__view.is-active
.gs-documents__count--filtered {
    animation:
        gs-documents-count-filtered
        var(--documents-duration)
        steps(1, end)
        both;
}


/* Move animated mouse cursor */

.getting-laptop__view.is-active
.gs-documents__cursor {
    animation:
        gs-documents-cursor
        var(--documents-duration)
        linear
        both;
}


/* Click the action menu */

.getting-laptop__view.is-active
.gs-documents__row--target .gs-documents__more {
    animation:
        gs-documents-more-click
        0.3s
        ease
        4.1s;
}


/* Open the dropdown */

.getting-laptop__view.is-active
.gs-documents__menu {
    animation:
        gs-documents-menu
        var(--documents-duration)
        linear
        both;
}


/* Select Audit log */

.getting-laptop__view.is-active
.gs-documents__menu-item--audit {
    animation:
        gs-documents-menu-select
        0.3s
        ease
        4.65s
        forwards;
}


/* Open and close audit log */

.getting-laptop__view.is-active
.gs-audit {
    animation:
        gs-documents-audit
        var(--documents-duration)
        linear
        both;
}


/* ========================================
   DOCUMENT OVERVIEW — KEYFRAMES
   ======================================== */

@keyframes gs-documents-row-in {
    from {
        opacity: 0;
        visibility: collapse;
    }
    to {
        opacity: 1;
        visibility: visible;
    }
}

@keyframes gs-documents-row-filter {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: collapse;
    }
}

@keyframes gs-documents-search-focus {
    to {
        border-color: #006cff;
        box-shadow:
            0 0 0 0.25cqw #dcebff;
    }
}

@keyframes gs-documents-highlight {
    to {
        background: #edf5ff;
    }
}

@keyframes gs-documents-count-initial {
    0% {
        opacity: 1;
        visibility: visible;
    }
    18%, 100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes gs-documents-count-all {
    0% {
        opacity: 0;
        visibility: hidden;
    }
    18% {
        opacity: 1;
        visibility: visible;
    }
    36%, 100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes gs-documents-count-filtered {
    0% {
        opacity: 0;
        visibility: hidden;
    }
    36%, 100% {
        opacity: 1;
        visibility: visible;
    }
}

@keyframes gs-documents-cursor {
    0%, 15% {
        opacity: 0;
        transform: translate(78cqw, 18cqw);
    }
    /* Search field */
    19%, 32% {
        opacity: 1;
        transform: translate(83cqw, 18.5cqw);
    }
    /* Move to document actions */
    40% {
        opacity: 1;
        transform: translate(95cqw, 27cqw);
    }
    /* Click on three dots */
    42% {
        opacity: 1;
        transform: translate(95cqw, 27cqw) scale(0.85);
    }
    44% {
        opacity: 1;
        transform: translate(95cqw, 27cqw);
    }
    /* Move to Audit log */
    48% {
        opacity: 1;
        transform: translate(87cqw, 37cqw);
    }
    /* Click on Audit log */
    50% {
        opacity: 1;
        transform: translate(87cqw, 37cqw) scale(0.85);
    }
    /* Hide cursor */
    53%, 100% {
        opacity: 0;
        transform: translate(87cqw, 37cqw);
    }
}

@keyframes gs-documents-more-click {
    50% {
        background: #c2dbff;
        transform: scale(0.9);
    }
}

@keyframes gs-documents-menu {
    0%, 41% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.5cqw);
    }
    44%, 49% {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    52%, 100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes gs-documents-menu-select {
    to {
        background: #edf5ff;
        color: #006cff;
    }
}

@keyframes gs-documents-audit {
    0%, 50% {
        opacity: 0;
        visibility: hidden;
    }
    54%, 92% {
        opacity: 1;
        visibility: visible;
    }
    97%, 100% {
        opacity: 0;
        visibility: hidden;
    }
}


/* ========================================
   DOCUMENT OVERVIEW — REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .gs-documents *,
    .gs-documents *::before,
    .gs-documents *::after {
        animation: none !important;
        transition: none !important;
    }
    .gs-documents__row--extra {
        opacity: 1;
        visibility: visible;
    }
    .gs-documents__count--initial,
    .gs-documents__count--filtered,
    .gs-documents__menu,
    .gs-documents__cursor {
        opacity: 0;
        visibility: hidden;
    }
    .gs-documents__count--all,
    .gs-audit {
        opacity: 1;
        visibility: visible;
    }
}
