/* ===============================
   THEME VARIABLES
=============================== */

:root {
    --bg: #111;
    --fg: #eee;
    --panel: #1e1e1e;
    --panel-alt: #181818;
    --accent: #f5c542;
    --muted: #aaa;
}

[data-theme="light"] {
    --bg: #ececec;
    --fg: #111;
    --panel: #f7f7f7;
    --panel-alt: #e9e9e9;
    --accent: #d9a400;
    --muted: #555;
}

/* ===============================
   BASE
=============================== */

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--fg);
    padding-top: 96px;
}

a {
    color: #4ea3ff;
    text-decoration: none;
}

/* ===============================
   FIXED TOP BAR
=============================== */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 96px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 16px;
    background: linear-gradient(#1b1b1b, #111);
    color: #fff;

    z-index: 4000;
}

/* ===============================
   MAIN NAV
=============================== */

.main-nav {
    display: flex;
    gap: 18px;
}

.main-nav a {
    color: #cfcfcf;
    font-size: 14px;
}

.main-nav a:hover { color: #fff; }
.main-nav a.active { color: var(--accent); }

/* ===============================
   LOGO
=============================== */

.brand-link {
    display: inline-flex;
    align-items: center;
}

.logo {
    height: 75px;
}

/* ===============================
   USER DROPDOWN
=============================== */

.user-area { position: relative; }

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel);
    width: 260px;
    border-radius: 6px;
    display: none;
    z-index: 4500;
}

.user-dropdown.active {
    display: block;
}

/* ===============================
   MOBILE MENU
=============================== */

.mobile-menu {
    position: fixed;
    top: 96px;
    left: 0;

    display: none;
    flex-direction: column;

    width: max-content;
    min-width: 200px;

    background: var(--panel);
    border-radius: 0 0 8px 8px;
    padding: 6px 0;

    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
    z-index: 4200;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* ===============================
   PAGE CONTAINER
=============================== */

.page-container {
    max-width: 90vw;
    margin: 0 auto;
    padding: 0 8px 20px;
}

/* NEW PIECE ADDED*/

#scrollSpacer {
    height: 12vh;
    min-height: 96px;
    max-height: 200px;
}


/* ===============================
   GRID
=============================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* ===============================
   IMAGE CARD
=============================== */

.thumb {
    background: var(--panel);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.thumb img {
    width: 100%;
    display: block;
}

.thumb .meta {
    background: rgba(0,0,0,0.55);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
}

.thumb .meta strong {
    display: block;
    color: #fff;
    font-weight: 600;
}

.thumb .meta span {
    display: block;
    margin-top: 2px;
    color: #bbb;
}

/* ===============================
   REVIEW ICON (GRID)
=============================== */

.review-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e74c3c;
}

.review-hit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.review-hit:hover {
    background: rgba(255,255,255,0.12);
}

/* ===============================
   NOTES BADGE
=============================== */

.notes-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(245,197,66,0.9);
    color: #111;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* ===============================
   ICON BUTTONS (GLOBAL)
=============================== */

.icon-btn {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
}

.icon-btn:hover {
    background-color: rgba(255,255,255,0.08);
}

/* ===============================
   PHOTO VIEWER (CANONICAL)
=============================== */

.viewer {
    position: fixed;
    inset: 0;
    z-index: 5000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.viewer.active {
    opacity: 1;
    pointer-events: auto;
}

.viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}

/*=======================
  VIEWER PANEL LAYOUT 
=========================*/

.viewer-panel {
    position: absolute;

    top: 6vh;
    bottom: 6vh;
    left: 6vw;
    right: 6vw;

    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;

    background: var(--panel);
    padding: 22px;
    border-radius: 10px;

    max-height: 88vh;
    overflow: hidden;
}

/*==============================
  VIEWER PANEL STYLING
==============================*/
.viewer-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
    margin-bottom: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.08);
}

.viewer-info-camera {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}

.viewer-info-time {
    font-size: 12px;
    color: var(--muted);
}


/* ===============================
   VIEWER IMAGE STAGE
=============================== */

.viewer-image-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.viewer-image-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Overlay info bar */
.viewer-image-overlay {
    position: absolute;
    top: 12px;
    right: 12px;

    padding: 10px 14px;
    background: rgba(0,0,0,0.65);
    border-radius: 6px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    font-size: 13px;
    text-align: right;

    pointer-events: none;
}

.viewer-image-overlay strong {
    color: #fff;
    font-weight: 600;
}

.viewer-image-overlay span {
    color: #ccc;
    font-size: 12px;
}

/* ===============================
   VIEWER RIGHT PANEL
=============================== */

.viewer-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
}

/* ===============================
   VIEWER ACTION BUTTONS
=============================== */

.viewer-actions {
    display: flex;
    gap: 12px;
}

.viewer-action-btn {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--fg);

    cursor: pointer;
}

.viewer-action-btn:hover {
    background: rgba(255,255,255,0.12);
}

/* ===============================
   VIEWER CONTROLS
=============================== */

.viewer-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 20;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    background: rgba(0,0,0,0.35);
    color: #fff;

    font-size: 26px;
    width: 30px;
    height: 44px;

    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
}

.viewer-image-stage .viewer-nav.prev {
    left: 12px;
}

.viewer-image-stage .viewer-nav.next {
    right: 12px;
}

.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 320px; }

.viewer-nav:disabled {
    opacity: 0.25;
    cursor: default;
/*    pointer-events: none;*/
}

/* ===============================
   VIEWER NOTES
=============================== */

.viewer-notes {
    margin-top: 12px;
}

/* ===============================
   VIEWER – MOBILE (DEFERRED)
=============================== */

@media (max-width: 900px) {
    .viewer-panel {
        inset: 6vh 4vw;
        grid-template-columns: 1fr;
    }

    .viewer-nav.next {
        right: 8px;
    }
}

/* ===============================
   RESPONSIVE NAV
=============================== */

@media (max-width: 900px) {
    .main-nav { display: none !important; }
    .mobile-menu.active { display: flex !important; }
}

@media (min-width: 901px) {
    .main-nav { display: flex !important; }
    .mobile-menu { display: none !important; }
}

.viewer-actions .review-hit {
    position: static;
    bottom: auto;
    right: auto;
}

/*================================
    VIEWER BUTTON STYLING
===============================*/
.deployment-btn {
    width: 50%;
    padding: 10px 12px;

    background: var(--accent);
    color: #111;

    border: none;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.deployment-btn:hover {
    opacity: 0.9;
}

.note-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.note-buttons button {
    flex: 1;
    padding: 10px 14px;

    background: var(--accent);
    color: #111;

    border: none;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.note-buttons button:hover {
    opacity: 0.9;
}

/*======================
    SET NOTE INPUT AREA SIZE
=====================*/

#noteInput {
    width: 100%;
    min-height: 140px;   /* ~6–8 lines */
    padding: 10px 12px;
    resize: vertical;

    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: var(--panel-alt);
    color: var(--fg);
}

/*============================
    MOVE DEPLOYMENT BUTTONS DOWN
===========================*/

.viewer-actions {
    margin-top: 20px;
}

