@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #c38b80; /* Dusty Rose */
    --primary-dark: #8b5b51;
    --primary-light: #f3dfdb;
    --accent: #dcae96; /* Peach Gold */
    --bg-gradient: linear-gradient(135deg, #fdf8f7 0%, #f2dcd8 100%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --text: #4a3531;
    --text-muted: #7d605c;
    --success: #8da388; /* Sage Green */
    --error: #b86b6b;
    --border-radius: 16px;
    --shadow: 0 8px 32px 0 rgba(195, 139, 128, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    padding: 20px;
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login/Auth Screen */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.wedding-font {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: normal;
}

.login-card h2 {
    font-weight: 500;
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid rgba(195, 139, 128, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(195, 139, 128, 0.2);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(195, 139, 128, 0.4);
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(195, 139, 128, 0.5);
}

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

.alert {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
}

.alert-danger {
    background: rgba(184, 107, 107, 0.15);
    color: var(--error);
    border: 1px solid rgba(184, 107, 107, 0.3);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    position: relative;
}

header h1.wedding-font {
    font-size: 4.5rem;
    margin-bottom: 5px;
}

.date-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(195, 139, 128, 0.15);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 1.5px;
}

.header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

@media (max-width: 576px) {
    .header-actions {
        position: static;
        margin-top: 15px;
        justify-content: center;
        width: 100%;
    }
}

.action-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
}

.slideshow-btn-header {
    background: var(--primary);
    color: white;
}

.slideshow-btn-header:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Upload Section */
.upload-card {
    padding: 30px;
    margin-bottom: 40px;
}

.upload-area {
    border: 2px dashed rgba(195, 139, 128, 0.5);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.7);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.upload-area span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#file-input {
    display: none;
}

/* Progress Section */
.upload-progress-container {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.progress-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(195, 139, 128, 0.15);
    animation: slideIn 0.3s ease-out;
}

.progress-info {
    flex: 1;
    margin-right: 15px;
}

.progress-filename {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-bottom: 4px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(195, 139, 128, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-status {
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-status.success {
    color: var(--success);
}

.progress-status.error {
    color: var(--error);
}

/* Gallery Section */
.gallery-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.gallery-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Gallery Grid */
.gallery-grid {
    column-count: 4;
    column-gap: 20px;
}

@media (max-width: 992px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 15px;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
}

@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 15px;
    }
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(195, 139, 128, 0.3);
}

.gallery-img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.2);
}

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

.gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 22, 21, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.lightbox-close:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: var(--transition);
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(195, 139, 128, 0.7);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 2rem;
    }
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Hide scrollbar of progress container */
.upload-progress-container::-webkit-scrollbar {
    width: 6px;
}
.upload-progress-container::-webkit-scrollbar-track {
    background: transparent;
}
.upload-progress-container::-webkit-scrollbar-thumb {
    background: rgba(195, 139, 128, 0.3);
    border-radius: 3px;
}
.upload-progress-container::-webkit-scrollbar-thumb:hover {
    background: rgba(195, 139, 128, 0.5);
}

/* Slideshow overlay */
.slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

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

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 5.5s ease-out;
    transform: scale(1.0);
}

.slideshow-slide.active {
    opacity: 1;
    transform: scale(1.03);
}

.slideshow-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 3rem;
    cursor: pointer;
    z-index: 2100;
    transition: var(--transition);
    user-select: none;
}

.slideshow-close:hover {
    color: white;
    transform: scale(1.1);
}
