/* Genel Stiller */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden; /* Sayfa kaydırmasını engelle */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url(http://cinemusicompany.com/wp-content/uploads/2012/10/Cumhuriyet-Bayram%C4%B1-Havai-Fi%C5%9Fek-G%C3%B6sterisi-Marmara-Bo%C4%9Faz%C4%B1-Bo%C4%9Fazi%C3%A7i-K%C3%B6pr%C3%BCs%C3%BC-29-Ekim-2012-Photographs-by-B%C3%BClent-%C3%96zalp-with-5D-Mark-3-110.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

/* Gizli elementler için genel stil */
.hidden {
    display: none !important;
}

.font-dancing-script {
    font-family: 'Dancing Script', cursive;
}

.page {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* Zarf Sayfası Stilleri */
#envelope-page {
    background-color: #fce4ec;
}

.message-text {
    position: absolute;
    /* Zarfın ortasından daha fazla yukarı taşındı (200px daha yukarı) */
    top: calc(50% - 16rem - 170px); /* Önceki 270px'ten 100px aşağıya alındı */
    text-align: center;
    z-index: 40;
}

.new-message-title {
    font-size: 3.5rem; /* Büyük font boyutu */
    color: #333;
    margin-bottom: 0.5rem;
}

.click-text {
    font-size: 2rem; /* Orta boy font boyutu */
    color: #555;
}

.envelope {
    position: relative;
    width: 40rem; /* Zarfın boyutları büyütüldü */
    height: 26rem;
    background-color: #ff99cc; /* Pembe zarf */
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.envelope-base {
    position: absolute;
    inset: 0;
    background-color: #ff99cc;
    border-radius: 1rem;
}

.envelope-flap-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #ff66b2; /* Daha koyu pembe kapak */
    transform-origin: bottom;
    border-bottom: 0.5rem solid #cc0066; /* Koyu pembe kenarlık */
    border-radius: 1rem 1rem 0 0;
    z-index: 20;
    transition: transform 1.5s ease-in-out;
}

.heart {
    position: absolute;
    top: 50%;
    right: 2rem; /* Sağdan 2rem boşluk */
    transform: translateY(-50%);
    width: 8rem; /* Kalp boyutu */
    height: 8rem;
    background-color: #ff0000; /* Kırmızı kalp */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem; /* Kalp emoji boyutu */
    color: white;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.3);
    z-index: 30;
    transition: transform 1.5s ease-in-out;
}

/* Zarf Açılma Animasyonu */
.envelope.envelope-open .heart {
    transform: translateX(5rem) translateY(-5rem) rotate(20deg) scale(0.8);
}

.envelope.envelope-open .envelope-flap-top {
    transform: rotateX(180deg);
}

.envelope.envelope-open .invitation-card {
    transform: translateY(0);
    opacity: 1;
}

.invitation-card {
    position: absolute;
    width: 92%; /* Genişlik %90'dan %92'ye çıkarıldı */
    height: 90%;
    background-color: #ffe0f0; /* Açık pembe kart */
    border-radius: 0.8rem;
    box-shadow: inset 0 0 1rem rgba(0, 0, 0, 0.1);
    padding: 2rem;
    color: #cc0066; /* Koyu kırmızı yazı */
    font-size: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* İçeriği ve butonları dikeyde yayar */
    align-items: center;
    transform: translateY(100%); /* Başlangıçta zarfın altında gizli */
    opacity: 0;
    z-index: 35; /* Kalp ve kapağın üzerinde */
    transition: transform 1.5s ease-in-out 0.5s, opacity 1.5s ease-in-out 0.5s;
}

.card-content {
    flex-grow: 1;
    overflow-y: auto; /* Metin taşarsa kaydırma çubuğu */
    margin-bottom: 1rem; /* Butonlarla arası boşluk */
    padding: 0.5rem;
}

.error-message {
    color: #ff0000;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Butonlar arası boşluk */
    width: 100%;
    margin-top: auto; /* Butonları en alta iter */
}

.action-button {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    transform: scale(1.05);
}

.green-button {
    background-color: #4CAF50;
    color: white;
}

.green-button:hover {
    background-color: #45a049;
}

.red-button {
    background-color: #f44336;
    color: white;
}

.red-button:hover {
    background-color: #da190b;
}

/* Doğum Günü Sayfası Stilleri */
#birthday-page {
    background-color: #000000;
    color: #ff66b2; /* Pembe yazı */
}

.birthday-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #ff66b2;
    text-align: center;
    z-index: 20; /* Başlığın diğer elementlerin üzerinde olması için */
}

/* Havai fişekler için canvas */
#fireworks-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Arka plan */
}

.firework-container {
    position: absolute;
    inset: 0;
    pointer-events: none; /* Tıklamayı engelle */
    z-index: 15; /* Havai fişeklerin diğer elementlerin üzerinde olması için */
}

/* Duyarlı Tasarım (Responsive Design) */
@media (max-width: 768px) {
    .new-message-title {
        font-size: 2.5rem;
    }
    .click-text {
        font-size: 1.5rem;
    }
    .envelope {
        width: 25rem;
        height: 18rem;
    }
    .heart {
        width: 6rem;
        height: 6rem;
        font-size: 3.5rem;
        right: 1rem;
    }
    .invitation-card {
        padding: 1.5rem;
        font-size: 1.2rem;
    }
    .action-button {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    .birthday-title {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .new-message-title {
        font-size: 2rem;
    }
    .click-text {
        font-size: 1.2rem;
    }
    .envelope {
        width: 20rem;
        height: 15rem;
    }
    .heart {
        width: 5rem;
        height: 5rem;
        font-size: 3rem;
        right: 0.5rem;
    }
    .invitation-card {
        padding: 1rem;
        font-size: 1rem;
    }
    .action-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .birthday-title {
        font-size: 2.5rem;
    }
}
