/* ======================================================
   STATS HEADER & TITLE
====================================================== */
.stats-title {
    font-weight: var(--font-weight-heading);
    font-size: 1.15em;
    margin-bottom: 0.3em;
    margin-left: 0.2em;
}

/* ======================================================
   STATS TABLE
====================================================== */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0.7em;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    font-size: 1.03em;
    table-layout: fixed;
}

.stats-table th,
.stats-table td {
    padding: 0.41em 0.55em;
    text-align: left;
    font-family: var(--font);
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.stats-table th {
    color: var(--link-color);
    font-weight: var(--font-weight-heading);
    background: var(--secondary-bg);
    border-bottom: 1.5px solid var(--shadow);
    letter-spacing: 0.02em;
    font-size: 1.07em;
}

.stats-table td {
    color: var(--text-color);
    background: var(--card-bg);
    font-size: 0.99em;
    transition: background 0.12s;
}

.stats-table tr {
    border-bottom: 1px solid var(--shadow);
}

.stats-table tr:last-child {
    border-bottom: none;
}

.stats-table tr:nth-child(even) td {
    background: var(--secondary-bg);
}

.stats-table tr:hover td {
    background: var(--stats-table-hover-bg, #222c);
    color: var(--stats-table-hover-color, #f5faff);
}

.stats-table td:first-child {
    min-width: 145px;
    max-width: 210px;
    width: 30%;
    font-weight: var(--font-weight-heading);
}

.stats-table td:nth-child(2),
.stats-table th:nth-child(2) {
    width: 15%;
    text-align: right;
}

.stats-table td:nth-child(3),
.stats-table th:nth-child(3) {
    width: 18%;
    text-align: right;
}

.stats-table td:nth-child(4),
.stats-table th:nth-child(4) {
    width: 17%;
    text-align: right;
    min-width: 110px;
}

/* Error rows */
.gdrive-row-error td,
.gdrive-row-error {
    background: var(--stats-row-error-bg, #37242a) !important;
    color: var(--error, #ff4545) !important;
}

/* ======================================================
   STAT BAR
====================================================== */
.stat-bar-bg {
    background: var(--secondary-bg);
    border-radius: var(--border-radius-default);
    width: 80px;
    height: 11px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5em;
    position: relative;
    overflow: hidden;
}

.stat-bar-inner {
    background: var(--stat-bar-gradient, linear-gradient(90deg, var(--info, #339af0), #1565c0));
    height: 100%;
    border-radius: var(--border-radius-default);
}

.stat-bar-percent {
    color: var(--text-color);
    font-size: 0.97em;
    margin-left: 0.2em;
}

/* ======================================================
   FOLDER/NAME HIGHLIGHT
====================================================== */
.gdrive-name,
.result-folder {
    color: var(--link-color);
    font-weight: var(--font-weight-heading);
    font-size: 1.08em;
    font-family: var(--font);
}

/* ======================================================
   TABLE FOOTER
====================================================== */
.stats-footer {
    margin-top: 0.7em;
    font-size: 1.03em;
    font-weight: 500;
    color: var(--stats-footer-color, #c9d0d9);
}

/* ======================================================
   SEARCH TOGGLE ROW & LABELS
====================================================== */
.poster-search-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 1.1em;
    padding-left: 0.1em;
    color: var(--text-color);
}

.poster-search-label,
.poster-search-scope-label {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.25;
}

.poster-search-label {
    margin-right: 0.2em;
    min-width: 75px;
    text-align: right;
}

.poster-search-scope-label {
    margin-left: 0.2em;
    min-width: 115px;
    text-align: left;
}

.poster-search-toggle-row .toggle-switch {
    margin: 0 2px;
}

/* ======================================================
   POSTER SEARCH RESULTS LIST
====================================================== */
.poster-list {
    list-style: none;
    margin: 0 0 0.25em 0;
    padding: 0;
    background: none;
    border-radius: 0;
    border: none;
}

.poster-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.07em 0.2em 0.07em 1em;
    min-height: 1.7em;
    border-bottom: 1px solid var(--shadow);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    background: none;
    margin: 0;
    border-radius: 0;
    transition: background 0.15s;
    font-family: var(--font);
    font-weight: var(--font-weight-base);
}

.poster-list li:last-child {
    border-bottom: none;
}

.highlight {
    background: var(--highlight-bg, #ffeaa7);
    color: var(--highlight-color, #222);
    font-weight: 500;
    border-radius: 2px;
    padding: 0 2px;
}

.poster-list li.img-preview-link:hover {
    background: var(--poster-list-hover-bg, #222c);
    color: var(--poster-list-hover-color, #ffe06f);
}

.poster-file-label {
    flex: 1 1 auto;
    cursor: pointer;
    min-width: 0;
    word-break: break-all;
    font-size: var(--font-size-base);
    font-weight: 500;
}

/* ======================================================
   COPY BUTTON
====================================================== */
.copy-btn {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
    margin-left: 0.35em;
    color: var(--link-color);
    opacity: 0.73;
    vertical-align: middle;
    transition: color 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    padding: 0.1em 0.25em;
    border-radius: var(--border-radius-default);
    font-family: var(--font);
    font-weight: var(--font-weight-base);
}

.copy-btn:active {
    background: var(--copy-btn-active-background);
}

.copy-btn span {
    vertical-align: middle;
    line-height: 1.2;
    font-family: var(--font);
}

.copy-btn:hover {
    color: var(--copy-btn-hover-color, #ffe06f);
    opacity: 1;
}

.copy-btn-copied {
    color: var(--success, #5af176);
    display: none;
    align-items: center;
}

.copy-btn .material-icons {
    font-family: 'Material Icons', var(--font) !important;
    font-size: 1.18em !important;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    margin-right: 2px;
    opacity: 0.85;
    position: relative;
    top: 2px;
}

.copy-btn-default,
.copy-btn-copied {
    display: inline-flex;
    align-items: center;
}

/* ======================================================
   TOOLTIP (GDRIVE ETC)
====================================================== */
.gdrive-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.gdrive-tooltip-content {
    display: none;
    position: absolute;
    border-radius: var(--border-radius);
    left: 50%;
    top: 120%;
    transform: translateX(-50%);
    min-width: 240px;
    background: var(--gdrive-tooltip-bg, #232c3b);
    color: var(--gdrive-tooltip-color, #e6ecfa);
    padding: 0.82em 0.82em;
    border-radius: 7px;
    box-shadow: 0 6px 24px var(--gdrive-tooltip-shadow, #0006);
    font: var(--font);
    font-size: 0.99em;
    font-weight: 500;
    line-height: 1.4;
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.7, 1.5, 0.7, 1);
    white-space: normal;
}

.gdrive-tooltip-wrapper:hover .gdrive-tooltip-content,
.gdrive-tooltip-wrapper:focus-within .gdrive-tooltip-content {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.gdrive-name.gdrive-tooltip-red {
    color: var(--gdrive-tooltip-red, #e75b5b);
    cursor: help;
}

.gdrive-tooltip-content b {
    color: var(--gdrive-tooltip-highlight, #ffd166);
    font-weight: 700;
}

.gdrive-custom-badge {
    font-size: 0.89em;
    color: var(--link-color);
    margin-left: 0.3em;
    font-weight: 500;
    opacity: 0.95;
}

.gdrive-sort-row {
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 0.4em;
}

.gdrive-sort-label {
    color: var(--link-color);
    font-size: 1em;
    font-weight: 500;
}

.gdrive-sort-select {
    max-width: 240px;
}

/* ======================================================
   LOADER SPINNER
====================================================== */
/* === Terminal Loader Spinner === */
@keyframes blinkCursor {
    50% {
        border-right-color: transparent;
    }
}

@keyframes typeAndDelete {
    0%,
    10% {
        width: 0;
    }

    45%,
    85% {
        width: 11.5em;
    }

    90%,
    100% {
        width: 0;
    }
}

.poster-search-loader-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--overlay-bg);
    backdrop-filter: blur(1px);
    z-index: 12000;
    border-radius: var(--container-radius);
    min-height: 340px;
}

.terminal-loader {
    background: var(--terminal-bg);
    border: var(--terminal-border);
    color: var(--terminal-color);
    /* font-family: "Courier New", Courier, monospace; */
    font-size: 1em;
    padding: 1.5em 1.5em;
    width: 14em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.terminal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5em;
    background: var(--terminal-header-bg);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    padding: 0 0.4em;
    box-sizing: border-box;
}

.terminal-controls {
    float: right;
}

.control {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    margin-left: 0.4em;
    border-radius: 50%;
    background-color: #777;
}

.control.close {
    background-color: var(--terminal-control-close);
}

.control.minimize {
    background-color: var(--terminal-control-min);
}

.control.maximize {
    background-color: var(--terminal-control-max);
}

.terminal-title {
    float: left;
    line-height: 1.5em;
    color: var(--terminal-title-color);
}

.text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    color: var(--terminal-color);
    border-right: 0.2em solid var(--terminal-cursor-color);
    animation: typeAndDelete 4s steps(19) infinite, blinkCursor 0.5s step-end infinite alternate;
    margin-top: 1.5em;
}

/* ======================================================
   IMAGE PREVIEW MODAL
====================================================== */
#img-preview-modal {
    display: none;
    position: fixed;
    z-index: 12000;
    inset: 0;
    justify-content: center;
    align-items: center;
}

#img-preview-modal.show {
    display: flex;
}

.img-modal-bg {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
}

.img-modal-content {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    box-shadow: 0 8px 32px var(--shadow);
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.img-modal-close {
    position: absolute;
    right: 0.9em;
    top: 0.6em;
    font-size: 2em;
    background: none;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    z-index: 2;
}

.img-modal-img {
    max-width: 68vw;
    max-height: 62vh;
    margin-bottom: 1em;
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 12px var(--img-modal-shadow, #1117);
    background: var(--card-bg);
}

.img-modal-caption {
    color: var(--text-color);
    font-size: 1.02em;
    word-break: break-all;
    text-align: center;
    margin-top: 0.5em;
    opacity: 0.8;
}

/* ======================================================
   HOVER PREVIEW IMAGE
====================================================== */
.hover-preview {
    pointer-events: none;
    position: fixed;
    border: 1px solid var(--hover-preview-border, #444);
    background: var(--card-bg);
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius-default);
    z-index: 13000;
    display: none;
    box-shadow: 0 2px 14px var(--shadow);
    transition: left 0.13s cubic-bezier(0.3, 1.1, 0.6, 1), top 0.13s cubic-bezier(0.3, 1.1, 0.6, 1);
}

.poster-search-btn-row {
    margin: 1.5rem 0;
}

.poster-search-toggle-btn {
    margin-bottom: 0.8em;
}

.poster-search-spinner {
    display: none;
    text-align: center;
    margin-bottom: 1.3em;
}

.poster-search-results {
    margin-top: 1.5em;
}
