/* ==========================================================================
 * WP_GlowGallery — Frontend Styles
   Elegantes, dunkles Design für Fotografen-Galerien
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --fg-bg: #0a0a0a;
    --fg-bg-card: #141414;
    --fg-bg-elevated: #1a1a1a;
    --fg-bg-hover: #222222;
    --fg-surface: #1e1e1e;
    --fg-border: #2a2a2a;
    --fg-border-hover: #3a3a3a;
    --fg-text: #e8e8e8;
    --fg-text-muted: #888888;
    --fg-text-dim: #666666;
    --fg-accent: #c9a96e;
    --fg-accent-hover: #dbb97e;
    --fg-accent-dim: rgba(201, 169, 110, 0.15);
    --fg-danger: #e74c3c;
    --fg-success: #2ecc71;
    --fg-overlay: rgba(0, 0, 0, 0.85);
    --fg-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --fg-shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
    --fg-radius: 12px;
    --fg-radius-sm: 8px;
    --fg-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --fg-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Base ---------- */
.fg-page,
.fg-login-page {
    font-family: var(--fg-font);
    background: var(--fg-bg);
    color: var(--fg-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Login Page ---------- */
.fg-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

.fg-login-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.3);
    transform: scale(1.2);
    z-index: 0;
}

.fg-login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.fg-login-card {
    background: var(--fg-bg-card);
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius);
    box-shadow: var(--fg-shadow-lg);
    position: relative;
    overflow: hidden;
}

.fg-login-preview {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--fg-surface);
}

.fg-login-body {
    padding: 36px 36px 48px;
}

.fg-login-card:not(:has(.fg-login-preview))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fg-accent), var(--fg-accent-hover), var(--fg-accent));
}

.fg-login-card:not(:has(.fg-login-preview)) .fg-login-body {
    padding-top: 48px;
}

.fg-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.fg-login-icon {
    color: var(--fg-accent);
    margin-bottom: 20px;
}

.fg-login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fg-text);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.fg-login-subtitle {
    font-size: 0.9rem;
    color: var(--fg-text-muted);
    margin: 0;
    line-height: 1.5;
}

.fg-login-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 12px 16px;
    border-radius: var(--fg-radius-sm);
    margin-bottom: 24px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fg-form-group {
    margin-bottom: 24px;
}

.fg-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fg-input-wrapper {
    position: relative;
}

.fg-input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    background: var(--fg-surface);
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius-sm);
    color: var(--fg-text);
    font-family: var(--fg-font);
    font-size: 0.95rem;
    transition: var(--fg-transition);
    outline: none;
    box-sizing: border-box;
}

.fg-input-wrapper input:focus {
    border-color: var(--fg-accent);
    box-shadow: 0 0 0 3px var(--fg-accent-dim);
}

.fg-input-wrapper input::placeholder {
    color: var(--fg-text-dim);
}

.fg-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--fg-text-dim);
    cursor: pointer;
    padding: 4px;
    transition: var(--fg-transition);
}

.fg-toggle-password:hover {
    color: var(--fg-text);
}

.fg-login-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--fg-accent);
    color: #0a0a0a;
    border: none;
    border-radius: var(--fg-radius-sm);
    font-family: var(--fg-font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--fg-transition);
}

.fg-login-btn:hover {
    background: var(--fg-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 110, 0.3);
}

.fg-login-footer {
    text-align: center;
    color: var(--fg-text-dim);
    font-size: 0.8rem;
    margin-top: 24px;
}

/* ---------- Hero Header ---------- */
.fg-hero {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    max-height: 800px;
    background-size: cover;
    background-position: center;
    background-color: var(--fg-surface);
    position: relative;
}

.fg-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-end;
}

.fg-hero-content {
    padding: 48px 48px 56px;
    width: 100%;
}

.fg-hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    margin: 0 0 8px;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.fg-hero-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 24px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.fg-hero-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-family: var(--fg-font);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--fg-transition);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fg-hero-cta:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

/* ---------- Gallery Navigation Bar ---------- */
.fg-gallery-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--fg-bg);
    border-bottom: 1px solid var(--fg-border);
}

.fg-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    max-width: 100%;
}

.fg-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.fg-nav-project-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.fg-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fg-nav-tabs::-webkit-scrollbar {
    display: none;
}

.fg-nav-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-family: var(--fg-font);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--fg-text-muted);
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    transition: var(--fg-transition);
}

.fg-nav-tab:hover {
    color: var(--fg-text);
    background: var(--fg-bg-elevated);
}

.fg-nav-tab.active {
    color: var(--fg-text);
    font-weight: 500;
    background: var(--fg-bg-elevated);
}

.fg-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.fg-nav-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-family: var(--fg-font);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--fg-text-muted);
    text-decoration: none;
    transition: var(--fg-transition);
    border-radius: 4px;
}

.fg-nav-action:hover {
    color: var(--fg-text);
    background: var(--fg-bg-elevated);
}

.fg-nav-action svg {
    flex-shrink: 0;
}

/* ---------- Gallery Body ---------- */
.fg-gallery-body {
    padding: 24px 24px 60px;
    max-width: 100%;
}

/* ---------- Images Grid (Base) ---------- */
.fg-images-grid {
    padding-bottom: 60px;
    /* Default spacing (fg-gap-regular) */
    gap: 16px;
    column-gap: 16px;
}

/* Modifiers: Spacing */
.fg-images-grid.fg-gap-large {
    gap: 40px;
    column-gap: 40px;
}

/* ---------- Horizontal Style (Grid) ---------- */
.fg-images-grid.fg-style-horizontal {
    display: grid;
    /* Default size (fg-size-regular) */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.fg-images-grid.fg-style-horizontal.fg-size-large {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ---------- Vertical Style (Masonry) ---------- */
.fg-images-grid.fg-style-vertical {
    /* Default size (fg-size-regular) */
    column-count: auto;
    column-width: 260px;
}

.fg-images-grid.fg-style-vertical.fg-size-large {
    column-width: 380px;
}

/* Margin bottom for masonry cards based on gap */
.fg-images-grid.fg-style-vertical.fg-gap-regular .fg-image-card {
    margin-bottom: 16px;
}

.fg-images-grid.fg-style-vertical.fg-gap-large .fg-image-card {
    margin-bottom: 40px;
}

.fg-images-grid.fg-style-vertical .fg-image-card {
    break-inside: avoid;
    display: inline-block;
    /* Helps prevent breaking */
    width: 100%;
}


/* ---------- Card Base ---------- */
.fg-image-card {
    position: relative;
    border-radius: var(--fg-radius-sm);
    overflow: hidden;
    background: var(--fg-bg-card);
    border: 1px solid var(--fg-border);
    transition: var(--fg-transition);
}

.fg-image-card:hover {
    border-color: var(--fg-border-hover);
    box-shadow: var(--fg-shadow);
}

.fg-image-card.is-private {
    border-color: rgba(201, 169, 110, 0.25);
}

.fg-image-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Aspect Ratio based on Style */
.fg-images-grid.fg-style-horizontal .fg-image-wrapper {
    aspect-ratio: 1;
    /* Square for grid */
}

.fg-images-grid.fg-style-vertical .fg-image-wrapper {
    /* Natural aspect ratio for masonry, but set display block for images */
}

.fg-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fg-image-card:hover .fg-image-wrapper img {
    transform: scale(1.05);
}

/* Private Badge */
.fg-private-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--fg-accent);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    border: 1px solid rgba(201, 169, 110, 0.3);
}

/* Image Overlay */
.fg-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.fg-image-card:hover .fg-image-overlay {
    opacity: 1;
}

.fg-overlay-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fg-transition);
    text-decoration: none;
}

.fg-overlay-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.fg-overlay-btn.fg-toggle-private-btn:hover {
    color: var(--fg-accent);
    border-color: var(--fg-accent);
}

/* Image Filename Label */
.fg-image-name {
    padding: 8px 10px;
    font-size: 0.72rem;
    color: var(--fg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--fg-bg-card);
    border-top: 1px solid var(--fg-border);
}

/* ---------- Lightbox ---------- */
.fg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: var(--fg-overlay);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.fg-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: var(--fg-shadow-lg);
}

.fg-lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fg-transition);
    z-index: 10;
}

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

.fg-lightbox-prev,
.fg-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fg-transition);
    z-index: 10;
}

.fg-lightbox-prev {
    left: 24px;
}

.fg-lightbox-next {
    right: 24px;
}

.fg-lightbox-prev:hover,
.fg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Lightbox Toolbar (Download + Slideshow) */
.fg-lightbox-toolbar {
    position: fixed;
    top: 24px;
    right: 84px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.fg-lightbox-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fg-transition);
    text-decoration: none;
}

.fg-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.fg-lightbox-btn.active {
    background: var(--fg-accent);
    border-color: var(--fg-accent);
    color: #0a0a0a;
}

/* ---------- Empty State ---------- */
.fg-empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--fg-text-dim);
}

.fg-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.fg-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .fg-hero {
        height: 50vh;
        min-height: 300px;
    }

    .fg-hero-content {
        padding: 24px 24px 32px;
    }

    .fg-hero-title {
        font-size: 1.8rem;
    }

    .fg-nav-inner {
        padding: 0 16px;
        height: 48px;
    }

    .fg-nav-project-name {
        display: none;
    }

    .fg-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .fg-image-overlay {
        opacity: 1;
        background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.6));
        align-items: flex-end;
        padding-bottom: 10px;
    }

    .fg-overlay-btn {
        width: 36px;
        height: 36px;
    }

    .fg-overlay-btn svg {
        width: 16px;
        height: 16px;
    }

    .fg-login-card {
        padding: 36px 24px;
    }

    .fg-lightbox-prev,
    .fg-lightbox-next {
        width: 44px;
        height: 44px;
    }

    .fg-lightbox-prev {
        left: 12px;
    }

    .fg-lightbox-next {
        right: 12px;
    }

    .fg-gallery-body {
        padding: 16px 12px 40px;
    }
}

@media (max-width: 480px) {
    .fg-hero {
        height: 40vh;
        min-height: 250px;
    }

    .fg-hero-title {
        font-size: 1.4rem;
    }

    .fg-hero-cta {
        padding: 8px 16px;
        font-size: 0.7rem;
    }

    .fg-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .fg-nav-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}