/* CWH PhotoSelect - Gallery Viewer CSS */
.gallery-layout {
    min-height: 100vh;
    background: #080a0f;
    color: #e2e8f0;
    font-family: Inter, sans-serif
}

/* Header */
.gallery-header {
    background: rgba(18, 21, 28, .9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gallery-brand {
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #5b8ef0, #8b6cf4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

.gallery-event-title {
    font-size: 14px;
    color: #607080;
    flex: 1
}

.gallery-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.selection-counter {
    background: linear-gradient(135deg, #5b8ef0, #8b6cf4);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 99px;
}

/* Photo grid — masonry-like */
.gallery-body {
    padding: 24px
}

.photo-grid {
    column-count: 4;
    column-gap: 12px;
}

@media(max-width:1200px) {
    .photo-grid {
        column-count: 3
    }
}

@media(max-width:900px) {
    .photo-grid {
        column-count: 2
    }
}

@media(max-width:480px) {
    .photo-grid {
        column-count: 1
    }
}

.photo-card {
    break-inside: avoid;
    position: relative;
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .18s ease;
    background: #12151c;
}

.photo-card:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .6)
}

.photo-card.selected {
    border-color: #5b8ef0;
    box-shadow: 0 0 0 2px rgba(91, 142, 240, .3), 0 8px 32px rgba(0, 0, 0, .6)
}

.photo-card img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    line-height: 0
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}

.photo-card:hover .photo-overlay {
    background: rgba(0, 0, 0, .25)
}

.photo-select-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(.8);
    opacity: 0;
    transition: all .18s;
    cursor: pointer;
}

.photo-card:hover .photo-select-btn {
    transform: scale(1);
    opacity: 1
}

.photo-card.selected .photo-select-btn {
    background: #5b8ef0;
    border-color: #5b8ef0;
    opacity: 1;
    transform: scale(1);
}

.photo-selected-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #5b8ef0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s;
}

.photo-card.selected .photo-selected-badge {
    opacity: 1
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .2s;
}

.lightbox.open {
    opacity: 1;
    visibility: visible
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, .2)
}

.lightbox-prev {
    left: 16px
}

.lightbox-next {
    right: 16px
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px
}

.lightbox-select {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%)
}

/* Submit Bar */
.submit-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(12, 14, 20, .95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateY(100%);
    transition: transform .25s ease;
}

.submit-bar.visible {
    transform: translateY(0)
}

.submit-bar-text {
    flex: 1;
    font-size: 14px;
    color: #607080
}

.submit-bar-count {
    font-size: 22px;
    font-weight: 800;
    color: #5b8ef0
}

/* Register / PIN forms */
.gallery-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(91, 142, 240, .08), transparent 60%), #080a0f;
    padding: 24px;
}

.gate-card {
    width: 100%;
    max-width: 440px;
    background: #12151c;
    border: 1px solid #22283a;
    border-radius: 16px;
    padding: 36px;
}

.gate-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #5b8ef0, #8b6cf4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}