/* RevierCam - Basis-Styles */

:root {
    --color-primary: #2d5a27;
    --color-primary-dark: #1e3d1a;
    --color-primary-light: #3a7a32;
    --color-bg: #f2f2f7;
    --color-surface: #ffffff;
    --color-surface-hover: #f0f0f5;
    --color-text: #1c1c1e;
    --color-text-muted: #6e6e73;
    --color-border: #d1d1d6;
    --color-error: #ff3b30;
    --color-error-dark: #d63a31;
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-accent: #007aff;
    --radius: 12px;
    --radius-small: 8px;
    --shadow-btn: 0 2px 6px rgba(0, 0, 0, 0.1);
    --shadow-btn-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

/* Header */
.header {
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
}

.header h1 {
    font-size: 1.3rem;
    color: var(--color-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 50%);
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn-hover);
}

.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary,
.btn-primary .icon,
.btn-primary:hover,
.btn-primary:active {
    color: #ffffff !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.btn-danger,
.btn-danger .icon,
.btn-danger:hover,
.btn-danger:active {
    color: #ffffff !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6259, var(--color-error));
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--color-error), var(--color-error-dark));
}

.btn-ghost {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text);
    box-shadow: none;
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

.btn-ghost:active {
    background: rgba(0, 0, 0, 0.12);
    box-shadow: none;
}

.btn-small {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-small);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Formulare */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
    color: var(--color-text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.15);
    background: var(--color-surface);
}

/* Login/Register Container */
.auth-container {
    max-width: 420px;
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-border);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-primary);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-container .btn {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.8rem;
    font-size: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.9rem;
}

.auth-link a {
    color: var(--color-primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: var(--color-success);
}

/* Galerie Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px;
}

@media (min-width: 768px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 12px;
    }
}

@media (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(6, 1fr);
    }
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.gallery-item:active {
    transform: scale(0.96);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item .video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gallery-item .date-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: rgba(255, 255, 255, 0.9);
    padding: 2rem 0.6rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Auswahlmodus */
.select-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.select-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.select-actions .btn {
    box-shadow: none;
    border-radius: var(--radius-small);
}

.select-actions .btn-ghost,
.select-actions .btn-ghost .icon {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.select-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
}

.header-buttons {
    display: flex;
    gap: 0.4rem;
}

/* Desktop: Buttons sichtbar, Burger versteckt */
.header-desktop {
    display: flex;
}

.header-mobile {
    display: none;
}

@media (max-width: 768px) {
    .header-desktop {
        display: none;
    }

    .header-mobile {
        display: block;
    }
}

/* Burger Menu */
.burger-wrap {
    position: relative;
}

.burger-btn {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-small);
    transition: background 0.2s;
}

.burger-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.burger-btn .icon {
    font-size: 28px;
}

.burger-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 150;
    overflow: hidden;
    animation: menuSlideDown 0.15s ease;
}

.burger-menu.open {
    display: block;
}

@keyframes menuSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.burger-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background 0.15s;
}

.burger-menu-item:hover {
    background: var(--color-surface-hover);
}

.burger-menu-item:active {
    background: rgba(0, 0, 0, 0.08);
}

.burger-menu-item .icon {
    color: var(--color-primary);
    font-size: 22px;
}

.burger-menu-item:last-child .icon {
    color: var(--color-error);
}

/* Checkbox im Gallery-Item */
.select-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 10;
}

.select-mode .select-checkbox {
    display: block;
}

.gallery-item.selected .select-checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.gallery-item.selected .select-checkbox::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.gallery-item.selected {
    outline: 3px solid var(--color-primary);
    outline-offset: -3px;
    box-shadow: 0 0 0 2px var(--color-primary), 0 4px 12px rgba(45, 90, 39, 0.25);
}

.gallery-item.selected img {
    opacity: 0.75;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Media Container */
.lightbox-media {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    padding: 3rem 0.5rem;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease, opacity 0.15s ease;
    border-radius: 4px;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Zaehler */
.lightbox-counter {
    position: absolute;
    top: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 210;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

/* Navigation Pfeile - Desktop */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Mobile: Pfeile ausblenden (Swipe stattdessen) */
@media (max-width: 768px) {
    .lightbox-nav {
        display: none;
    }

    .lightbox-media {
        padding: 2.5rem 0;
    }

    .lightbox-close {
        top: 0.4rem;
        right: 0.4rem;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .lightbox-counter {
        top: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .lightbox-nav {
        width: 46px;
        height: 46px;
    }

    .lightbox-prev { left: 0.6rem; }
    .lightbox-next { right: 0.6rem; }
}

/* Grosser Desktop */
@media (min-width: 1400px) {
    .lightbox-nav {
        width: 60px;
        height: 60px;
    }

    .lightbox-prev { left: 2rem; }
    .lightbox-next { right: 2rem; }
}

/* Info-Leiste unten */
.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 2.5rem 1rem 0.8rem;
    color: white;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 205;
}

.lightbox-info-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.lightbox-info-actions {
    display: flex;
    gap: 0.4rem;
}

.lightbox-info .btn {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-info .btn-ghost,
.lightbox-info .btn-ghost .icon {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.lightbox-info .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Mobile: Info kompakter */
@media (max-width: 768px) {
    .lightbox-info {
        padding: 2rem 0.6rem 0.6rem;
    }

    .lightbox-info-actions .btn {
        padding: 0.35rem 0.6rem;
    }
}

/* Filter-Leiste */
.filters {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
}

.filters select,
.filters input {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.82rem;
    transition: border-color 0.2s;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--color-primary-light);
}

/* Meldungen */
.message {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-small);
    margin: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-error {
    background: rgba(255, 59, 48, 0.08);
    color: var(--color-error);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.message-success {
    background: rgba(52, 199, 89, 0.08);
    color: #1a8a3e;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

/* Admin-Bereich */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.admin-table th,
.admin-table td {
    padding: 0.7rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

.admin-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.admin-table tr:hover td {
    background: var(--color-surface-hover);
}

/* Leerer Zustand */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Kamera-Verwaltung */
.camera-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    box-shadow: var(--shadow-card);
}

.camera-info {
    flex: 1;
    min-width: 0;
}

.camera-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.camera-name .icon {
    color: var(--color-primary);
}

.camera-stats {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.camera-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}

.camera-actions {
    display: flex;
    gap: 0.3rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}
