/* Extend the provided styles.css with page-specific styles */
/* Base look */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.6);
    border-bottom: 1px solid #222;
    z-index: 20;
    backdrop-filter: blur(6px);
}
.topbar h1 { font-size: 2rem; margin: 0; }

/* Mobile: fixed, reachable, safe-area aware */
@media (max-width: 767px) {
    .topbar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        padding: calc(0.6rem + env(safe-area-inset-bottom)) 1rem 0.6rem;
        border-top: 1px solid #222;
        border-bottom: none;
    }

    /* prevent content from being covered by the fixed bar */
    body {
        padding-bottom: 64px; /* adjust to match your topbar height */
    }
}

/* Desktop: sticky at top, shorter vertical space */
@media (min-width: 768px) {
    .topbar {
        position: sticky;
        top: 0;
        padding: 0.5rem 2rem; /* shorter than before */
    }
}
.home-link { text-decoration: none; margin-right: 1rem }

.filters-wrap {
    display: grid;
    grid-template-columns: repeat(10, minmax(140px, 1fr));
    gap: .75rem;
    padding: 1rem 2rem 0 2rem;
}
.mark-down {
    margin-bottom: 1rem;
}
.mark-up {
    margin-top: 1rem;
}
.filters-wrap label { font-size: .9rem; color: #aaa; }
.filters-wrap input, .filters-wrap select {
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    padding: .6rem .8rem;
    outline: none;
}

.view-toggle {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: 1rem 2rem;
}
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .9rem;
    border-radius: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    cursor: pointer;
    user-select: none;
}
.toggle-btn.active { border-color: #00ffcc; box-shadow: 0 0 0 2px rgba(0,255,204,.1); }

.results { padding: 1rem 2rem 3rem 2rem; }

/* Gallery */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.card {
    background: #181818;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
}
.card img {
    width: 100%;
    height: 24.2rem; /* keep full height default */
    object-fit: cover;
    background: #0d0d0d;
}

.card .meta {
    padding: .75rem .9rem;
    display: grid;
    gap: .25rem;
    font-size: .95rem;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .card img {
        object-fit: contain;
        height: 128vw;
        flex-shrink: 0; /* prevent height collapsing in flex/grid */
    }

    .card .meta {
        display: none; /* hide meta on mobile */
    }
}
.kv { color: #aaa; font-size: .85rem; }

/* Data form table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid #222; }
th { color: #00ffcc; position: sticky; top: 0; background: #0f0f0f; }
.table-wrap { overflow: auto; border: 1px solid #222; border-radius: 12px; }

/* Toast */
.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    background: #ff0066;
    color: #fff;
    padding: .9rem 1rem;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255,0,102,.5);
    z-index: 50;
    display: none;
}
.empty { text-align: center; color: #aaa; padding: 2rem; }

@media (max-width: 1200px) {
    .filters-wrap { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

.export-btn {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 10px 20px;
    margin: 15px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.export-btn:hover {
    background-color: #45a049;
}

#keywords-export-btn {
    white-space: nowrap;
}

.description {
    white-space: normal;
    width: 25%;
}

a {
    background: linear-gradient(90deg, #00ffcc, #00ccff);
    color: #000;
    box-shadow: 0 0 10px #00ffcc;
}

a:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00ffcc;
}

.home-btn {
    background: linear-gradient(90deg, #ff0066, #ff6600);
    color: #fff;
    box-shadow: 0 0 10px #ff0066;
}

.home-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff0066;
}

.clear-btn {
    background: linear-gradient(90deg, #ffcc00, #ff6699);
    color: #fff;
    box-shadow: 0 0 10px #ff9966;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clear-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff6699;
}