:root {
    --bg: #050505;
    --card-bg: #111111;
    --border: #222222;
    --accent: #4D91F6;
    --text: #ffffff;
    --text-dim: #777;
    --hover-bg: #161616;
    --keyword-bg: #1d2025;
    --keyword-hover: #2a2e38;
    --fav-gold: #FFD700;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tabs-nav {
    width: 100%;
    max-width: 1100px;
    display: flex;
    gap: 2px;
    margin-bottom: 2px;
}

.tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 12px 20px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.2s;
    flex-grow: 1;
}

.tab-btn:hover {
    color: #fff;
    background: var(--hover-bg);
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.controls-container {
    width: 100%;
    max-width: 1100px;
    background: var(--card-bg);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.search-row {
    display: flex;
    gap: 1px;
    margin-bottom: 15px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border);
    background: #000;
    color: white;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.btn-style {
    font-size: 9px;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid #333;
    padding: 6px 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-style:hover {
    border-color: var(--accent);
    background: #161616;
    color: #fff;
}

button.query-btn {
    border-color: var(--accent);
    color: white;
    background: var(--accent);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 10px;
    color: var(--text-dim);
    padding-top: 10px;
    border-top: 1px solid #222;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
}

.checkbox-item input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent);
}

.filter-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sort-order {
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    font-size: 9px;
    text-transform: uppercase;
}

#results-list {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

.result-row {
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin-bottom: 5px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.row-header {
    display: flex;
    align-items: stretch;
    min-height: 120px;
    width: 100%;
}

.thumb-area {
    width: 120px;
    height: 120px;
    min-width: 120px;
    cursor: pointer;
    background: #000;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    display: block;
}

.info-area {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
    padding-right: 52px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.title-text {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0;
}

.meta-line {
    font-size: 9px;
    color: var(--text-dim);
    display: flex;
    gap: 12px;
    text-transform: uppercase;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.header-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 15px;
    border-left: 1px solid #222;
    align-content: center;
    background: #090909;
    position: relative;
}

.quick-actions.mobile-actions {
    display: none;
    border-left: none;
    border-top: 1px solid #222;
    padding: 14px 0 0 0;
    margin-top: 14px;
    background: transparent;
}

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #444;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
    z-index: 5;
    line-height: 1;
}

.fav-btn:hover {
    transform: scale(1.2);
    color: #666;
}

.fav-btn.active {
    color: var(--fav-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.info-area .fav-btn {
    top: 12px;
    right: 12px;
}

.details-pane {
    display: none;
    padding: 20px;
    background: #080808;
    border-top: 1px solid #222;
    width: 100%;
}

.details-pane.active {
    display: block;
}

.player-wrapper {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

video,
.full-img-preview {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

audio {
    width: 100%;
    max-width: 100%;
}

.metadata-view {
    background: #000;
    color: #00ffaa;
    font-family: monospace;
    font-size: 10px;
    padding: 10px;
    border: 1px solid #222;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
    margin-bottom: 15px;
    display: none;
    white-space: pre-wrap;
}

.desc-box {
    font-size: 12px;
    line-height: 1.6;
    color: #bbb;
    margin-bottom: 15px;
    overflow-wrap: break-word;
}

.kw-tag {
    font-size: 9px;
    background: var(--keyword-bg);
    color: var(--accent);
    padding: 3px 8px;
    border: 1px solid #2a2d34;
    cursor: pointer;
    margin-right: 4px;
    margin-bottom: 4px;
    display: inline-block;
}

.kw-tag:hover {
    background: var(--keyword-hover);
}

.last-accessed {
    color: #00ffaa;
    font-family: monospace;
    font-size: 9px;
    font-weight: bold;
}

.status {
    width: 100%;
    max-width: 1100px;
    color: var(--text-dim);
    font-size: 0px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

@media (max-width: 800px) {
    body {
        padding: 12px 8px;
    }

    .controls-container {
        padding: 14px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row .query-btn {
        width: 100%;
    }

    .filter-group {
        gap: 10px;
    }

    .filter-tools {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    #results-list {
        gap: 10px;
    }

    .result-row {
        margin-bottom: 0;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
    }

    .row-header {
        flex-direction: column;
        height: auto;
        min-height: unset;
    }

    .thumb-area {
        display: none;
    }

    .info-area {
        width: 100%;
        padding: 14px;
        padding-right: 46px;
        cursor: default;
    }

    .title-text {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .quick-actions {
        display: none;
    }

    .quick-actions.mobile-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        margin-top: 0;
        margin-bottom: 18px;
    }

    .details-pane {
        display: block;
        padding: 14px;
    }

    .player-wrapper {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
        margin-bottom: 14px;
    }

    video,
    .full-img-preview,
    audio {
        width: 100%;
        max-width: 100%;
    }
 
}