/* =====================================================
   RESET + BASE
===================================================== */
/* =====================================================
   FORCE HIDDEN
===================================================== */
[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #111;
    color: #eee;
}

a {
    color: inherit;
    text-decoration: none;
}

button, select {
    cursor: pointer;
    border: none;
    outline: none;
}

/* =====================================================
   TOP BAR
===================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1a;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.topbar h1 {
    font-size: 20px;
    margin-bottom: 8px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar button,
.toolbar select,
.drive-btn {
    background: #2a2a2a;
    color: #eee;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.toolbar button:hover,
.drive-btn:hover {
    background: #3a3a3a;
}

.toolbar .danger {
    background: #b00020;
}

.toolbar .danger:hover {
    background: #d00030;
}

.drive-btn {
    background: #0f9d58;
}

#fileCounter {
    margin-left: auto;
    font-size: 13px;
    opacity: 0.8;
}

/* =====================================================
   DROP ZONE
===================================================== */
#dropZone {
    margin: 16px;
    padding: 20px;
    border: 2px dashed #444;
    border-radius: 10px;
    text-align: center;
    color: #aaa;
    transition: 0.2s;
}

#dropZone.drag {
    border-color: #0f9d58;
    color: #0f9d58;
    background: rgba(15,157,88,0.05);
}

#dropZone progress {
    width: 100%;
    height: 16px;
}

/* =====================================================
   GALLERY GRID
===================================================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 16px;
}

.item {
    position: relative;
    background: #1b1b1b;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.item img,
.item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================================================
   CHECKBOX (TO – D BM)
===================================================== */
.check-wrap {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 10;
}

.check-wrap input {
    display: none;
}

.check-wrap span {
    width: 24px;
    height: 24px;
    display: block;
    background: rgba(0,0,0,0.6);
    border: 2px solid #aaa;
    border-radius: 6px;
}

.check-wrap input:checked + span {
    background: #0f9d58;
    border-color: #0f9d58;
}

/* =====================================================
   SELECT MODE
===================================================== */
body:not(.selecting) .check-wrap {
    display: none;
}

/* =====================================================
   VIEWER OVERLAY
===================================================== */
#viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewerContent {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewerContent img,
#viewerContent video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* =====================================================
   VIEWER BUTTONS
===================================================== */
#viewerClose {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    background: none;
    color: #fff;
}

#prevBtn,
#nextBtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    background: none;
    color: #fff;
    opacity: 0.6;
}

#prevBtn { left: 16px; }
#nextBtn { right: 16px; }

#prevBtn:hover,
#nextBtn:hover {
    opacity: 1;
}

#viewerDownload {
    position: absolute;
    bottom: 20px;
    background: #0f9d58;
    padding: 10px 18px;
    border-radius: 8px;
    color: #fff;
}

/* =====================================================
   FOOTER
===================================================== */
footer {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    opacity: 0.6;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    #prevBtn,
    #nextBtn {
        display: none;
    }
}
/* ===============================
   HOME BUTTON
================================ */
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 14px;
    margin-right: 8px;

    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    color: #fff;
    background: linear-gradient(135deg, #2c7be5, #1a5fd0);
    border-radius: 6px;

    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    transition: all 0.2s ease;
}

.home-btn:hover {
    background: linear-gradient(135deg, #3b8cff, #2c7be5);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.45);
}

.home-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

.home-btn::before {
    content: "";
    margin-right: 6px;
    font-size: 15px;
}

