/* ============================================
   WEDDING GALLERY — Roze & Deniz
   Design tokens matching rozedeniz.netlify.app
   ============================================ */

:root {
    --accent: #1a3a52;
    --text-dark: #000000;
    --text-light: #666666;
    --bg-white: #FFFFFF;
    --bg-warm: #F5F5F5;
    --smoke: #E0E0E0;
    --primary-color: var(--accent);
    --bg-light: var(--bg-warm);
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.01em;
    position: relative;
    background: var(--bg-white);
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('assets/grain-texture.svg');
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.035;
    pointer-events: none;
    z-index: 9999;
}

h1, h2, h3 {
    font-family: 'Lora', serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

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

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; bottom: 0;
    background-color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader.fade-out { opacity: 0; visibility: hidden; }
.preloader-initials {
    font-family: 'Lora', serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--accent);
    animation: fadeInOut 2s ease-in-out infinite;
}
@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ============================================
   GLASS BUTTONS
   ============================================ */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.btn-glass:hover {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.language-switcher {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 6px;
}
.lang-btn { padding: 8px 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }
.lang-btn.active {
    background: #FFFFFF;
    color: #000000;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: none;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: var(--accent);
    padding: clamp(5rem, 15vw, 8rem) 20px clamp(3rem, 8vw, 5rem);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(26,58,82,1) 0%, rgba(26,58,82,0.85) 50%, rgba(40,80,110,0.9) 100%);
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    color: #FFFFFF;
    line-height: 0.9;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.hero-subtitle {
    font-family: 'Lora', serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}
.hero-hint {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.65);
    font-weight: 300;
}

/* ============================================
   SECTION STYLES
   ============================================ */
section { padding: clamp(3rem, 8vw, 5rem) 20px; }
.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    color: var(--text-dark);
    letter-spacing: 0.03em;
    font-weight: 500;
}

/* ============================================
   UPLOAD SECTION
   ============================================ */
.upload-section {
    background: var(--bg-light);
    padding: clamp(2rem, 5vw, 3rem) 20px;
}
.upload-area {
    max-width: 500px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3rem);
    border: 2px dashed var(--smoke);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-white);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(26, 58, 82, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.upload-icon {
    color: var(--accent);
    margin-bottom: 1rem;
    opacity: 0.7;
}
.upload-text {
    font-family: 'Lora', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.upload-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Upload Progress */
.upload-progress {
    max-width: 500px;
    margin: 1.5rem auto 0;
    text-align: center;
}
.progress-bar {
    height: 4px;
    background: var(--smoke);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Upload Success */
.upload-success {
    max-width: 500px;
    margin: 1.5rem auto 0;
    text-align: center;
    color: #2d7a4f;
    animation: fadeIn 0.5s ease;
}
.upload-success svg { margin-bottom: 0.5rem; stroke: #2d7a4f; }
.upload-success p { font-weight: 500; }

/* ============================================
   PHOTO COUNTER
   ============================================ */
.counter-section {
    padding: clamp(1.5rem, 3vw, 2rem) 20px;
    background: var(--bg-white);
}
.photo-counter {
    text-align: center;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.75rem;
}
.counter-number {
    font-family: 'Lato', sans-serif;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.counter-label {
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-light);
    letter-spacing: 0.05em;
}

/* ============================================
   GALLERY GRID
   ============================================ */
.gallery-section {
    background: var(--bg-light);
    padding-bottom: clamp(4rem, 10vw, 6rem);
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }
}
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--smoke);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-family: 'Lora', serif;
    font-size: 1.1rem;
}
.gallery-loading { text-align: center; padding: 2rem; }

/* Spinner */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--smoke);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   SLIDESHOW BUTTON
   ============================================ */
.btn-slideshow {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(26, 58, 82, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}
.btn-slideshow:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(26, 58, 82, 0.5);
}

/* ============================================
   SLIDESHOW OVERLAY
   ============================================ */
.slideshow-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}
.slideshow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 2;
}
.slideshow-title {
    font-family: 'Lora', serif;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    letter-spacing: 0.05em;
}
.slideshow-close {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.slideshow-close:hover { opacity: 1; }
.slideshow-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.slideshow-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: slideFadeIn 1s ease;
}
@keyframes slideFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.slideshow-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    z-index: 2;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    text-align: center;
    padding: 3rem 20px;
    background: var(--bg-white);
}
footer p {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text-light);
}
.footer-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-family: 'Lora', serif;
    font-size: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
.footer-link:hover { border-color: var(--accent); }

/* ============================================
   NAME INPUT
   ============================================ */
.name-input {
    margin-top: 1rem;
    padding: 10px 16px;
    border: 1px solid var(--smoke);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--bg-warm);
    width: 80%;
    max-width: 280px;
    text-align: center;
    transition: border-color 0.3s;
    outline: none;
}
.name-input:focus {
    border-color: var(--accent);
}
.name-input::placeholder {
    color: var(--text-light);
    font-weight: 300;
}

/* ============================================
   UPLOADER NAME ON PHOTO
   ============================================ */
.gallery-item-wrapper {
    position: relative;
}
.photo-uploader {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    pointer-events: none;
    z-index: 2;
}

/* ============================================
   ADMIN MODE
   ============================================ */
.admin-badge {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: 20px;
    background: #c0392b;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    border-radius: 6px;
    z-index: 1000;
}
.admin-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(192, 57, 43, 0.85);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
}
.gallery-item-wrapper:hover .admin-delete-btn {
    opacity: 1;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.fade-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-title { font-size: 3rem; }
    .language-switcher { top: 12px; right: 12px; }
    .btn-slideshow { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}
