/* ========================================
   Photobooth Page Styles
   ======================================== */

/* Override navbar position for photobooth page */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.photobooth-page {
    min-height: 100vh;
    padding: calc(96px + 2rem) 1rem 2rem;
    position: relative;
    z-index: 1;
}

/* Photobooth Container */
.photobooth-container {
    max-width: 800px;
    margin: 0 auto 4rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 247, 228, 0.1);
}

.photobooth-title {
    font-family: 'JaneAust', cursive;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.photobooth-subtitle {
    text-align: center;
    font-size: 1.125rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Camera Section */
.camera-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 247, 228, 0.2);
}

/* Video element */
#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Preview canvas */
#preview-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Countdown Overlay */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.countdown-overlay.active {
    display: flex;
}

#countdown-number {
    font-family: 'JaneAust', cursive;
    font-size: clamp(5rem, 15vw, 10rem);
    color: #FFF7E4;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Camera Controls */
.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Photo Buttons */
.photo-button {
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-family: 'Antic Didone', serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #FFF7E4;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.photo-button.primary {
    background: rgba(255, 255, 255, 0.15);
    color: #FFF7E4;
}

.photo-button.primary:hover:not(:disabled) {
    background: #FFF7E4;
    color: #000000;
    box-shadow: 0 10px 30px rgba(255, 247, 228, 0.3);
}

.photo-button.secondary {
    background: rgba(0, 0, 0, 0.3);
    color: #FFF7E4;
}

.photo-button.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.photo-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview Controls */
#preview-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 247, 228, 0.3);
    border-top-color: #FFF7E4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#uploading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#uploading-state p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Status Messages */
.status-message {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    display: none;
    margin-top: 1rem;
}

.status-message.success {
    display: block;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #4CAF50;
}

.status-message.error {
    display: block;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #f44336;
}

/* Gallery Container */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.gallery-title {
    font-family: 'JaneAust', cursive;
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.gallery-subtitle {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 247, 228, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 247, 228, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery Placeholder */
.gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px dashed rgba(255, 247, 228, 0.3);
}

.gallery-placeholder p {
    font-size: 1.125rem;
    opacity: 0.7;
}

/* Gallery Loading */
#gallery-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 768px) {
    .photobooth-container {
        padding: 2rem 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    #preview-controls {
        flex-direction: column;
    }

    .photo-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .photobooth-container {
        padding: 1.5rem 1rem;
    }

    .camera-wrapper {
        aspect-ratio: 3 / 4;
    }

    .photo-button {
        padding: 0.875rem 2rem;
        font-size: 0.9375rem;
    }
}
