/* Fotowalks – Custom Styles */

/* ========================================
   Photo Grid
   ======================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 991px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* ========================================
   Thumbnail Styles
   ======================================== */
.photo-thumb {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.photo-item:hover .photo-thumb {
    transform: scale(1.03);
    opacity: 0.9;
}

.photo-link {
    display: block;
    position: relative;
}

/* ========================================
   Photographer Name Overlay (Grid)
   ======================================== */
.photographer-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 0.8rem;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Reaktionen-Overlay rechts neben dem Namen */
.reactions-overlay {
    display: flex;
    gap: 4px;
    pointer-events: none;
    flex-shrink: 0;
}

.reaction-badge {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.reaction-badge .bi {
    font-size: 0.75rem;
}

/* ========================================
   Walk Cards (Index)
   ======================================== */
.walk-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.walk-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.walk-card-img {
    height: 220px;
    object-fit: cover;
}

.walk-card-placeholder {
    height: 220px;
}

/* Album-Vorschau (Facebook-Stil) */
.walk-preview-grid {
    display: grid;
    gap: 2px;
    height: 220px;
    overflow: hidden;
}

/* 3+ Fotos: grosses Bild links, 2 rechts */
.walk-preview-grid.preview-3plus {
    grid-template-columns: 3fr 2fr;
}

/* 2 Fotos: nebeneinander */
.walk-preview-grid.preview-2 {
    grid-template-columns: 1fr 1fr;
}

.walk-preview-hero {
    overflow: hidden;
}

.walk-preview-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.walk-preview-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    min-height: 0;
}

.walk-preview-cell {
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.walk-preview-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.walk-preview-last {
    position: relative;
}

.walk-preview-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    pointer-events: none;
}

/* ========================================
   Sticky Toolbar
   ======================================== */
.walk-sticky-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 10px 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.walk-sticky-toolbar.is-stuck {
    border-bottom-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Filter Buttons
   ======================================== */
.photographer-filter {
    border-radius: 20px;
    transition: all 0.2s ease;
}

.photographer-filter.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}

.keyword-filter {
    border-radius: 20px;
    transition: all 0.2s ease;
}

.keyword-filter.active {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.4);
}

.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ========================================
   Upload Drop Zone
   ======================================== */
.drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    color: #6c757d;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
    color: #0d6efd;
}

.drop-zone.drag-over {
    background-color: rgba(13, 110, 253, 0.1);
}

/* ========================================
   Reaction Buttons
   ======================================== */
.reaction-btn {
    border-radius: 20px;
    transition: all 0.2s ease;
}

.reaction-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    transform: scale(1.1);
}

.reaction-btn:hover {
    transform: scale(1.1);
}

.reaction-names-list {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
}

.reaction-names-item {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.reaction-names-item .reaction-emoji {
    flex-shrink: 0;
}

.reactions-bar {
    flex-wrap: wrap;
}

/* ========================================
   Comment Section (allgemein)
   ======================================== */
.comment-list {
    overflow-y: auto;
    flex: 1;
}

.comment-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.comment-text {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 2px;
}

.comment-time {
    color: #999;
    font-size: 0.75rem;
}

/* ========================================
   Login Page
   ======================================== */
.login-wrapper {
    min-height: 80vh;
}

/* ========================================
   File List (Upload)
   ======================================== */
#fileList .file-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

#fileList .file-item .bi {
    color: #198754;
    margin-right: 6px;
}

/* ========================================
   Upload Progress
   ======================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-icon {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   Filtered-out Items
   ======================================== */
.photo-item.filtered-out {
    display: none;
}

/* ========================================
   Selection Mode (Mehrfachauswahl)
   ======================================== */
.selection-bar {
    display: flex;
    align-items: center;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.photo-grid.select-mode .photo-item {
    cursor: pointer;
}

.photo-grid.select-mode .photo-item.not-owned {
    opacity: 0.4;
    pointer-events: none;
}

.photo-grid.select-mode .photo-link {
    pointer-events: none;
}

.photo-item .select-check {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

.photo-grid.select-mode .photo-item:not(.not-owned) .select-check {
    display: flex;
}

.photo-item.selected .select-check {
    background: #0d6efd;
    border-color: #0d6efd;
}

.photo-item.selected .photo-thumb {
    outline: 3px solid #0d6efd;
    outline-offset: -3px;
}

/* ========================================
   Viewer (Vollbild mit Sidebar)
   ======================================== */
.viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #111;
    z-index: 9999;
    display: flex;
}

/* Bild-Bereich: nimmt den verfuegbaren Platz */
.viewer-image-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
    background: #000;
    min-width: 0;
    height: 100vh;
}

.viewer-image-area.is-zoomed {
    cursor: grab;
}

.viewer-image-area.is-dragging {
    cursor: grabbing;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: 0 0;
    will-change: transform;
}

.viewer-image.zoom-transition {
    transition: transform 0.25s ease;
}

/* Toolbar oben rechts */
.viewer-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10001;
}

.viewer-toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.viewer-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.viewer-toolbar-btn.active {
    background: rgba(13, 110, 253, 0.6);
}

/* Hilfe-Overlay */
.viewer-help-overlay {
    position: absolute;
    top: 70px;
    right: 16px;
    z-index: 10002;
}

.viewer-help-content {
    background: rgba(0, 0, 0, 0.85);
    color: #ddd;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-width: 240px;
}

.viewer-help-content h6 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 0.9rem;
}

.viewer-help-content dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
}

.viewer-help-content dt {
    color: #aaa;
    font-weight: 600;
    white-space: nowrap;
}

.viewer-help-content dd {
    margin: 0;
    color: #ccc;
}

/* Zoom-Indikator */
.viewer-zoom-indicator {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #ccc;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 10001;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

/* Navigation */
.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.6rem;
    width: 48px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10001;
}

.viewer-prev {
    left: 0;
    border-radius: 0 6px 6px 0;
}

.viewer-next {
    right: 0;
    border-radius: 6px 0 0 6px;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ========================================
   Sidebar
   ======================================== */
.viewer-sidebar {
    width: 360px;
    min-width: 360px;
    background: #1a1a1a;
    color: #ddd;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid #333;
}

.viewer-sidebar.hidden {
    display: none;
}

.viewer-sidebar-inner {
    padding: 20px;
}

/* Sidebar-Sektionen */
.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-heading {
    color: #999;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.sidebar-photographer {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

/* EXIF-Daten Grid */
.exif-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    font-size: 0.85rem;
}

.exif-label {
    color: #888;
    white-space: nowrap;
}

.exif-value {
    color: #ddd;
    word-break: break-word;
}

/* Keyword-Badges */
.keyword-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #ccc;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Kommentare in Sidebar */
.sidebar-comments-section {
    display: flex;
    flex-direction: column;
}

.sidebar-comments-section .comment-list {
    max-height: 300px;
}

/* ========================================
   Sidebar responsive (Mobile)
   ======================================== */
@media (max-width: 768px) {
    .viewer {
        flex-direction: column;
    }

    .viewer-image-area {
        flex: 1;
        height: auto;
        min-height: 0;
    }

    .viewer-sidebar {
        width: 100%;
        min-width: 100%;
        flex: 0 0 50%;
        height: auto;
        border-left: none;
        border-top: 1px solid #333;
        overflow-y: auto;
    }

    .viewer-sidebar.hidden {
        display: none;
    }
}
