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

:root {
    --bg-dark: #0a0f16;
    --bg-card: rgba(18, 26, 38, 0.65);
    --bg-input: rgba(10, 15, 22, 0.8);
    
    /* Elegant celebratory colors */
    --gold-primary: #d4af37;
    --gold-light: #f3e080;
    --gold-dark: #aa7c11;
    --gold-gradient: linear-gradient(135deg, #f3e080 0%, #d4af37 50%, #aa7c11 100%);
    
    --text-primary: #f5f7fa;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --white: #ffffff;
    
    --border-color: rgba(212, 175, 55, 0.2);
    --border-hover: rgba(212, 175, 55, 0.5);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-header: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(18, 26, 38, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #0c1522 0%, var(--bg-dark) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 5rem;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 1rem 3rem 1rem;
    position: relative;
}

.hero-emblem {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--gold-primary);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
    animation: float 4s ease-in-out infinite;
}

.hero h1 {
    font-family: var(--font-header);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero h2 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Main Form Card */
.upload-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 4rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.upload-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 45px rgba(212, 175, 55, 0.05), 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Upload Interface */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(10, 15, 22, 0.4);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.03);
}

.upload-zone.dragover {
    border-color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.2));
    transition: var(--transition);
}

.upload-zone:hover .upload-icon {
    transform: scale(1.1);
}

.upload-text h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.upload-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Preview and message section */
.preview-section {
    display: none; /* Managed by JS */
    margin-top: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media(min-width: 768px) {
    .preview-container {
        flex-direction: row;
    }
}

.preview-image-box {
    flex: 1;
    max-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    background: #000;
}

.preview-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-form-box {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-primary);
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.8rem 1rem;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gold-gradient);
    border: none;
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

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

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Gallery Section */
.gallery-section {
    position: relative;
}

.gallery-title {
    font-family: var(--font-header);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: 1px;
    position: relative;
}

.gallery-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gold-gradient);
    margin: 0.8rem auto 0 auto;
    border-radius: 2px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media(min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Gallery Card */
.gallery-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.08), 0 10px 25px rgba(0, 0, 0, 0.3);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #0d141e;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.gallery-author {
    font-weight: 600;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.gallery-date {
    color: var(--text-muted);
}

.gallery-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
    flex-grow: 1;
    font-weight: 300;
    line-height: 1.5;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 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: 90%;
    max-height: 85%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition);
}

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

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

/* Empty State */
.empty-gallery {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
}

.empty-gallery-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-gallery p {
    color: var(--text-secondary);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--bg-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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