/**
 * Sichtflow – Galerie-Styles
 * Nutzt CSS-Variablen. Theme pro Galerie (.theme-light / .theme-dark).
 */
:root {
    --sf-accent: #8bc34a;
    --sf-com-blue: #3498db;
    --sf-font-main: sans-serif;
}
body.theme-light {
    --sf-bg: #f5f7f9;
    --sf-text: #2d3436;
    --sf-card: #ffffff;
    --sf-ui: #ffffff;
    --sf-border: #dee2e6;
}
body.theme-dark {
    --sf-bg: #121212;
    --sf-text: #ffffff;
    --sf-card: #1e1e1e;
    --sf-ui: #1e1e1e;
    --sf-border: #333;
}

/* FontAwesome Firefox-Fix */
.fa, .fas, .far, .fa-solid, .fa-regular {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Duotone", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--sf-font-main); background: var(--sf-bg); color: var(--sf-text); overflow-x: hidden; }

header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: var(--sf-ui); border-bottom: 1px solid var(--sf-border);
    position: sticky; top: 0; z-index: 1000;
}
.filter-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.f-pill {
    display: flex; align-items: center; gap: 6px; padding: 6px 10px;
    background: transparent; border: 1px solid var(--sf-border);
    cursor: pointer; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #777;
    white-space: nowrap;
}
.f-pill.active { border-color: #fff; color: #fff; }
.f-pill .dot { width: 8px; height: 8px; border-radius: 50%; }

.download-dropdown {
    background: #000; color: white; border: 1px solid var(--sf-border);
    padding: 6px; font-size: 10px; text-transform: uppercase;
}

.password-screen {
    background: #000; color: #fff; display: flex; align-items: center; justify-content: center;
    height: 100vh; font-family: sans-serif;
}
.password-form { text-align: center; }
.password-input { padding: 10px; border: 1px solid #333; background: #111; color: #fff; outline: none; }
.password-submit { padding: 10px 20px; background: #fff; border: none; cursor: pointer; margin-left: 5px; }

.hero-section { width: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: 40px; }
.hero-bg {
    width: 100%; height: 50vh; background-size: cover; background-position: center;
    margin-bottom: 20px; background-image: var(--hero-bg);
}
.hero-content h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: 4px; text-align: center; }
.hero-content p { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #555; margin-top: 8px; text-align: center; }

.main-grid {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: block;
    padding: 20px;
}
.main-grid .img-card,
.main-grid .thumb-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    position: relative;
    background: #000;
    cursor: pointer;
}
.main-grid .img-card img,
.main-grid .thumb-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 1000px) {
    .main-grid { column-count: 2; }
}
@media (max-width: 600px) {
    .main-grid { column-count: 1; padding: 10px; }
}

#viewer {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: #000; z-index: 2000; overflow: hidden; overscroll-behavior: none; touch-action: auto;
}
.v-wrap { display: flex; width: 100%; height: 100%; overflow: hidden; }
.v-stage {
    flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 10px; background: #000; cursor: grab; touch-action: none;
}
body.scribble-on .v-stage { cursor: crosshair; }
.v-stage:active { cursor: grabbing; }
.v-stage { overflow: hidden; }

#stage-box { width: 100%; height: 100%; overflow: visible; display: grid; place-items: center; position: relative; }
#media-stage { overflow: visible; }
.v-aside {
    overflow: auto; height: 100vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    width: 340px; background: #000; border-left: 1px solid var(--sf-border); display: flex; flex-direction: column;
}
.stage-box { display: grid; place-items: center; width: 100%; height: 100%; overflow: visible; transition: transform 0.1s ease-out; position: relative; }
.pan-stage { display: inline-block; will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden; }

body.scribble-lock { overflow: hidden; overscroll-behavior: none; touch-action: none; }
body.scribble-lock #viewer { overflow: hidden !important; overscroll-behavior: none; touch-action: none; }
body.scribble-lock #stage-box { touch-action: none; }

.media-stage {
    position: relative; display: inline-block; line-height: 0; max-width: 100%; max-height: 90vh;
    transform-origin: center center; will-change: transform; overflow: visible;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
#v-img {
    display: block; position: relative; z-index: 1; max-width: 100%; max-height: 90vh;
    width: auto; height: auto; object-fit: contain; pointer-events: none; user-select: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
/* Zoom-Slider: auf Touch-Geräten ausblenden, auf Maus sichtbar */
@media (pointer: coarse) {
    .v-controls { display: none !important; }
}
@media (pointer: fine) {
    .v-controls { display: flex; }
}
#svg-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
body.scribble-on #svg-overlay { pointer-events: auto; touch-action: none; }
#canvas-scribble { position: absolute; inset: 0; width: 100%; height: 100%; display: none !important; pointer-events: none !important; }

.v-close-btn {
    position: absolute; top: 0; right: 0; width: 60px; height: 60px;
    background: #000; color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 30px; cursor: pointer; z-index: 2200;
}
.v-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 2100; background: #000; padding: 10px 15px; border: 1px solid var(--sf-border);
}
#zoom-range { width: 120px; cursor: pointer; accent-color: var(--sf-accent); }

.aside-header { padding: 15px; border-bottom: 1px solid var(--sf-border); display: flex; justify-content: space-between; align-items: center; }
.aside-header h3 { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #444; margin: 0; }
.aside-comments { flex: 1; overflow-y: auto; padding: 15px; }
.comment-box { position: relative; margin-bottom: 12px; padding: 12px; font-size: 13px; }
.comment-box.type-scribble { border-left: 4px solid var(--sf-accent); background: rgba(139, 195, 74, 0.07); }
.comment-box.type-comment { border-left: 4px solid var(--sf-com-blue); background: rgba(52, 152, 219, 0.07); }
.comment-type-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.com-del-btn { position: absolute; top: 5px; right: 8px; color: #555; cursor: pointer; font-size: 18px; }

.comment-input-area { padding: 15px; border-top: 1px solid var(--sf-border); display: flex; gap: 5px; }
.comment-input-area input { flex: 1; background: #000; border: 1px solid #333; color: #fff; padding: 10px; font-size: 13px; outline: none; }
.comment-input-area button { background: #fff; border: none; padding: 0 12px; cursor: pointer; color: #000; }

.aside-footer { padding: 10px; border-top: 1px solid var(--sf-border); display: flex; gap: 5px; position: relative; background: #000; }
.v-btn { flex: 1; background: transparent; border: 1px solid #333; color: #fff; padding: 12px 2px; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; }
.v-btn.active { background: #fff; color: #000; border-color: #fff; }

.status-yes { border-color: #4caf50 !important; color: #4caf50 !important; }
.status-no { border-color: #f44336 !important; color: #f44336 !important; }
.status-maybe { border-color: #ff9800 !important; color: #ff9800 !important; }
.status-final { border-color: #2196f3 !important; color: #2196f3 !important; }

#pop-flags { display: none; position: absolute; bottom: 70px; left: 10px; right: 10px; background: #000; border: 1px solid #333; flex-direction: column; z-index: 2200; }
.flag-item { padding: 15px; display: flex; align-items: center; gap: 10px; font-size: 10px; text-transform: uppercase; border-bottom: 1px solid #222; cursor: pointer; color: #fff; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.f-yes { background: #4caf50; }
.f-no { background: #f44336; }
.f-maybe { background: #ff9800; }
.f-final { background: #2196f3; }

.status-bar-left { display: flex; align-items: center; gap: 12px; }
.status-bar {
    position: absolute; bottom: 0; left: 0; width: 100%;
    height: 28px; display: flex; align-items: center; gap: 12px;
    padding: 0 10px;
    background: rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 10;
}
body.theme-light .status-bar {
    background: rgba(255, 255, 255, 0.75);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.status-bar .sb-icon {
    color: #ffffff;
    font-size: 13px;
    -webkit-filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    opacity: 0.9;
}
body.theme-light .status-bar .sb-icon {
    color: #2d3436;
    -webkit-filter: drop-shadow(0 1px 2px rgba(255,255,255,0.9));
    filter: drop-shadow(0 1px 2px rgba(255,255,255,0.9));
}
.status-bar .flag-final { color: #2196f3; }
.status-bar .flag-maybe { color: #ff9800; }
.status-bar .flag-no { color: #f44336; }
.status-bar .flag-yes { color: #4caf50; }
.status-bar .thumb-fav-btn {
    pointer-events: auto;
    margin-left: auto;
    width: 28px; height: 28px;
    min-width: 28px; min-height: 28px;
    padding: 0; font-size: 13px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff;
    -webkit-filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    opacity: 0.9;
}
.status-bar .thumb-fav-btn:hover { opacity: 1; }
body.theme-light .status-bar .thumb-fav-btn { color: #2d3436; }
.img-card[data-fav="1"] .thumb-fav-btn,
.img-card.is-favorite .thumb-fav-btn,
.status-bar .thumb-fav-btn.is-favorite { color: #f44336; }
.img-card { display: block; }

@media (max-width: 900px) {
    .v-wrap { flex-direction: column; }
    .v-stage { height: 50vh; width: 100%; }
    .v-aside { width: 100%; height: 50vh; border-left: none; border-top: 1px solid var(--sf-border); }
}
