/* ==========================================================================
   OmniSelect Path 1 - Theme Variable Configurations
   ========================================================================== */

:root {
    /* Light Mode Declarations */
    --background-color: #f8f8f8;
    --text-color: #000;
    --container-background: white;
    --container-border: #ddd;
    --section-background: #f8f9fa;
    --section-border: #3498db;
    --section-text-color: #2c3e50;
    --input-background: white;
    --input-border: #bdc3c7;
    --input-border-hover: #3498db;
    --status-background: white;
    --status-border: #ecf0f1;
    --success-background: #d4edda;
    --success-border: #27ae60;
    --error-background: #f8d7da;
    --error-border: #e74c3c;
    --card-background: white;
    --card-shadow: rgba(0,0,0,0.1);
    --details-background: white;
    --details-summary-background: #f8f9fa;
    --details-summary-hover: #e9ecef;
    --details-border: #f1f3f4;
    --found-color: #27ae60;
    --missing-color: #e74c3c;
    --muted-color: #7f8c8d;
    --progress-background: #ecf0f1;
    --progress-bar: #3498db;
    --dropzone-border: #3498db;
    --dropzone-background: #e3f2fd;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #e0e0e0;
        --container-background: #2a2a2a;
        --container-border: #444;
        --section-background: #333;
        --section-border: #62707d;
        --section-text-color: #e0e0e0;
        --input-background: #2a2a2a;
        --input-border: #555;
        --input-border-hover: #62707d;
        --status-background: #2a2a2a;
        --status-border: #444;
        --success-background: #1e3a28;
        --success-border: #27ae60;
        --error-background: #3a1e1e;
        --error-border: #e74c3c;
        --card-background: #2a2a2a;
        --card-shadow: rgba(0,0,0,0.3);
        --details-background: #2a2a2a;
        --details-summary-background: #333;
        --details-summary-hover: #3a3a3a;
        --details-border: #444;
        --found-color: #4ade80;
        --missing-color: #f87171;
        --muted-color: #9ca3af;
        --progress-background: #444;
        --progress-bar: #62707d;
        --dropzone-border: #62707d;
        --dropzone-background: #2a3a4a;
    }
}

body[data-theme='dark'] {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --container-background: #2a2a2a;
    --container-border: #444;
    --section-background: #333;
    --section-border: #62707d;
    --section-text-color: #e0e0e0;
    --input-background: #2a2a2a;
    --input-border: #555;
    --input-border-hover: #62707d;
    --status-background: #2a2a2a;
    --status-border: #444;
    --success-background: #1e3a28;
    --success-border: #27ae60;
    --error-background: #3a1e1e;
    --error-border: #e74c3c;
    --card-background: #2a2a2a;
    --card-shadow: rgba(0,0,0,0.3);
    --details-background: #2a2a2a;
    --details-summary-background: #333;
    --details-summary-hover: #3a3a3a;
    --details-border: #444;
    --found-color: #4ade80;
    --missing-color: #f87171;
    --muted-color: #9ca3af;
    --progress-background: #444;
    --progress-bar: #62707d;
    --dropzone-border: #62707d;
    --dropzone-background: #2a3a4a;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    padding: 20px; 
    padding-top: 120px;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.omniselect-container {
    width: 100%;
    margin: 0 auto;
    background-color: var(--container-background);
    color: var(--text-color);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--container-border);
    box-shadow: 0 4px 8px var(--card-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.omniselect-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--section-text-color);
    margin-top: 0;
    margin-bottom: 25px;
}

/* --- Storage Capacity Tracker --- */
.storage-tracker-wrapper {
    background: var(--card-background);
    border: 1px solid var(--container-border);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px var(--card-shadow);
}

.storage-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.storage-tracker-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--section-text-color);
}

.storage-tracker-stats {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted-color);
}

.storage-bar-bg {
    width: 100%;
    height: 18px;
    background-color: var(--input-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.storage-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #2ecc71;
    border-radius: 10px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.storage-bar-fill.warning { background-color: #f39c12; }
.storage-bar-fill.danger { background-color: #e74c3c; }

.storage-alert-msg {
    display: none;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #e74c3c;
    text-align: right;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-card {
    background-color: var(--card-background);
    border: 1px solid var(--container-border);
    border-left: 5px solid var(--section-border);
    border-radius: 8px;
    padding: 25px 30px;
    box-shadow: 0 2px 4px var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

.game-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--section-text-color);
    margin-top: 0;
    margin-bottom: 18px;
}

.card-step-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    text-align: right;
    background-color: var(--section-border);
    color: #fff;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-card.locked {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
    filter: grayscale(30%);
}

.game-card.processing-mode {
    border-left-color: var(--progress-bar);
}

.game-card.completed {
    border-left-color: var(--success-border);
}

.input-method-container {
    margin-bottom: 15px;
}

.input-method-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--input-background);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-input:focus {
    border-color: var(--input-border-hover);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.btn-primary {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    background-color: var(--section-border);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashed-input-box {
    border: 1.5px dashed var(--input-border);
    border-radius: 6px;
    padding: 12px 15px;
    background-color: transparent;
    transition: border-color 0.2s ease;
}

.dashed-input-box:hover {
    border-color: var(--input-border-hover);
}

.or-divider {
    text-align: center;
    margin: 15px 0;
    font-weight: 700;
    color: var(--muted-color);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.drop-zone {
    border: 2px dashed var(--dropzone-border);
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    background-color: var(--dropzone-background);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.drop-zone.dragover {
    background-color: var(--details-summary-hover);
    border-color: var(--input-border-hover);
}

.drop-zone h3 {
    margin: 10px 0 5px 0;
    font-size: 1.15rem;
    color: var(--section-text-color);
}

.drop-zone p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.9rem;
}

.folder-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.table-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--container-border);
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    position: relative;
}

.clean-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.clean-table th {
    background-color: var(--details-summary-background);
    border-bottom: 2px solid var(--container-border);
    padding: 10px 12px;
    font-weight: 700;
    color: var(--section-text-color);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.clean-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.clean-table th.sortable:hover {
    background-color: var(--details-summary-hover);
}

.clean-table th .sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    color: var(--section-border);
    min-width: 12px;
}

.clean-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--container-border);
    color: var(--text-color);
    background-color: var(--card-background);
    position: relative;
    z-index: 1;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.clean-table tbody tr:hover td {
    background-color: var(--details-summary-hover);
}

.filter-tag {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
}
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.status-badge.complete {
    background-color: var(--success-background);
    color: var(--found-color);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.status-badge.missing {
    background-color: var(--error-background);
    color: var(--missing-color);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.progress-bar-wrapper {
    background-color: var(--progress-background);
    border: 1px solid var(--container-border);
    border-radius: 12px;
    overflow: hidden;
    height: 20px;
    margin: 15px 0;
}

.progress-fill-element {
    background-color: var(--progress-bar);
    color: #fff;
    height: 100%;
    width: 0%;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 20px;
    transition: width 0.1s linear;
}

.processing-status-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-metric-card {
    background-color: var(--section-background);
    border: 1px solid var(--container-border);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.stat-metric-card.match-success {
    border-top: 4px solid var(--success-border);
}

.stat-metric-card.match-fail {
    border-top: 4px solid var(--error-border);
}

.stat-number-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 2px;
}

.stat-label-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}