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

:root {
    --primary-color: #000000;  /* Black */
    --secondary-color: #D4AF37; /* Gold */
    --text-dark: #2C2C2C;
    --text-light: #666;
    --bg-light: #FAF9F6;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

body {
    font-family: 'Georgia', serif;
    background: url('images/sunflower-background.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text-dark);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 249, 246, .5);
    z-index: -1;
}

.hidden {
    display: none !important;
}

/* Landing Page Styles */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    gap: 60px;
}

.announcement {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.names {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #000000;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(212, 175, 55, 0.3);
}

.year {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.tagline {
    font-style: italic;
    color: #000000;
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.8;
}

/* Book Styles */
.book-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.book-container:hover {
    transform: scale(1.02);
}

.book {
    width: 300px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.book-cover {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease;
}

.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 0%, #3a3a3a 100%);
    box-shadow: inset 2px 0 5px rgba(212, 175, 55, 0.3);
    border-radius: 3px 0 0 3px;
    border-left: 2px solid var(--secondary-color);
}

.book-front {
    position: absolute;
    left: 40px;
    top: 0;
    width: 260px;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    box-shadow: var(--shadow-lg);
    border-radius: 0 5px 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--secondary-color);
    border-left: none;
}

.cover-decoration {
    text-align: center;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.cover-title {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.cover-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-family: 'Georgia', serif;
    font-style: italic;
}

.book-hint {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-style: italic;
    animation: pulse 2s infinite;
}

/* Book Opening Animation */
.book-opening .book-cover {
    animation: bookOpen 1s ease forwards;
}

@keyframes bookOpen {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-90deg);
    }
    100% {
        transform: rotateY(-180deg);
        opacity: 0;
    }
}

/* Gallery Styles */
.gallery-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.gallery-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary-color);
    margin-bottom: 5px;
}

.photo-count {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: white;
    font-family: inherit;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #C4A027;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

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

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--primary-color);
}

.btn-icon:hover {
    background: rgba(139, 115, 85, 0.1);
}

/* Selection Bar */
.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#selectedCount {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.photo-item {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.photo-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.photo-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.photo-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
}

.photo-info {
    padding: 10px;
    text-align: center;
}

.photo-reactions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
    min-height: 24px;
}

.reaction-count {
    font-size: 1rem;
}



.success-message {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 15px;
}

/* Share functionality */
.share-bar {
    margin-top: 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.share-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: #C4A027;
    transform: scale(1.05);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* Upload Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-drop-zone:hover {
    border-color: var(--secondary-color);
    background: rgba(212, 175, 55, 0.05);
}

.file-drop-zone.dragover {
    border-color: var(--secondary-color);
    background: rgba(212, 175, 55, 0.1);
}

.file-drop-zone svg {
    color: var(--text-light);
    margin-bottom: 10px;
}

.file-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.full-width {
    width: 100%;
}

/* Upload Queue */
.upload-queue {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    margin-bottom: 8px;
}

.upload-item-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress {
    width: 100px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Overall progress */
.overall-progress {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.3s ease;
    width: 0%;
}

/* Photo Viewer */
.viewer-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#viewerImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px 8px 0 0;
    user-select: none;
    transition: opacity 0.3s ease;
}

.viewer-info {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

#viewerUploader {
    margin-bottom: 15px;
    color: var(--text-light);
}

/* Navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

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

.nav-prev {
    left: 20px;
}

.nav-next {
    right: 20px;
}

/* Photo counter */
.photo-counter {
    position: absolute;
    top: 20px;
    right: 60px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    .nav-prev {
        left: 10px;
    }
    
    .nav-next {
        right: 10px;
    }
    
    .photo-counter {
        top: 15px;
        right: 50px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.reaction-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.reaction-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reaction-btn:hover {
    background: white;
    transform: scale(1.1);
}

.reaction-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.reaction-btn span {
    font-size: 0.9rem;
    color: var(--text-dark);
}

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

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .landing-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .book {
        width: 250px;
        height: 330px;
    }
    
    .book-spine {
        width: 30px;
    }
    
    .book-front {
        left: 30px;
        width: 220px;
    }
    
    .cover-title {
        font-size: 1.5rem;
    }
    
    .cover-subtitle {
        font-size: 1.2rem;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .gallery-controls {
        justify-content: center;
    }
    
    .selection-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selection-actions {
        justify-content: space-between;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .viewer-content {
        margin: 10px;
    }
    
    .reaction-bar {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    
    #photoViewer .reaction-btn {
        padding: 6px 8px;
        font-size: 1rem;
        border-radius: 15px;
        flex: 0 0 auto;
    }
    
    #photoViewer .reaction-btn span {
        font-size: 0.8rem;
    }
    
    /* Clean up mobile header */
    .gallery-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .gallery-controls .filter-label {
        display: none; /* Hide labels on mobile */
    }
    
    .gallery-controls .filter-select {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        padding: 10px;
        font-size: 14px;
    }
    
    .gallery-controls #refreshBtn {
        padding: 10px;
        margin: 0;
        flex: 0 0 auto;
    }
    
    .gallery-controls #uploadBtn,
    .gallery-controls .btn-secondary {
        flex: 1 1 calc(50% - 4px);
        padding: 10px;
        font-size: 14px;
    }
    
    .gallery-controls #backToBook {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    /* Full screen photo viewer on mobile */
    #photoViewer.modal {
        padding: 0;
    }
    
    #photoViewer .viewer-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    
    #photoViewer #viewerImage {
        max-width: 100%;
        max-height: 85vh;
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 0;
        flex-shrink: 0;
    }
    
    #photoViewer .viewer-info {
        flex: 0 0 auto;
        overflow-y: visible;
        padding: 10px 15px;
        background: white;
        min-height: auto;
    }
    
    #photoViewer .modal-close {
        position: fixed;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1001;
    }
    
    #photoViewer .nav-arrow {
        position: fixed;
        background: rgba(255, 255, 255, 0.9);
    }
    
    #photoViewer .photo-counter {
        position: fixed;
        top: 10px;
        left: 10px;
    }
}