@font-face {
    font-family: 'Google Sans';
    src: url('../Google-Sans.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
}

* {
    font-family: 'Google Sans', sans-serif !important;
    font-variation-settings: 'wght' 500;
}

b, strong {
    font-variation-settings: 'wght' 700;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
    border: 2px solid #2a2a2a;
}

@media (hover: hover) and (pointer: fine) {
    ::-webkit-scrollbar-thumb:hover {
        background: #777;
    }
    #menu-toggle:hover {
        background: rgba(66, 66, 66, 0.9);
    }
    #menu-close:hover {
        color: #fff;
    }
    .data-controls button:hover {
        background-color: #f3a7bd;
    }
    .data-controls button#import-button:hover {
        background-color: #4a4a4a;
    }
    .data-controls button#export-button:hover {
        background-color: #1a1a1a;
    }
    .data-controls button#reset-history-button:hover {
        background-color: #a1374d;
    }
    .tab-button:hover {
        background-color: #333;
        color: #fff;
    }
    #card-container:hover {
        border-color: #3d3d3d;
    }
    #search-button:hover {
        background-color:  #f3a7bd;
    }
    #search-options-button:hover {
        background-color: #3a3a3a;
    }
    #search-options-modal #search-options-modal-close:hover {
        color: #fff;
    }
    .history-item:hover {
        background-color: #3a3a3a;
        color: #fff;
    }
    .results-list a:hover {
        color: #fff;
        filter: brightness(1.3);
    }
    .results-list a:hover .result-date {
        color: #ccc;
    }
    .results-list a:hover .result-icon {
        color: #ccc;
    }
    .result-text-content.has-tooltip-preview:hover .result-title {
        color: #ea7d9c;
    }
    .pagination-button:hover:not(:disabled):not(.active) {
        background-color: #555;
    }
    .search-result-favorite-button:hover {
        color: #ccc;
    }
    .search-result-favorite-button.is-favorite:hover {
        color: #f3a7bd;
    }
    .prompt-button:hover {
        background-color: #ea7d9c1f;
    }

    #favorite-button:hover {
        color: #fff;
    }
    #favorite-button.is-favorite:hover {
        color: #f3a7bd;
    }
    #favorites-grid::-webkit-scrollbar-thumb:hover {
        background: #f3a7bd;
    }
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    z-index: 90;
    box-sizing: border-box;
}

#menu-toggle {
    position: relative;
    top: auto;
    left: auto;
    z-index: auto;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    background: transparent;
    color: #f1f1f1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: background-color 0.2s;
}

#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

#menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 300px;
    max-width: 80%;
    background-color: #1e1e1e;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

#menu-panel.active {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.menu-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

#menu-close {
    background: none;
    border: none;
    color: #888;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 10px;
}

.menu-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.data-controls p {
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 20px;
}

.data-controls button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: #fff;
    background-color: #EA7D9C;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.data-controls button#import-button {
    background-color: #3a3a3a;
    border: 1px solid #555;
}

.data-controls button#export-button {
    background-color: #000000;
    border: 1px solid #555;
}

.data-controls button#reset-history-button {
    background-color: #7d2a3b;
    border: 1px solid #9c4458;
}

.app-container {
    display: grid;
    grid-template-rows: 1fr;
    width: 100%;
    height: 100%;
    padding: 80px 20px 20px 20px;
    box-sizing: border-box;
    justify-items: center;
}

.tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.tab-button {
    padding: 10px 25px;
    font-size: 1rem;
    font-variation-settings: 'wght' 700;
    color: #aaa;
    background-color: transparent;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tab-button.active {
    background-color: #EA7D9C;
    color: #000000;
    font-variation-settings: 'wght' 700;
}

.tab-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    opacity: 0;
    transform: scale(0.97);
    transition: transform 0.50s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    grid-area: 1 / 1;
    visibility: hidden;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
}

.tab-content.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    visibility: visible;
    z-index: 2;
}

#explorer-content {
    box-sizing: border-box;
}

.placeholder-content {
    text-align: center;
    color: #888;
}

header {
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    color: #ffffff;
}

header p#progress-counter {
    margin-top: 5px;
    color: #888;
    font-size: 1rem;
}

.card-wrapper {
    flex-grow: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#card-container {
    width: auto;
    min-width: 27vw;
    max-width: 85vw;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 13px 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s, border-color 0.2s, opacity 0.2s ease-out;
    cursor: pointer;
    height: 100%;
    max-height: 85vh;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}

#card-container.layering-out {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#card-container:has(.single-image-card) {
    min-width: 20vw;
    max-width: 30vw;
}

#card-container:has(.two-image-card) {
    min-width: 30vw;
    max-width: 40vw;
}

.album-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.album-card h2 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    padding-bottom: 2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.image-grid {
    flex-grow: 1;
    display: grid;
    gap: 10px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background-color: #111;
    min-width: 0;
    min-height: 0;
}

.image-grid img.image-load-error {
    object-fit: scale-down;
    padding: 15%;
    box-sizing: border-box;
    opacity: 0.5;
}

.image-grid .span-last-item:last-child {
    grid-column: 1 / 3;
}

.status-message {
    font-size: 1.5rem;
    color: #777;
}

.explorer-footer {
    width: 100%;
    padding: 20px 0 15px 0px;
    flex-shrink: 0;
}

.navigation {
    width: 100%;
    position: relative;
    max-width: 70vw;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.nav-center-group {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}

#prev-button {
    padding: 13px 28px;
    font-size: 1.2rem;
    color: #b3b3b3;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
}

#prev-button:active {
    transform: scale(0.975);
}

#prev-button:disabled {
    background-color: #161616;
    border: none;
    color: #555;
    cursor: default;
    transform: scale(1);
    box-shadow: none;
    opacity: 0.6;
}

#prev-button,
#next-button {
    width: 210px;
    box-sizing: border-box;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

#prev-button .nav-icon {
    margin-left: -8px;
}

#next-button .nav-icon {
    margin-right: -8px;
}

#next-button {
    padding: 13px 28px;
    font-size: 1.2rem;
    color: #EA7D9C;
    background-color: #ea7d9c14;
    border: 1px solid #ea7d9c33;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
}

#next-button:active {
    transform: scale(0.975);
}

#next-button:disabled {
    background-color: #ea7d9c08;
    border: none;
    color: #ea7d9c87;
    cursor: default;
    transform: scale(1);
    box-shadow: none;
    opacity: 0.6;
}

.nav-overlay {
    position: fixed;
    top: 60px;
    bottom: 0;
    width: 0;
    max-width: 100px;
    z-index: 85;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}

.nav-overlay:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.2)
}

.nav-overlay svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

#nav-overlay-left { left: 0; }
#nav-overlay-right { right: 0; }

.nav-overlay.hidden-tab,
.nav-overlay.disabled {
    display: none !important;
    pointer-events: none;
}

.swipe-hint {
    display: none;
}

.search-panel {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
    min-width: 90vw;
}

.search-controls-container {
    width: 100%;
    margin-bottom: 0; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.search-bar-container {
    position: relative;
    width: 35rem;
}

#search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    font-size: 1.1rem;
    color: #e0e0e0;
    background-color: #2a2a2a;
    border: 3px solid transparent;
    border-radius: 50px;
    box-sizing: border-box;
    outline: 1px solid #444444;
}

#search-input:focus {
    outline: none;
    border-color: #ea7d9c78;
    background-color: #333;
}

#search-input:focus {
    color: #EA7D9C;
}

#search-button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #000000;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #EA7D9C;
    border-radius: 30px;

}

.search-icon {
    width: 20px;
    height: 20px;
    display: block;
}

#search-history-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border-top: none;
    border-radius: 12px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.4);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
}

#search-history-container::-webkit-scrollbar {
    width: 8px;
}

#search-history-container::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

#search-history-container::-webkit-scrollbar-thumb {
    background-color: #474747;
    border-radius: 4px;
}

#search-history-container::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

#search-history-container.visible {
    display: block;
}

#search-options-button {
    display: none;
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #ccc;
    background-color: #2a2a2a;
    border: 1px solid #44444482;
    border-radius: 35px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

#search-options-button svg {
    width: 18px;
    height: 18px;
}

#search-options-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7); z-index: 1000;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}
#search-options-modal-overlay.active { opacity: 1; visibility: visible; }

#search-options-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 500px; max-width: 90vw; background-color: #242424;
    color: #e0e0e0; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1001; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#search-options-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

#search-options-modal .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; border-bottom: 1px solid #3a3a3a;
}
#search-options-modal .modal-header h2 { margin: 0; font-size: 1.3rem; color: #EA7D9C; }
#search-options-modal #search-options-modal-close {
    background: none; border: none; color: #888; font-size: 2.2rem;
    cursor: pointer; line-height: 1; padding: 0;
}

#search-options-modal .modal-content { padding: 30px; }

#search-options-modal .search-options {
    flex-direction: column;
    align-items: stretch;
    gap: 25px;
}

#search-options-modal .search-filters-group {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 15px;
}

#search-options-modal .search-filter-wrapper {
    width: 100%;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 15px;
    background-color: transparent;
    overflow: visible;
    color: #aaa;
    border-radius: 0;
    padding-right: 0;
}

#search-options-modal .search-filter-wrapper:hover {
    background-color: transparent;
}

#search-options-modal .search-filter-btn {
    text-align: center;
    flex-grow: 1;
    padding: 12px;
    background-color: #333;
    border-radius: 20px;
    color: #ccc;
}

#search-options-modal .search-filter-btn.active {
    background-color: #EA7D9C;
    color: #000;
}

#search-options-modal .tooltip-trigger {
    position: static;
    width: auto;
    opacity: 1;
    transform: none;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    margin-left: 10px;
}

#search-options-modal .search-filter-wrapper:has(.search-filter-btn.active) .info-icon {
    color: #666;
}

#search-options-modal .search-filter-wrapper:has(.search-filter-btn.active) .info-icon:hover {
    color: #EA7D9C;
}

#search-options-modal .search-selects-group {
    flex-direction: column;
    width: 100%;
    gap: 15px;
}

#search-options-modal .search-option-item {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

#search-options-modal .search-option-item select {
    width: auto;
    padding: 6px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
}

#search-options-modal .search-options > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.search-option-item > label[for] {
    display: block;
    color: #aaa;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.search-option-item select {
    width: 100%;
    padding: 10px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
}

.history-item {
    padding: 8px 10px 8px 20px;
    color: #ccc;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background-color: #3a3a3a;
    color: #fff;
}

.history-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.history-remove-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.history-remove-btn:hover {
    color: #fff;
    background-color: #555;
}

.history-prompt {
    padding: 12px 20px;
    color: #888;
    font-style: italic;
    text-align: center;
}

.search-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    font-size: 0.9rem;
    color: #aaa;
    flex-shrink: 0;
    white-space: nowrap;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.search-mode-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-group-label {
    color: #aaa;
    font-size: 0.9rem;
    white-space: nowrap;
}

#search-options-modal .search-mode-wrapper {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 10px;
}

.search-filters-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-filter-wrapper {
    display: inline-flex;
    align-items: center;
    background-color: #333;
    border-radius: 20px;
    transition: background-color 0.2s, color 0.2s, max-width 0.2s;
    color: #ccc;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding-right: 36px;
}

.search-filter-wrapper:hover {
    background-color: #444;
}

.search-filter-wrapper:has(.search-filter-btn.active) {
    background-color: #EA7D9C;
    color: #000;
}

.search-filter-wrapper:has(.search-filter-btn.active) .info-icon {
    color: rgba(0, 0, 0, 0.6);
}

.search-filter-wrapper:has(.search-filter-btn.active) .info-icon:hover {
    color: #000;
}

.search-filter-btn {
    background-color: transparent;
    color: inherit;
    border: none;
    padding: 8px 0 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: inherit;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.search-filter-btn:hover {
    background-color: transparent;
}

.search-filter-btn.active {
    font-weight: 700;
}

.search-options .tooltip-trigger {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    opacity: 1;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

.search-selects-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.search-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-options select {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.search-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 90vw;
    flex-grow: 1;
    overflow: hidden;
}

.results-column {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-height: 0;
}

.results-column h2 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #EA7D9C;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    text-align: center;
    flex-shrink: 0;
}

.file-results-disclaimer {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin: 7px 0 0 0;
    padding: 0 15px;
    font-style: italic;
}

.results-list {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    padding-right: 10px;
}

.results-list::after {
    content: '';
    display: block;
    position: sticky;
    bottom: 0;
    height: 30px;
    background: linear-gradient(to top,
        rgba(30, 30, 30, 0.85) 0%,
        rgba(30, 30, 30, 0.5) 30%,
        rgba(30, 30, 30, 0.2) 60%,
        transparent 100%);
    pointer-events: none;
    margin-top: -30px;
    opacity: 0;
}

.results-list.show-shadow::after {
    opacity: 1;
    transition: opacity 0.23s ease-in-out;
}

.search-prompt, .no-results {
    color: #666;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}

.search-result-item {
    margin-bottom: 7px;
}

.search-result-item > a {
    border-radius: 5px;
}

.search-result-item.result-exact > a,
.search-result-item.result-fuzzy > a {
    background-color: #ff638f21;
    border: 1px solid #ea7d9c45;
}

.search-result-item.result-broad > a {
    background-color: #5959591a;
    border: 1px solid #3d3d3d;
}

.matching-files-container {
    padding: 8px 10px 8px 35px;
    background-color: rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
    border: 1px solid #3d3d3d;
    border-top: none;
    position: relative;
}

.result-exact + .matching-files-container,
.result-fuzzy + .matching-files-container {
    background-color: rgba(234, 125, 156, 0.05);
    border-color: #ea7d9c45;
    border-top: none;
}

.matching-files-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 115px;
    overflow-y: auto;
}

.matching-files-list::-webkit-scrollbar {
    width: 6px;
}

.matching-files-list::-webkit-scrollbar-track {
    background: transparent;
}

.matching-files-list::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 3px;
}

.matching-files-list::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.matching-files-list li {
    padding: 5px 0;
    font-size: 0.9rem;
}

.matching-files-list li a,
.matching-files-list li > span {
    color: #b0b0b0;
    text-decoration: none;
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border-radius: 0;
    transition: color 0.2s;
    background-color: transparent !important;
    border: none !important;
    gap: 0px;
}

.file-name-part {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
    flex-grow: 0;
}

.file-ext-part {
    white-space: nowrap;
    flex-shrink: 0;
    flex-grow: 0;
}

.matching-files-list li a:hover {
    color: #EA7D9C;
    filter: none;
}


.results-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: #ccc;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s, filter 0.2s;
    overflow: hidden;
    gap: 10px;
}

.result-main-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex-grow: 1;
}

.result-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #888;
    transition: color 0.2s;
}

.result-icon svg {
    width: 18px;
    height: 18px;
}

.result-text-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.result-stats {
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.result-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.result-date {
    font-size: 0.8em;
    color: #888;
    flex-shrink: 0;
    transition: color 0.2s;
}

.pagination-controls {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
    padding: 10px 5px 0 5px;
    flex-shrink: 0;
    border-top: 1px solid #333;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.pagination-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.pagination-controls > .pagination-button:first-child {
    justify-self: start;
}

.pagination-controls > .pagination-button:last-child {
    justify-self: end;
}

.fav-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-button {
    background-color: #333;
    color: #ccc;
    border: none;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pagination-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pagination-button.active {
    background-color: #EA7D9C;
    color: #000000;
    cursor: default;
}

.pagination-button:disabled {
    background-color: #2a2a2a;
    color: #555;
    cursor: default;
}

.pagination-ellipsis {
    color: #888;
    padding: 0 4px;
    align-self: center;
}

.page-info {
    font-size: 0.9rem;
    color: #888;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.search-result-favorite-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-result-favorite-button svg {
    width: 20px;
    height: 20px;
}

.search-result-favorite-button svg path {
    transition: fill 0.2s ease-in-out;
}

.search-result-favorite-button.is-favorite {
    color: #EA7D9C;
}

.search-result-favorite-button.is-favorite svg path {
    fill: currentColor;
}

#search-tooltip {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    z-index: 1000;
    padding: 8px;
    background-color: rgba(20, 20, 20, 0.9);
    border: 1px solid #444;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.mobile-results-tabs {
    display: none;
    width: 100%;
    max-width: 90vw;
    margin-bottom: 0px;
}

.mobile-tab-button {
    flex-grow: 1;
    padding: 12px 12px;
    font-size: 0.85rem;
    color: #aaa;
    background-color: #111111;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    cursor: pointer;
    margin-bottom: -1px;
    transition: background-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-tab-button.active {
    background-color: #1e1e1e;
    color: #ea7d9c;
    border-bottom-color: transparent;
    margin-bottom: -1px;
    border: 1px solid #333;
    border-bottom: none;
}

.tooltip-grid {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.tooltip-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip-grid img {
    width: 160px;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    border-radius: 5px;
    background-color: #111;
    display: block;
}

#favorite-button {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ccc;
    background-color: transparent;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, color 0.2s;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#favorite-button:disabled {
    color: #404040;
    transform: none;
}

#favorite-button:active {
    transform: scale(0.95);
}

#favorite-button.is-favorite {
    color: #EA7D9C;
}

#favorite-button svg {
    width: 32px;
    height: 32px;
}

#favorite-button svg path {
    transition: fill 0.2s ease-in-out;
}

#favorite-button.is-favorite svg path {
    fill: currentColor;
}

#favorites-content {
    width: 100%;
    max-width: 90vw;
    padding: 0;
    box-sizing: border-box;
}

#favorites-grid {
    width: 100%;
    max-width: 95vw;
    flex-grow: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px 10px 20px 10px;
    box-sizing: border-box;
    align-content: flex-start;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 15px;
}

#favorites-grid::-webkit-scrollbar {
    width: 8px;
}

#favorites-grid::-webkit-scrollbar-track {
    background: transparent;
}

#favorites-grid::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

#favorites-grid::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

#favorites-grid.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

.favorites-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 95vw;
    padding: 15px 20px;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-bottom: 15px;
    border: 1px solid #333;
}

.footer-spacer {
    flex: 1;
}

.per-page-controls {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-size: 0.9rem;
}

.per-page-controls select {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

#favorites-content::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 10px;
}

#favorites-content::-webkit-scrollbar-thumb {
    background: #EA7D9C;
    border-radius: 10px;
    border: 2px solid #1e1e1e;
}

#favorites-content::-webkit-scrollbar-thumb:hover {
    background: #f3a7bd;
}

.favorites-prompt {
    color: #666;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    grid-column: 1 / -1;
}

@keyframes fadeUpEntry {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.favorite-album-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    border-radius: 10px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    min-width: 0;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.favorite-album-card.entry-animation {
    animation: fadeUpEntry 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}

.favorite-album-card:hover {
    background-color: #252525;
    border: 1px solid #414141;
}

.favorite-album-card.marked-for-removal {
    opacity: 0.6;
    filter: grayscale(100%);
    background-color: #1a1a1a;
}

.favorite-album-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
}

.favorite-album-text-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.favorite-album-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-album-stats {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-favorite-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    z-index: 5;
}

.remove-favorite-button:hover {
    background-color: #333;
    color: #fff;
    border-color: #666;
}

.favorite-album-card.marked-for-removal .remove-favorite-button {
    width: auto;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    background-color: #EA7D9C;
    color: #121212;
    border-color: #EA7D9C;
}

.favorite-album-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    width: 100%;
    margin-top: 5px;
}

.favorite-album-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px;
    background-color: #111;
    display: block;
    transition: opacity 0.2s;
}

.search-prompt-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.prompt-button {
    padding: 10px 25px;
    font-size: 1.0rem;
    color: #ea7d9cc7;
    background-color: #ea7d9c12;
    border: 1px solid #ea7d9c00;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.prompt-button:active {
    transform: scale(0.98);
}

.option-label-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon {
    width: 16px;
    height: 16px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}

.info-icon:hover, .tooltip-trigger.active .info-icon {
    color: #EA7D9C;
}

.tooltip-content-template {
    display: none;
}

#global-option-tooltip {
    position: fixed;
    z-index: 10000;
    background-color: #242424;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 0;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 8px 25px rgba(0,0,0,0.75);
    width: 260px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    text-align: left;
    overflow: hidden;
}

#global-option-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

#global-option-tooltip > strong:first-child {
    display: block;
    background-color: #1a1a1a;
    color: #EA7D9C;
    padding: 10px 12px;
    font-size: 0.95rem;
    border-bottom: 1px solid #444;
    font-weight: 700;
}

#global-option-tooltip .tooltip-body {
    padding: 10px 12px;
    color: #ccc;
}

#global-option-tooltip strong {
    color: #EA7D9C;
    font-weight: 700;
}

#global-option-tooltip em {
    color: #999;
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    font-style: normal;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid #EA7D9C;
}

.tooltip-separator {
    display: block;
    height: 1px;
    background-color: #333;
    margin: 8px 0;
}

.tooltip-on { color: #4CAF50; font-weight: bold; font-size: 0.8rem; }
.tooltip-off { color: #FF5252; font-weight: bold; font-size: 0.8rem; }
.tooltip-warning { color: #eebb00; font-size: 0.8rem; display: block; margin-top: 8px; font-style: italic; }


#view-mode-toggle {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

#view-mode-toggle:hover {
    color: #fff;
    background-color: #333;
}

body.scroll-mode .explorer-footer {
    padding-top: 10px;
    padding-bottom: 8px;
    transition: padding 0.3s ease;
}

body.scroll-mode .nav-overlay {
    display: none !important;
}

body.scroll-mode .swipe-hint {
    display: none;
}

.nav-right-group {
    position: absolute;
    right: auto;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px;
}

.mode-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid #EA7D9C;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.mode-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 769px) {
    body.scroll-mode .explorer-footer {
        padding: 10px 0;
        min-height: 40px;
        transition: padding 0.3s ease;
    }

    body.scroll-mode .navigation {
        position: fixed;
        top: 50%;
        right: 30px;
        transform: translateY(-50%);
        width: auto;
        max-width: none;
        margin: 0;
        flex-direction: column;
        background-color: #1e1e1e;
        padding: 15px 10px;
        border: 1px solid #333;
        border-radius: 50px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        z-index: 95;
        gap: 10px;
    }

    body.scroll-mode .nav-center-group {
        flex-direction: column;
        gap: 15px;
        padding: 0;
    }

    body.scroll-mode .nav-right-group {
        position: static;
        transform: none;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 5px;
        padding-top: 15px;
        border-top: 1px solid #333;
        margin-left: 0;
        order: 4;
    }

    body.scroll-mode .nav-button span {
        display: none;
    }

    body.scroll-mode #prev-button,
    body.scroll-mode #next-button {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        background-color: transparent;
        border: 1px solid transparent;
        color: #b3b3b3;
    }

    body.scroll-mode #prev-button:hover,
    body.scroll-mode #next-button:hover {
        background-color: #333;
        color: #fff;
    }

    body.scroll-mode #prev-button .nav-icon,
    body.scroll-mode #next-button .nav-icon {
        margin: 0;
        transform: rotate(90deg);
        width: 28px;
        height: 28px;
        stroke-width: 2.8px;
    }

    body.scroll-mode #prev-button {
        order: 1;
    }
    
    body.scroll-mode #favorite-button {
        order: 2;
    }

    body.scroll-mode #next-button {
        order: 3;
    }

    body.scroll-mode #view-mode-toggle {
        width: 100%;
        border-radius: 0;
        border: none;
        color: #888;
    }
    
    body.scroll-mode #view-mode-toggle:hover {
        color: #fff;
        background-color: transparent;
    }
}

@media (max-width: 600px) and (pointer: coarse) {
    .search-panel .search-options {
        display: none;
    }
    
    #search-options-button {
        display: flex;
    }
}

@media (max-width: 768px) and (pointer: coarse) {
    #prev-button,
    #next-button {
        display: none;
    }

    .swipe-hint {
        display: block;
        text-align: center;
        color: #4b4b4b;
        font-size: 0.85rem;
        font-style: italic;
        margin-top: 10px;
        transition: opacity 0.5s ease-in-out;
    }

    .swipe-hint.fade-out {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .site-header {
        padding: 5px 8px;
    }

    .app-container {
        padding: 70px 10px 10px 10px;
        justify-content: flex-start;
    }

    .tabs {
        gap: 3px;
    }

    #search-input {
        font-size: 0.9rem;
    }

    .result-title {
        font-size: 0.85rem;
    }
    
    .tab-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    #card-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        padding: 15px;
        box-sizing: border-box;
        height: 100%;
        max-height: 85vh;
    }

    #card-container:has(.single-image-card),
    #card-container:has(.two-image-card) {
        min-width: 90vw;
        max-width: 95vw;
    }

    .album-card h2 {
        font-size: 1rem;
        max-width: 80vw;
        margin-left: auto;
        margin-right: auto;
    }
    
    .explorer-footer {
        padding-top: 10px;
        padding-bottom: 30px;
    }

    .navigation {
        display: flex;
        flex-direction: column;
        max-width: 95vw;
        gap: 10px;
    }

    .nav-overlay { display: none !important; }

    .nav-center-group, .nav-right-group {
        display: flex;
        justify-content: center;
        width: 100%;
        padding-left: 0;
        flex-wrap: wrap;
    }

    #next-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    #next-button {
        font-size: 0.9rem;
    }

    #prev-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    #prev-button {
        font-size: 0.9rem;
    }

    #favorite-button {
        padding: 10px;
    }

    #favorite-button svg {
        width: 28px;
        height: 28px;
    }
    .search-bar-container {
        width: 90vw;
    }

    .search-panel {
        min-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-results-tabs {
        display: flex;
        max-width: 100%;
        width: 100%;
    }
    
    .search-results-grid {
        display: flex;
        gap: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .search-results-grid > .results-column {
        display: none;
    }
    
    .search-results-grid > .results-column.active {
        display: flex;
        width: 100%;
    }

    .results-column h2 {
        display: none;
    }
    
    .search-results-grid > #album-results-column.active {
        border-radius: 0 8px 8px 8px;
    }

    .search-results-grid > #file-results-column.active {
        border-radius: 8px 0 8px 8px;
    }
    
    
    .results-column {
        border-top: none;
    }

    .pagination-controls {
        display: grid;
        grid-template-columns: max-content 1fr max-content;
        align-items: center;
        padding: 15px 0 0 0;
        gap: 5px;
        width: 100%;
        box-sizing: border-box;
    }

    .pagination-numbers {
        gap: 4px;
    }

    .pagination-button {
        padding: 7px 4px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .pagination-ellipsis {
        padding: 0 2px;
        min-width: auto;
        font-size: 12px;
    }

    .result-date .result-time {
        display: none;
    }

    .file-results-disclaimer {
        font-size: 0.7rem;
    }

    #favorites-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .favorites-footer {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .footer-spacer {
        display: none;
    }
    
    .per-page-controls {
        position: static;
    }
    .prompt-button {
        padding: 12px 15px;
        font-size: 0.9rem;
        line-height: 20px;
    }
    .nav-right-group {
        position: relative;
        right: auto;
        left: auto;
        top: auto;
        transform: none;
        margin-top: 5px;
        display: flex;
        justify-content: center;
        width: 100%;
        margin-left: 0;
    }
    body.scroll-mode #view-mode-toggle {
        color: #EA7D9C;
        background-color: #ea7d9c14;
        border: 1px solid #ea7d9c33;
    }
}