@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #C9A84C;
    --primary-light: #E4D5A0;
    --primary-dark: #A88B30;
    --secondary: #2C2C2C;
    --background: #FFF8F0;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #2C2C2C;
    --text-secondary: #6B6B6B;
    --text-light: #999999;
    --border: rgba(201, 168, 76, 0.2);
    --border-light: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(201, 168, 76, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ===== Navigation ===== */
.navbar {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand .icon {
    font-size: 1.8rem;
}

.navbar-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-links a:hover, .navbar-links a.active {
    color: var(--primary-dark);
    background: rgba(201, 168, 76, 0.1);
}

.navbar-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-dark);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: rgba(201, 168, 76, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 32px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(201, 168, 76, 0.08) 0%, transparent 60%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(-10%, -10%) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin-bottom: 16px;
    color: var(--secondary);
}

.hero h1 .highlight {
    color: var(--primary);
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Upload Area ===== */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(201, 168, 76, 0.03);
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(201, 168, 76, 0.08);
    transform: scale(1.01);
}

.upload-zone .upload-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: grayscale(0.3);
}

.upload-zone h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B6B' d='M6 8.825L.35 3.175l.7-.7L6 7.45l4.95-4.975.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ===== Gallery Grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--border-light);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay .guest-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.gallery-item .overlay .actions {
    display: flex;
    gap: 8px;
}

.gallery-item .overlay .actions button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.gallery-item .overlay .actions button:hover {
    background: var(--primary);
}

.gallery-item .video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== Album Tabs ===== */
.album-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 24px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.album-tabs::-webkit-scrollbar { display: none; }

.album-tab {
    padding: 10px 24px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: var(--font-body);
}

.album-tab:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.album-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
}

.album-tab .count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* ===== Challenges ===== */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.challenge-card {
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.challenge-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.challenge-card .emoji {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.challenge-card h3 {
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.challenge-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.challenge-card .submission-count {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img, .lightbox-content video {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
}

.lightbox-info .guest { font-weight: 600; }
.lightbox-info .date { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); }

/* ===== Upload Progress ===== */
.upload-progress-container {
    margin-top: 24px;
}

.upload-progress-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.upload-progress-item .file-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.upload-progress-item .file-info {
    flex: 1;
}

.upload-progress-item .file-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.upload-progress-item .file-size {
    font-size: 0.8rem;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-item .status-icon {
    font-size: 1.2rem;
}

/* ===== Statistics ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--primary-dark);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success { background: linear-gradient(135deg, #27ae60, #229954); }
.toast-error { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.toast-info { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Footer ===== */
.footer {
    background: var(--secondary);
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
}

.footer p {
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer .heart { color: var(--primary); }

/* ===== Loading ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 248, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    flex-direction: column;
    gap: 16px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: grayscale(0.5);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 24px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }

    .navbar-links.open { display: flex; }
    .navbar-mobile-toggle { display: block; }

    .hero { padding: 50px 16px 40px; }
    .hero-actions { flex-direction: column; align-items: center; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .gallery-item { border-radius: var(--radius-sm); }

    .challenges-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card { padding: 20px; }
    .upload-zone { padding: 40px 20px; }
    .container { padding: 0 16px; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.6s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.5s ease both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger animations */
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
.fade-in:nth-child(6) { animation-delay: 0.3s; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ===== Misc ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(201, 168, 76, 0.15);
    color: var(--primary-dark);
}

.badge-success {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.badge-private {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}
