/* ==========================================================================
   1. GENEL SIFIRLAMALAR VE BASE AYARLARI
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: #f5efe2;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. ZARF AÇILIŞ EKRANI STİLLERİ
   ========================================================================== */
.envelope-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background-color: #f5efe2;
    transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s;
    padding: 20px;
    visibility: visible;
}

.envelope-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-pocket {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #c9bda7;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    z-index: 1;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 45%, 50% 70%, 100% 45%, 100% 100%, 0% 100%);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #dfd4c0;
    border-radius: 6px 6px 0 0;
    z-index: 3;
    clip-path: polygon(0% 0%, 100% 0%, 50% 55%, 0% 0%);
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.envelope-container.is-open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.seal-wrapper {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -45%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
    width: 100px;
}

.wax-seal {
    width: 75px;
    height: 75px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.seal-base { fill: #c59b4c; stroke: #b38536; stroke-width: 1; }
.seal-inner-ring { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.5; stroke-dasharray: 3 2; }
.seal-monogram { font-family: 'Cinzel', serif; font-size: 20px; font-weight: 700; fill: #593f10; text-anchor: middle; }
.seal-date { font-size: 10px; fill: #6e511c; text-anchor: middle; }

.tap-text {
    font-size: 10px;
    letter-spacing: 2px;
    color: #6e614c;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.envelope-container.is-open .seal-wrapper { opacity: 0; transform: translate(-50%, -20%) scale(0.8); pointer-events: none; }
.envelope-screen.fade-out { opacity: 0; visibility: hidden; transform: scale(1.02); pointer-events: none; }

/* ==========================================================================
   3. ANA DAVETİYE PANELİ (%100 WIDTH)
   ========================================================================== */
.main-invitation-content {
    display: none;
    opacity: 0;
    width: 100%;
    margin: 0;
    flex-direction: column;
    align-items: center;
    padding: clamp(10px, 3vh, 40px) clamp(10px, 3vw, 40px);
    gap: 40px;
    transition: opacity 0.8s ease-in-out;
}

.main-invitation-content.show-content {
    display: flex !important;
    opacity: 1 !important;
}

.luxury-page-border {
    width: 100% !important;
    background-color: #fdfbf7;
    border: 1px solid #dfd4b8;
    padding: clamp(10px, 2vh, 25px);
    position: relative;
    box-shadow: 0 20px 50px rgba(74, 62, 46, 0.03);
}

.luxury-page-border::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 1px solid #e8e0cc;
    pointer-events: none;
}

.invitation-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    background-color: #ffffff;
}

.image-section {
    flex: 1 1 50%;
    min-width: 320px;
    position: relative;
}

.wedding-img {
    width: 100%;
    height: 100%;
    min-height: 500px;
    object-fit: cover;
    display: block;
}

.info-section {
    flex: 1 1 50%;
    min-width: 320px;
    padding: clamp(35px, 6vh, 70px) clamp(20px, 5vw, 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #ffffff;
}

.bride-name, .groom-name {
    font-family: 'Pinyon Script', cursive;
    font-size: clamp(40px, 5vw, 64px);
    color: #332c22;
    font-weight: 400;
    line-height: 1.1;
}

.and-symbol {
    font-family: 'Cinzel', serif;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #b39a69;
    margin: 5px 0;
}

.elegant-divider {
    color: #d4af37;
    font-size: 10px;
    letter-spacing: 5px;
    margin-bottom: 25px;
}

.invitation-message {
    font-size: clamp(13px, 1.1vw, 14px);
    line-height: 1.7;
    color: #665e52;
    max-width: 450px;
    margin-bottom: 35px;
    font-weight: 300;
}

.wedding-meta {
    width: 100%;
    max-width: 420px;
    border-top: 1px dashed #eadecc;
    border-bottom: 1px dashed #eadecc;
    padding: 22px 0;
    margin-bottom: 35px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: #b39a69;
    font-weight: 600;
}

.meta-value {
    font-size: clamp(12px, 1.1vw, 13px);
    color: #3b352c;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   4. SAYAÇ (COUNTDOWN) STİLLERİ
   ========================================================================== */
.countdown-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 420px;
}

.countdown-box {
    background-color: #fdfcf9;
    border: 1px solid #ebe4d5;
    padding: 12px 0;
    flex: 1;
    min-width: 65px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.01);
}

.time-num {
    font-family: 'Cinzel', serif;
    font-size: clamp(18px, 2vw, 24px);
    color: #4a4031;
    font-weight: 500;
}

.time-label {
    font-size: 8px;
    letter-spacing: 1px;
    color: #9e917d;
    margin-top: 3px;
    font-weight: 500;
}

/* ==========================================================================
   5. YENİ: FOTOĞRAF YÜKLEME PANELİ (ZAMAN BİTİNCE AÇILAN ALAN)
   ========================================================================== */
.upload-panel {
    display: none; /* İlk yüklemede gizlidir */
    width: 100%;
    max-width: 450px;
    animation: fadeInSmooth 0.6s ease-out forwards;
}

/* JS tetikleyince çalışacak stil */
.upload-panel.active-panel {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}

.upload-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(16px, 1.8vw, 20px);
    color: #332c22;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 12px;
    color: #7d7365;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Premium Lüks Buton Tasarımı */
.custom-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #332c22;
    color: #fdfbf7;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 15px 30px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(51, 44, 34, 0.2);
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

.custom-upload-btn:hover {
    background-color: #b39a69;
    transform: translateY(-2px);
}

/* Seçilen Görsellerin Önizleme Galerisi */
.preview-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px;
}

.preview-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dfd4b8;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes fadeInSmooth {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. %100 WIDTH BAĞIMSIZ DRESS CODE KARTI
   ========================================================================== */
.standalone-dress-code {
    width: 100% !important;
    background-color: #ffffff;
    border: 1px solid #dfd4b8;
    border-radius: 4px;
    padding: clamp(35px, 6vh, 60px) clamp(20px, 4vw, 50px);
    text-align: center;
    box-shadow: 0 15px 40px rgba(74, 62, 46, 0.02);
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(18px, 2vw, 24px);
    letter-spacing: 4px;
    color: #332c22;
    font-weight: 600;
}

.section-subtitle {
    font-size: clamp(12px, 1vw, 13px);
    font-style: italic;
    color: #b39a69;
    margin-top: 6px;
}

.section-ornament {
    color: #dfd4b8;
    margin: 15px 0 35px 0;
    font-size: 12px;
}

.dress-code-showcase {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
}

.gender-block {
    flex: 1 1 45%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.gender-block:first-child {
    border-right: 1px solid #f2edd6;
    padding-right: 20px;
}

.gender-heading {
    font-family: 'Cinzel', serif;
    font-size: clamp(13px, 1.3vw, 15px);
    letter-spacing: 2px;
    color: #332c22;
    font-weight: 600;
}

.gender-instruction {
    font-size: clamp(11px, 1vw, 12px);
    color: #7d7365;
    max-width: 340px;
    line-height: 1.5;
}

.color-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.swatch-card {
    flex: 1 1 calc(25% - 14px);
    min-width: 80px;
    max-width: 115px;
    background: #ffffff;
    border: 1px solid #ebdcb9;
    padding: 6px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.swatch-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(74, 62, 46, 0.06);
}

.color-preview-block {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.08);
}

.gentleman-black {
    background: linear-gradient(135deg, #2d2d2d 0%, #050505 100%);
    border: 1px solid #111111;
}

.single-suit {
    max-width: 160px;
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suit-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: #544b3d;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   7. TAM RESPONSIVE KIRILMA NOKTALARI
   ========================================================================== */
@media (max-width: 850px) {
    .image-section, .info-section {
        flex: 1 1 100%;
    }

    .wedding-img {
        min-height: 420px;
        max-height: 550px;
    }

    .gender-block:first-child {
        border-right: none;
        border-bottom: 1px dashed #e6dbbf;
        padding-right: 0;
        padding-bottom: 35px;
    }

    .gender-block {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .main-invitation-content {
        padding: 10px;
        gap: 25px;
    }

    .info-section {
        padding: 40px 15px;
    }

    .wedding-img {
        min-height: 350px;
    }

    .gender-block:first-child .color-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 240px;
    }

    .gender-block:first-child .swatch-card {
        max-width: 100%;
        width: 100%;
    }

    .single-suit {
        max-width: 115px;
    }

    .preview-gallery {
        grid-template-columns: repeat(3, 1fr); /* Küçük ekranda önizlemeler yan yana 3 adet sığar */
    }
}