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

:root {
    /* CSS custom properties for viewport adjustments */
    --viewport-bottom-offset: 0px;
    --viewport-height: 100vh;
    /* Safe area insets for notched devices */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #2a2a2a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ffffff;
}

.container {
    background: rgba(42, 42, 42, 0.95);
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 60px 40px 40px;
    max-width: 650px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.the-wedding {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
    letter-spacing: 3px;
    color: #ffffff;
    font-weight: 300;
    margin-bottom: 10px;
}

.wedding-script {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8em;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 1px;
    text-transform: none;
}

.names {
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    text-align: center;
    margin: 15px 0;
    font-size: 2.5em;
    font-weight: 300;
    letter-spacing: 8px;
}

.date-location {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75em;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    margin-top: 10px;
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 35px;
    font-size: 0.95em;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.capture-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: -webkit-fill-available;
    height: 100vh;
    max-height: 100vh;
    background: rgba(0, 0, 0, 1);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Native fullscreen mode styling */
.capture-area:fullscreen,
.capture-area:-webkit-full-screen,
.capture-area:-moz-full-screen,
.capture-area:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
}

.capture-area.visible {
    display: flex;
    transform: translateY(0);
}

.capture-area.hiding {
    transform: translateY(100%);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Exit fullscreen button */
.exit-fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.exit-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Compact exit button in fullscreen */
.capture-area:fullscreen .exit-fullscreen-btn,
.capture-area:-webkit-full-screen .exit-fullscreen-btn,
.capture-area:-moz-full-screen .exit-fullscreen-btn,
.capture-area:-ms-fullscreen .exit-fullscreen-btn {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.capture-area.visible {
    display: flex;
}

/* Camera Mode Selector (iOS-style) */
.mode-selector {
    position: relative;
    display: flex;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.mode-selector.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.mode-selector-track {
    display: flex;
    gap: 10px;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    justify-content: center;
}

.mode-selector-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
}

.mode-selector-item:hover {
    color: rgba(255, 255, 255, 0.8);
}

.mode-selector-item.active {
    color: #FFD700;
    font-size: 18px;
}

/* Compact mode selector in fullscreen */
.capture-area:fullscreen .mode-selector-item,
.capture-area:-webkit-full-screen .mode-selector-item,
.capture-area:-moz-full-screen .mode-selector-item,
.capture-area:-ms-fullscreen .mode-selector-item {
    font-size: 13px;
    padding: 6px 10px;
}

.capture-area:fullscreen .mode-selector-item.active,
.capture-area:-webkit-full-screen .mode-selector-item.active,
.capture-area:-moz-full-screen .mode-selector-item.active,
.capture-area:-ms-fullscreen .mode-selector-item.active {
    font-size: 16px;
}

/* Switch Camera Overlay Button */
.switch-camera-overlay {
    position: absolute;
    right: 50%;
    margin-right: -130px;
    margin-bottom: 5px;
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.switch-camera-overlay svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.switch-camera-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.switch-camera-overlay:active {
    transform: scale(0.95);
}

.switch-camera-overlay.switching svg {
    animation: rotateSwitchIcon 0.6s ease;
}

@keyframes rotateSwitchIcon {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.photo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

#videoPreview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.mode-btn {
    flex: 1;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.3), rgba(139, 115, 85, 0.15));
    border: 3px solid rgba(139, 115, 85, 0.6);
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}
.mode-btn .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    line-height: 1;
    transform: translateY(-1px);
}

.mode-btn span + span,
.mode-btn .icon + span {
    display: inline-flex;
    align-items: center;
}

.mode-btn:hover {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.5), rgba(139, 115, 85, 0.25));
    border-color: rgba(139, 115, 85, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.7), rgba(139, 115, 85, 0.4));
    border-color: #8b7355;
    box-shadow: 0 0 25px rgba(139, 115, 85, 0.6), 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
}

/* Recording Timer */
.recording-timer {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(220, 38, 38, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    z-index: 10;
}

/* Compact recording timer in fullscreen */
.capture-area:fullscreen .recording-timer,
.capture-area:-webkit-full-screen .recording-timer,
.capture-area:-moz-full-screen .recording-timer,
.capture-area:-ms-fullscreen .recording-timer {
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    font-size: 14px;
}

/* Active Quest Overlay */
.active-quest-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: calc(100% - 140px); /* Leave space for side buttons */
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.95), rgba(139, 115, 85, 0.85));
    border: 2px solid rgba(139, 115, 85, 1);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    z-index: 9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Compact quest overlay in fullscreen */
.capture-area:fullscreen .active-quest-overlay,
.capture-area:-webkit-full-screen .active-quest-overlay,
.capture-area:-moz-full-screen .active-quest-overlay,
.capture-area:-ms-fullscreen .active-quest-overlay {
    top: 10px;
    padding: 8px 12px;
    font-size: 14px;
    width: calc(100% - 100px);
}

.active-quest-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.active-quest-icon {
    font-size: 1.8em;
    line-height: 1;
    flex-shrink: 0;
}

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

.active-quest-title {
    font-size: 0.95em;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.active-quest-description {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cancel-quest-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cancel-quest-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Capture Button Overlay (Native Camera Style) */
.capture-overlay {
    position: absolute;
    bottom: max(var(--viewport-bottom-offset, 0px), var(--safe-area-bottom, 0px));
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 20px 30px 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Reduced spacing in fullscreen mode */
.capture-area:fullscreen .capture-overlay,
.capture-area:-webkit-full-screen .capture-overlay,
.capture-area:-moz-full-screen .capture-overlay,
.capture-area:-ms-fullscreen .capture-overlay {
    padding: 10px 15px 15px 15px;
    background: rgba(0, 0, 0, 0.2);
}

.capture-overlay > * {
    pointer-events: auto;
}

.capture-btn {
    width: 70px;
    height: 70px;
    background: transparent;
    border: 4px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

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

.capture-btn:active {
    transform: scale(0.95);
}

.capture-btn-inner {
    width: 58px;
    height: 58px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Video mode styling */
.capture-btn.video-mode .capture-btn-inner {
    background: #dc2626;
    border-radius: 8px;
    width: 40px;
    height: 40px;
}

.capture-btn.video-mode.recording .capture-btn-inner {
    width: 30px;
    height: 30px;
}

.stop-recording-btn {
    width: 70px;
    height: 70px;
    background: rgba(220, 38, 38, 0.9);
    border: 4px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

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

.stop-recording-btn:active {
    transform: scale(0.95);
}

.stop-icon {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 4px;
}

/* Preview Action Buttons Overlay */
.preview-actions-overlay {
    position: absolute;
    bottom: max(calc(40px + var(--viewport-bottom-offset, 0px)), calc(40px + var(--safe-area-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

/* Reduced spacing in fullscreen mode */
.capture-area:fullscreen .preview-actions-overlay,
.capture-area:-webkit-full-screen .preview-actions-overlay,
.capture-area:-moz-full-screen .preview-actions-overlay,
.capture-area:-ms-fullscreen .preview-actions-overlay {
    bottom: 20px;
}

.preview-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.preview-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.preview-action-btn:active {
    transform: translateY(0);
}

.preview-action-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.preview-action-btn.retake-btn:hover {
    border-color: rgba(239, 68, 68, 0.6);
}

.preview-action-btn.upload-btn {
    background: rgba(16, 185, 129, 0.3);
}

.preview-action-btn.upload-btn:hover {
    background: rgba(16, 185, 129, 0.5);
    border-color: rgba(16, 185, 129, 0.8);
}

/* Compact buttons in fullscreen mode */
.capture-area:fullscreen .preview-action-btn,
.capture-area:-webkit-full-screen .preview-action-btn,
.capture-area:-moz-full-screen .preview-action-btn,
.capture-area:-ms-fullscreen .preview-action-btn {
    padding: 12px 20px;
    min-width: 90px;
    font-size: 13px;
}

#videoPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.divider {
    text-align: center;
    position: relative;
    margin: 15px 0;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: #2a2a2a;
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    letter-spacing: 2px;
    font-weight: 300;
}

.btn {
    padding: 14px 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary.sending {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: wait;
    animation: pulse-sending 1.5s ease-in-out infinite;
}

@keyframes pulse-sending {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.btn-success {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-success:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn-upload {
    background: rgba(255, 255, 255, 0.95);
    color: #2a2a2a;
    font-size: 15px;
    padding: 16px 40px;
    border: none;
    font-weight: 500;
}

.btn-upload:hover {
    background: white;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.file-upload-btn {
    position: relative;
    overflow: hidden;
}

.icon {
    font-size: 1.2em;
}

/* Thumbnail Carousel */
.thumbnail-carousel-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view-gallery-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.view-gallery-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.view-gallery-btn .icon {
    font-size: 1.2em;
}

.thumbnail-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep scrolling functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.thumbnail-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.carousel-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    opacity: 0.8;
    /* Respect EXIF orientation from native camera */
    image-orientation: from-image;
}

.carousel-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.carousel-thumbnail-wrapper {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-thumbnail-wrapper canvas,
.carousel-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
}

.carousel-video-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    pointer-events: none;
    z-index: 3;
}

.thumbnail-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.15);
    border-radius: inherit;
    z-index: 2;
}

.thumbnail-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: thumbnail-spin 0.9s linear infinite;
}

.thumbnail-loading-overlay.thumbnail-loading-small .thumbnail-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes thumbnail-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.thumbnail-loading-error {
    background: rgba(0, 0, 0, 0.35);
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.carousel-loading {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.carousel-empty {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 30px 20px;
    font-size: 1em;
    letter-spacing: 1px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
}

.files-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.files-list h3 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.files-list ul {
    list-style: none;
}

.files-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.files-list li .file-name {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.files-list li .file-size {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85em;
}

.status {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 400;
    display: none;
    letter-spacing: 0.5px;
}

.status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

.status.info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: block;
}

/* Upload Modal Overlay */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.upload-modal-content {
    background: rgba(42, 42, 42, 0.98);
    border: 2px solid rgba(205, 127, 50, 0.3);
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.upload-modal-content h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin: 20px 0;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #cd7f32, #b8860b);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 20px;
}

.upload-progress-text {
    color: #cd7f32;
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0 0 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Gallery Modal Styles */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 1000;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-modal.active {
    display: flex;
    flex-direction: column;
}

.gallery-modal.slide-up {
    transform: translateY(0);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-title {
    font-family: 'Montserrat', sans-serif;
    color: white;
    font-size: 1.5em;
    font-weight: 300;
    letter-spacing: 3px;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 2em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px 0;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.gallery-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    overflow: hidden;
    min-height: 0;
}

.gallery-container > .nav-btn {
    position: absolute;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-container > .nav-prev {
    left: 20px;
}

.gallery-container > .nav-next {
    right: 20px;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    height: 100%;
    width: 100%;
    position: relative;
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: absolute;
    transition: none;
    z-index: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transform-origin: center center;
    /* Respect EXIF orientation from native camera */
    image-orientation: from-image;
}

/* Hide browser's native video error messages */
video.gallery-image::after,
video.gallery-image::before {
    display: none !important;
    content: none !important;
}

#galleryVideo::-webkit-media-controls-panel {
    display: flex !important;
}

#galleryVideo::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* Ensure no error overlays appear on video */
#galleryVideo[error] {
    background: transparent !important;
}

#galleryVideo::cue {
    display: none !important;
}

/* Hide any error text that appears near video player */
#photoModal video + *[style*="color"] {
    display: none !important;
}

/* Suppress any HLS.js error overlays */
.hls-error,
.video-error,
[class*="error"][class*="hls"],
[class*="error"][class*="video"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide text nodes containing error messages */
#photoModal::before {
    content: '' !important;
}

.gallery-image.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.gallery-image.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

.gallery-image.slide-out-left {
    animation: slideOutLeft 0.4s ease-out forwards;
}

.gallery-image.slide-out-right {
    animation: slideOutRight 0.4s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.gallery-loading,
.gallery-empty {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2em;
    text-align: center;
    font-weight: 300;
    letter-spacing: 1px;
}

.photo-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    z-index: 4;
    border-radius: 8px;
    text-align: center;
    padding: 20px;
}

.photo-loading-spinner .photo-spinner-thumb {
    position: static;
    width: auto;
    height: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.photo-loading-spinner .photo-spinner-thumb .thumbnail-spinner {
    width: 28px;
    height: 28px;
}

.photo-loading-spinner p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.nav-btn {
    background: rgba(12, 12, 16, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    font-size: 3em;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0.8;
    padding: 0 0 5px 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transform-origin: center center;
}

.nav-prev {
    padding: 0 4px 6px 0;
}

.nav-next {
    padding: 0 0 6px 4px;
}

/* Hover effect for desktop only */
@media (hover: hover) and (pointer: fine) {
    .nav-btn:hover {
        background: rgba(12, 12, 16, 0.65);
        border-color: rgba(255, 255, 255, 0.5);
    }
}

/* Active state for touch devices */
.nav-btn:active {
    background: rgba(12, 12, 16, 0.65);
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.1);
}

.gallery-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 15px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
    position: relative;
    min-height: 60px;
}

.photo-counter {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    letter-spacing: 1px;
}

.photo-name {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85em;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: -1;
}

.toggle-grid-btn {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toggle-grid-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toggle-grid-btn .icon {
    font-size: 1.1em;
}

.like-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
}

.like-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-btn.liked {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.like-btn.liked .like-icon {
    filter: grayscale(0);
}

.like-btn.liked-animation {
    animation: likeAnimation 0.6s ease;
}

@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.like-icon {
    font-size: 1.1em;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.like-btn.liked .like-icon {
    filter: grayscale(0);
}

.like-count {
    font-weight: 600;
    font-size: 0.95em;
    min-width: 20px;
    text-align: center;
}

.comments-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
}

.comments-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.comments-icon {
    font-size: 1.1em;
}

.comment-count {
    font-weight: 600;
    font-size: 0.95em;
    min-width: 20px;
    text-align: center;
}

.delete-photo-btn {
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: rgba(255, 150, 150, 0.95);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.delete-photo-btn:hover {
    background: rgba(255, 100, 100, 0.25);
    border-color: rgba(255, 100, 100, 0.6);
    color: rgba(255, 180, 180, 1);
    transform: scale(1.05);
}

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

.delete-icon {
    font-size: 1.1em;
}

.delete-text {
    font-weight: 600;
    font-size: 0.95em;
}

/* Comments Panel */
.comments-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.comments-panel.active {
    transform: translateY(0);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-header h3 {
    color: white;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0;
}

.comments-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.refresh-comments-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.refresh-comments-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.refresh-comments-btn:disabled {
    cursor: not-allowed;
}

.close-comments-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.close-comments-btn:hover {
    opacity: 0.7;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    min-height: 150px;
    max-height: calc(60vh - 140px);
}

.comments-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px;
    font-size: 0.9em;
}

.comment-item {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.comment-item.own-comment {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: rgba(255, 215, 0, 0.5);
}

.comment-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-text {
    color: white;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.comment-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.comment-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
}

.like-comment-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.like-comment-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: scale(1.05);
}

.like-comment-btn.liked {
    border-color: rgba(255, 100, 100, 0.5);
    background: rgba(255, 100, 100, 0.1);
}

.like-comment-btn .like-icon {
    font-size: 0.9em;
    line-height: 1;
}

.like-comment-btn .like-count {
    font-size: 1em;
    font-weight: 600;
}

.reply-comment-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.3s ease;
}

.reply-comment-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.delete-comment-btn {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: rgba(255, 100, 100, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.3s ease;
}

.delete-comment-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.8);
}

.comments-input-container {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 20, 0.5);
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
    resize: vertical;
    min-height: 40px;
    max-height: 120px;
}

.comment-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.comment-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.submit-comment-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.submit-comment-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.submit-comment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Comment replies / threading */
.comment-replies {
    margin-top: 10px;
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.comment-reply {
    margin-bottom: 10px;
}

.comment-reply .comment-item {
    padding: 10px;
    margin-bottom: 0;
}

/* Reply form */
.reply-form {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.reply-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85em;
    resize: vertical;
    min-height: 40px;
    max-height: 100px;
    box-sizing: border-box;
}

.reply-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.reply-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.cancel-reply-btn,
.submit-reply-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-reply-btn {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

.cancel-reply-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.submit-reply-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.submit-reply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 30px 20px;
    display: none;
    box-sizing: border-box;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.grid-view::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.grid-view.active {
    display: block;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 100%;
}

.grid-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    grid-column: 1 / -1;
}

.grid-loading .spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    animation: thumbnail-spin 0.8s linear infinite;
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
    opacity: 0;
    animation: fadeInGrid 0.4s ease-out forwards;
}

@keyframes fadeInGrid {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.grid-item img,
.grid-item canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    overflow: hidden;
}

.grid-item-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.grid-item-video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    z-index: 2;
}

.thumbnail-video-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    pointer-events: none;
    z-index: 3;
}

.grid-item-likes {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-size: 0.85em;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.grid-like-icon {
    font-size: 1em;
    filter: grayscale(0);
}

.grid-like-count {
    font-weight: 600;
    font-size: 0.9em;
}

.grid-item-comments {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-size: 0.85em;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.grid-comment-icon {
    font-size: 1em;
}

.grid-comment-count {
    font-weight: 600;
    font-size: 0.9em;
}

/* When both likes and comments exist, offset them */
.grid-item-likes + .grid-item-comments {
    left: auto;
    right: 8px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 20px 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.thumbnail-wrapper {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: visible;
}

.thumbnail-wrapper canvas,
.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
}

/* Thumbnail badges */
.thumbnail-likes,
.thumbnail-comments {
    position: absolute;
    bottom: 4px;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 2px 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    color: white;
    font-size: 0.7em;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.thumbnail-likes {
    left: 4px;
}

.thumbnail-comments {
    right: 4px;
}

.thumbnail-like-icon,
.thumbnail-comment-icon {
    font-size: 0.9em;
}

.thumbnail-like-count,
.thumbnail-comment-count {
    font-weight: 600;
    font-size: 0.85em;
}

/* Admin Link */
.admin-link-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-link {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    font-size: 0.75em;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    font-weight: 300;
}

.admin-link:hover {
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    .names {
        font-size: 2em;
        letter-spacing: 5px;
    }

    .the-wedding {
        font-size: 0.8em;
    }

    .wedding-script {
        font-size: 1.5em;
    }

    .btn {
        padding: 12px 24px;
        font-size: 13px;
    }

    /* Gallery mobile adjustments */
    .gallery-header {
        padding: 15px 20px;
    }

    .gallery-title {
        font-size: 1.2em;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }

    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 2em;
        margin: 0 10px;
    }

    .gallery-info {
        padding: 10px 5px;
        gap: 8px;
    }
    
    .photo-counter {
        left: 5px;
        font-size: 0.75em;
    }
    
    .toggle-grid-btn {
        right: 5px;
        font-size: 0.75em;
        padding: 6px 8px;
        gap: 4px;
    }
    
    .like-btn,
    .comments-btn {
        font-size: 0.85em;
        padding: 6px 10px;
        gap: 4px;
    }
    
    .like-btn .icon,
    .comments-btn .icon {
        font-size: 1em;
    }

    .gallery-thumbnails {
        padding: 15px 20px;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
    }
}

/* ========================================
   Guest Login & Profile Styles
   ======================================== */

/* Login Button (Top Right) */
.login-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85em;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.login-btn.logged-in {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.login-btn.logged-in {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    padding: 4px;
    min-width: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    justify-content: center;
}

.login-btn.logged-in:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

.login-btn.logged-in svg {
    display: none;
}

.login-btn-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* Letter Avatar Styles */
.letter-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    flex-shrink: 0;
}

.letter-avatar-small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.letter-avatar-medium {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.letter-avatar-large {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

/* Quests Button */
.quests-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(139, 115, 85, 0.3);
    border: 1px solid rgba(139, 115, 85, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85em;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.quests-btn:hover {
    background: rgba(139, 115, 85, 0.4);
    border-color: rgba(139, 115, 85, 0.7);
    transform: translateY(-1px);
}

.quests-badge {
    background: #dc2626;
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Quests Modal */
.quests-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quests-modal.fade-in {
    opacity: 1;
}

.quests-modal-content {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.quests-modal.fade-in .quests-modal-content {
    transform: scale(1);
}

.quests-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quests-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8em;
    color: #fff;
    margin: 0;
}

.quests-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.quest-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.quest-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.quest-tab.active {
    color: #fff;
    border-bottom-color: rgba(139, 115, 85, 0.8);
    background: rgba(139, 115, 85, 0.1);
}

.quests-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Quest Progress Bar */
.quests-progress {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.progress-text {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-weight: 500;
}

.progress-text span {
    color: #fff;
    font-weight: 600;
}

.progress-bar-quest {
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill-quest {
    height: 100%;
    background: linear-gradient(90deg, rgba(139, 115, 85, 0.8), rgba(139, 115, 85, 1));
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(139, 115, 85, 0.5);
}

/* Quest List */
.quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quest-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 115, 85, 0.4);
    transform: translateX(4px);
}

.quest-item.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.quest-item.completed:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.quest-item.active-quest {
    background: rgba(139, 115, 85, 0.2);
    border-color: rgba(139, 115, 85, 0.5);
    box-shadow: 0 0 15px rgba(139, 115, 85, 0.3);
}

.quest-item.active-quest:hover {
    background: rgba(139, 115, 85, 0.25);
    border-color: rgba(139, 115, 85, 0.6);
}

.quest-header {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 8px;
}

.quest-icon {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.quest-info {
    flex: 1;
}

.quest-title {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quest-description {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.quest-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-points {
    color: rgba(139, 115, 85, 1);
    font-weight: 600;
}

.quest-check {
    margin-left: auto;
    color: #10b981;
    font-size: 1.2em;
}

.quest-active-badge {
    margin-left: 8px;
    background: rgba(139, 115, 85, 0.8);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.quest-start-hint {
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85em;
    font-style: italic;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 115, 85, 0.4);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border-color: rgba(192, 192, 192, 0.4);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border-color: rgba(205, 127, 50, 0.4);
}

.leaderboard-rank {
    font-size: 1.2em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
    text-align: center;
}

.leaderboard-item.top-1 .leaderboard-rank {
    color: #ffd700;
    font-size: 1.5em;
}

.leaderboard-item.top-2 .leaderboard-rank {
    color: #c0c0c0;
    font-size: 1.4em;
}

.leaderboard-item.top-3 .leaderboard-rank {
    color: #cd7f32;
    font-size: 1.3em;
}

.leaderboard-item.current-user {
    border: 2px solid rgba(139, 115, 85, 0.8);
    background: rgba(139, 115, 85, 0.1);
}

.leaderboard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.leaderboard-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-item .letter-avatar {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.leaderboard-stats {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-score {
    font-size: 1.2em;
    font-weight: 700;
    color: rgba(139, 115, 85, 1);
}

.leaderboard-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

/* Quest Completion Notification */
.quest-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(16, 185, 129, 0.85));
    border: 2px solid rgba(16, 185, 129, 1);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.3);
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 320px;
}

.quest-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.quest-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quest-notification-icon {
    font-size: 2em;
    line-height: 1;
}

.quest-notification-text {
    flex: 1;
}

.quest-notification-text strong {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.quest-notification-text p {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 4px 0;
}

.quest-notification-points {
    font-size: 0.85em;
    font-weight: 600;
    color: #ffd700;
}

/* Quest Start Notification */
.quest-start-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.95), rgba(139, 115, 85, 0.85));
    border: 2px solid rgba(139, 115, 85, 1);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 115, 85, 0.3);
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 320px;
}

.quest-start-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.quest-notification-hint {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* Guest Login Modal */
.guest-login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guest-login-modal.fade-in {
    opacity: 1;
}

.guest-login-modal-content {
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.guest-login-modal.fade-in .guest-login-modal-content {
    transform: scale(1);
}

.guest-login-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guest-login-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3em;
    font-weight: 400;
    letter-spacing: 1px;
}

.guest-login-body {
    padding: 30px 25px;
}

.avatar-section {
    margin-bottom: 30px;
    text-align: center;
}

.avatar-preview-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.avatar-preview,
.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

.avatar-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.name-section {
    margin-bottom: 20px;
}

.name-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
}

.guest-name-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.guest-name-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.input-hint {
    margin-top: 8px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.guest-login-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 4px;
    color: #fff;
    font-size: 0.85em;
    margin-top: 15px;
}

.guest-login-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guest-login-footer .btn {
    width: 100%;
    padding: 12px 24px;
}

.btn-save-profile {
    background: #22c55e !important;
    color: white !important;
    border-color: #22c55e !important;
}

.btn-save-profile:hover {
    background: #16a34a !important;
    border-color: #16a34a !important;
}

.btn-save-profile:disabled {
    background: rgba(34, 197, 94, 0.5) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-clear-profile {
    background: transparent !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-clear-profile:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* Avatar Capture Modal */
.avatar-capture-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.avatar-capture-content {
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.avatar-capture-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-capture-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
    font-weight: 400;
}

.avatar-capture-body {
    padding: 20px;
    background: #1a1a1a;
}

.avatar-video,
.avatar-capture-preview {
    width: 100%;
    max-width: 480px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    background: #000;
}

.avatar-video {
    transform: scaleX(-1);
}

.avatar-capture-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-capture-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Photo Submitter Overlay */
.photo-submitter-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.submitter-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.submitter-name {
    font-size: 0.9em;
    font-weight: 400;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Quest Badge Overlay */
.quest-badge-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.95), rgba(139, 115, 85, 0.85));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 12px;
    display: none;
    z-index: 5;
    border: 2px solid rgba(139, 115, 85, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.quest-badge-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quest-badge-icon {
    font-size: 1.8em;
    line-height: 1;
}

.quest-badge-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quest-badge-title {
    font-size: 0.95em;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.quest-badge-label {
    font-size: 0.75em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Comment Avatars */
.comment-thread {
    margin-bottom: 15px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    padding-left: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: flex-start;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.comment-avatar-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
}

.comment-avatar-letter .letter-avatar {
    width: 100%;
    height: 100%;
}

.comment-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

.comment-avatar-anonymous {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.2);
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.comment-replies {
    margin-left: 48px;
    margin-top: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .login-btn {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .login-btn.logged-in {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    
    .login-btn.logged-in .login-btn-avatar {
        width: 28px;
        height: 28px;
    }
    
    .quests-btn {
        top: 10px;
        right: auto;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .quests-modal-content {
        max-height: 90vh;
    }
    
    .quest-item {
        padding: 12px;
    }
    
    .quest-icon {
        font-size: 1.2em;
    }
    
    .quest-title {
        font-size: 0.95em;
    }
    
    .quest-description {
        font-size: 0.8em;
    }
    
    .leaderboard-avatar {
        width: 40px;
        height: 40px;
    }
    
    .leaderboard-name {
        font-size: 0.95em;
    }
    
    .quest-notification {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .quest-start-notification {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .guest-login-modal-content,
    .avatar-capture-content {
        margin: 20px;
    }
    
    .avatar-preview-container {
        width: 100px;
        height: 100px;
    }
    
    .photo-submitter-overlay {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
    }
    
    .quest-badge-overlay {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
    }
    
    .quest-badge-icon {
        font-size: 1.5em;
    }
    
    .quest-badge-title {
        font-size: 0.85em;
    }
    
    .quest-badge-label {
        font-size: 0.7em;
    }
    
    .submitter-avatar {
        width: 28px;
        height: 28px;
    }
    
    .submitter-name {
        font-size: 0.8em;
    }
    
    .comment-avatar {
        width: 32px;
        height: 32px;
    }
    
    .comment-replies {
        margin-left: 32px;
        padding-left: 10px;
    }
    
    /* Smaller nav buttons on mobile */
    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 2.2em;
    }
    
    .gallery-container > .nav-prev {
        left: 10px;
    }
    
    .gallery-container > .nav-next {
        right: 10px;
    }
    
    /* Extra bottom padding for capture overlay on mobile */
    .capture-overlay {
        padding: 10px 20px 100px 20px;
    }
    
    .preview-actions-overlay {
        bottom: max(calc(50px + var(--viewport-bottom-offset, 0px)), calc(50px + var(--safe-area-bottom, 0px)));
    }
}

/* ============================================
   Floating Active Quest Indicator
   ============================================ */
.floating-quest-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 180, 0, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: floatBounce 3s ease-in-out infinite;
}

.floating-quest-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.floating-quest-indicator:active {
    transform: scale(0.95);
}

.floating-quest-icon {
    font-size: 1.6em;
    z-index: 2;
}

.floating-quest-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.4);
    animation: questPulse 2s ease-out infinite;
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes questPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ============================================
   Active Quest Mini Modal
   ============================================ */
.active-quest-mini-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: rgba(30, 30, 35, 0.98);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 215, 0, 0.3);
    z-index: 1001;
    overflow: hidden;
    animation: miniModalSlideIn 0.3s ease-out;
}

@keyframes miniModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mini-modal-content {
    display: flex;
    flex-direction: column;
}

.mini-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 180, 0, 0.1));
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.mini-modal-icon {
    font-size: 1.4em;
}

.mini-modal-title {
    flex: 1;
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 215, 0, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mini-modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.mini-modal-body {
    padding: 15px;
}

.mini-modal-body h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: white;
}

.mini-modal-body p {
    margin: 0 0 12px 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.mini-modal-points {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 215, 0, 0.9);
}

.points-icon {
    font-size: 1em;
}

.mini-modal-actions {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.mini-modal-cancel {
    flex: 1;
    padding: 10px 15px;
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: rgba(255, 100, 100, 0.9);
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-modal-cancel:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.7);
}

.mini-modal-view {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: rgba(255, 215, 0, 0.95);
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-modal-view:hover {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.6);
}

/* Hide floating indicator when camera is visible */
body.camera-active .floating-quest-indicator,
body.camera-active .active-quest-mini-modal {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .floating-quest-indicator {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .floating-quest-icon {
        font-size: 1.4em;
    }
    
    .active-quest-mini-modal {
        bottom: 80px;
        left: 15px;
        right: 15px;
        width: auto;
        max-width: none;
    }
}
