/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* CSS Variables for design system */
:root {
    --bg-color: #f9f4eb;
    --card-bg: #ffffff;
    --text-primary: #2c2c2c;
    --text-muted: #766d62;
    --accent: #b89060;
    --accent-hover: #9c764b;
    --accent-light: #f3eae1;
    --border-color: #e9e2d5;
    --success: #6e8e75;
    --error: #b56c6c;
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-soft: 0 10px 30px rgba(184, 144, 96, 0.08);
    --shadow-hover: 0 15px 35px rgba(184, 144, 96, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Typography */
h1, h2, h3, .serif-font {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
}

.subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 5px;
    text-align: center;
}

/* Page Layout */
.container {
    width: 100%;
    max-width: 680px;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 45px 35px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

/* Decor Elements */
.header-decor {
    text-align: center;
    margin-bottom: 35px;
}

.header-decor h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    width: 150px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--accent);
    opacity: 0.5;
}

.divider-flower {
    color: var(--accent);
    padding: 0 10px;
    font-size: 0.8rem;
}

/* Input Fields */
.form-group {
    margin-bottom: 25px;
}

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

.input-text {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-text:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(184, 144, 96, 0.1);
}

/* Upload Dropzone */
.dropzone {
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    background-color: var(--accent-light);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.dropzone:hover, .dropzone.dragover {
    background-color: #eee0cf;
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.dropzone-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Hidden File Input */
.file-input {
    display: none;
}

/* Overall Progress Dashboard */
.progress-dashboard {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
    display: none; /* Hidden by default, shown when uploading */
}

.progress-header {
    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-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Thumbnail Queue Grid */
.queue-container {
    margin-bottom: 25px;
}

.queue-title {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    justify-content: center;
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
    border-radius: var(--radius-md);
}

/* Styled Scrollbar for Grid */
.queue-grid::-webkit-scrollbar {
    width: 6px;
}
.queue-grid::-webkit-scrollbar-track {
    background: transparent;
}
.queue-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* File Card - small square styling */
.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    width: 80px;
    height: 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: var(--transition);
    overflow: visible; /* Let remove button pop out */
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(184,144,96,0.1);
}

.file-thumb-container {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-color);
    position: relative;
}

.file-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay progress info directly on thumbnail */
.file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-name, .file-size {
    display: none; /* Hide filenames inside small thumbnails to prevent clutter */
}

/* Individual Progress inside Card */
.card-progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.card-progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.card-status-text {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--accent);
}

.file-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0.8;
    transition: var(--transition);
    z-index: 10;
}

.file-remove-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 20px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(184, 144, 96, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(184, 144, 96, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Success View / State */
.success-screen {
    text-align: center;
    padding: 30px 10px;
    display: none; /* Shown dynamically */
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 20px;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.success-screen p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Admin Styling */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 1200px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.admin-title-group h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
}

.admin-logout-btn {
    padding: 10px 18px;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.admin-logout-btn:hover {
    background-color: var(--accent-light);
    color: var(--accent-hover);
    border-color: var(--accent);
}

.admin-container {
    width: 100%;
    max-width: 1200px;
}

.admin-login-box {
    max-width: 400px;
    margin: 80px auto;
    background-color: var(--card-bg);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    text-align: center;
}

.admin-login-box h2 {
    margin-bottom: 20px;
}

.admin-error {
    color: var(--error);
    background-color: rgba(181, 108, 108, 0.08);
    border: 1px solid rgba(181, 108, 108, 0.2);
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Admin Gallery */
.gallery-section {
    margin-bottom: 45px;
}

.guest-group-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 6px;
    margin-bottom: 20px;
    display: inline-block;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.admin-image-container {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-color);
}

.admin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    cursor: pointer;
}

.admin-image:hover {
    transform: scale(1.05);
}

.admin-card-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-guest-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.admin-photo-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.admin-card-actions {
    display: flex;
    gap: 10px;
}

.admin-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.admin-btn-view {
    background-color: var(--accent-light);
    color: var(--accent-hover);
    border: 1px solid transparent;
}

.admin-btn-view:hover {
    background-color: var(--accent);
    color: white;
}

.admin-btn-delete {
    background-color: rgba(181, 108, 108, 0.08);
    color: var(--error);
    border: 1px solid transparent;
}

.admin-btn-delete:hover {
    background-color: var(--error);
    color: white;
}

/* Fullscreen Modal Preview for Admin */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    border-radius: 4px;
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

/* Animations */
@keyframes scaleUp {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .container {
        padding: 25px 20px;
    }
    
    .header-decor h1 {
        font-size: 1.8rem;
    }
    
    .queue-grid {
        grid-template-columns: repeat(auto-fill, 80px);
        gap: 10px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-bottom: 15px;
        margin-bottom: 25px;
    }
    
    .admin-title-group h1 {
        font-size: 1.8rem;
    }
    
    .admin-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

/* Extra card block for 5+ thumbnails */
.extra-card-block {
    width: 80px;
    height: 80px;
    background-color: var(--accent-light);
    border: 1px dashed var(--accent) !important;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.extra-count-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-hover);
    line-height: 1.1;
}

.extra-count-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Input Error & Validation text */
.input-error {
    border-color: var(--error) !important;
    background-color: rgba(181, 108, 108, 0.02) !important;
    animation: shake 0.3s ease-in-out;
}

.error-text {
    color: var(--error);
    font-size: 0.78rem;
    margin-top: 6px;
    display: block;
    font-weight: 500;
    text-align: left;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Guest Gallery Styling */
.gallery-container {
    max-width: 680px;
}

.guest-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.guest-gallery-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(184, 144, 96, 0.05);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
}

.guest-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.guest-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.guest-gallery-item:hover .guest-gallery-img {
    transform: scale(1.03);
}

.guest-gallery-author {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .guest-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

/* Slider Modal Styles */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1010;
}

.slider-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.slider-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 80%;
    max-height: 80%;
}

.slider-caption {
    color: #ffffff;
    margin-top: 15px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-family: 'Montserrat', sans-serif;
}

@media (max-width: 768px) {
    .slider-btn {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .slider-content-wrapper {
        max-width: 95%;
        max-height: 75%;
    }
}
