/* ===== CSS Variables ===== */
:root {
    --color-cream: #FAF8F5;
    --color-cream-dark: #F3EDE4;
    --color-gold: #C4A962;
    --color-gold-light: #E8DCC8;
    --color-gold-dark: #A8903F;
    --color-sage: #9caf88;
    --color-rose: #d4a39a;
    --color-text: #2C2C2C;
    --color-text-muted: #7A7168;
    --color-success: #6B9E6B;
    --color-border: #E5E0D8;
    --color-white: #FFFFFF;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-script: 'Great Vibes', cursive;
    --font-body: 'Inter', -apple-system, sans-serif;

    --shadow-sm: 0 2px 12px rgba(44, 44, 44, 0.04);
    --shadow-md: 0 4px 24px rgba(44, 44, 44, 0.06);
    --shadow-lg: 0 12px 48px rgba(44, 44, 44, 0.1);
    --shadow-gold: 0 4px 20px rgba(196, 169, 98, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    background-color: var(--color-cream);
    background-image:
        radial-gradient(circle at 25% 25%, rgba(196, 169, 98, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(212, 163, 154, 0.03) 0%, transparent 50%),
        radial-gradient(circle, rgba(196, 169, 98, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 24px 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Container ===== */
.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 20px env(safe-area-inset-bottom, 20px);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: clamp(24px, 6vw, 48px) 0 clamp(16px, 4vw, 32px);
}

.header-ornament {
    color: var(--color-gold);
    margin-bottom: 20px;
    animation: sparkle 3s ease-in-out infinite;
}

.header-ornament svg {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(1) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.05) rotate(5deg); }
}

.couple-names {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: 0.01em;
    margin-bottom: 16px;
    line-height: 1.3;
}

.couple-names .name {
    font-size: clamp(1.6rem, 5.5vw, 2.4rem);
    display: inline;
}

.couple-names .amp {
    font-family: var(--font-script);
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    color: var(--color-gold);
    display: inline-block;
    margin: 0 8px;
    font-weight: 400;
    position: relative;
    top: 2px;
}

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 20px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-light), transparent);
}

.divider-text {
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ===== Date ===== */
.date {
    display: inline-block;
    padding: 6px 20px;
    border: 1px solid var(--color-gold-light);
    color: var(--color-gold-dark);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    border-radius: 24px;
    background: rgba(196, 169, 98, 0.04);
}

/* ===== Upload Section ===== */
.upload-section {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-bottom: 8px;
}

.upload-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(28px, 6vw, 40px) clamp(20px, 5vw, 32px);
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

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

.upload-icon {
    text-align: center;
    margin-bottom: 16px;
    color: var(--color-gold);
}

.upload-icon svg {
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
}

.upload-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3.5vw, 1.4rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--color-text);
}

.description {
    text-align: center;
    color: var(--color-text-muted);
    font-size: clamp(0.82rem, 2.2vw, 0.9rem);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ===== Dropzone ===== */
.file-input-wrapper {
    margin-bottom: 20px;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed var(--color-gold-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(196, 169, 98, 0.02);
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--color-gold);
    background: rgba(196, 169, 98, 0.05);
    transform: translateY(-1px);
    outline: none;
}

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

.dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
    transition: transform 0.25s ease;
}

.dropzone:hover .dropzone-icon {
    transform: scale(1.05);
}

.dropzone-text {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 500;
    color: var(--color-text);
}

.dropzone-hint {
    font-size: clamp(0.72rem, 2vw, 0.8rem);
    color: var(--color-text-muted);
}

/* ===== Preview ===== */
.preview-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--color-cream);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold-light) transparent;
}

.preview-container::-webkit-scrollbar {
    width: 4px;
}

.preview-container::-webkit-scrollbar-track {
    background: transparent;
}

.preview-container::-webkit-scrollbar-thumb {
    background: var(--color-gold-light);
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .video-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.preview-item .remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 44px;
    height: 44px;
    background: transparent;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.preview-item .remove-btn::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: -1;
}

.preview-item .remove-btn:hover::before {
    background: rgba(0, 0, 0, 0.7);
}

/* ===== Submit Button ===== */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-gold);
    min-height: 52px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(196, 169, 98, 0.3);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--color-cream-dark);
    color: var(--color-text-muted);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.submit-btn .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn .btn-loading.hidden,
.submit-btn .btn-text.hidden {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Success Message ===== */
.success-message {
    text-align: center;
    padding: 24px 0;
    animation: fadeInUp 0.5s ease-out;
}

.success-message.hidden {
    display: none;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-message h3 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3.5vw, 1.5rem);
    margin-bottom: 8px;
}

.success-message > p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.upload-more-btn {
    padding: 12px 28px;
    background: transparent;
    border: 1.5px solid var(--color-gold);
    color: var(--color-gold-dark);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-more-btn:hover {
    background: var(--color-gold);
    color: white;
    box-shadow: var(--shadow-gold);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 20px 0 max(20px, env(safe-area-inset-bottom));
    color: var(--color-text-muted);
    font-size: clamp(0.78rem, 2vw, 0.85rem);
}

.footer-divider {
    color: var(--color-gold-light);
    margin-bottom: 10px;
}

.footer-divider svg {
    width: 20px;
    height: 20px;
}

.footer p {
    letter-spacing: 0.02em;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .container {
        padding: 16px 16px env(safe-area-inset-bottom, 16px);
    }

    .upload-card {
        border-radius: var(--radius-md);
    }

    .dropzone {
        padding: 24px 16px;
    }

    .divider {
        padding: 0 8px;
    }
}

@media (max-width: 380px) {
    .couple-names .name {
        font-size: 1.5rem;
    }

    .couple-names .amp {
        font-size: 1.6rem;
    }

    .preview-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 320px) {
    .container {
        padding: 12px 12px env(safe-area-inset-bottom, 12px);
    }

    .dropzone {
        padding: 20px 12px;
    }
}

/* ===== Dark mode support (prefers) ===== */
@media (prefers-color-scheme: dark) {
    /* Düğün sitesi her zaman açık tema kullanır — dark mode override yok */
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
