:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ff8fa3;
    --bg-color: #fff0f3;
    --text-color: #590d22;
    --accent-color: #c9184a;
    --white: #ffffff;
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Pacifico', cursive;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text-color);
    background-image:
        radial-gradient(#ffb3c1 1px, transparent 1px),
        radial-gradient(#ffb3c1 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

h1.title {
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 2px 2px 0px white;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-family: 'Sacramento', cursive;
    /* Assuming you added this font */
}

.screen {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    width: 100%;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Password Screen */
#password-input {
    padding: 15px;
    border-radius: 30px;
    border: 2px solid var(--secondary-color);
    width: 80%;
    max-width: 300px;
    font-size: 1.2rem;
    outline: none;
    text-align: center;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

#password-input:focus {
    box-shadow: 0 0 15px var(--secondary-color);
    border-color: var(--primary-color);
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Pacifico', cursive;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.3);
    transition: transform 0.2s, background-color 0.2s;
    display: inline-block;
    margin-top: 10px;
}

.action-btn:hover {
    transform: scale(1.05);
    background-color: var(--accent-color);
}

.error {
    color: red;
    margin-top: 15px;
    font-size: 1rem;
    font-family: sans-serif;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Card Styles for Thoughts */
.card {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(255, 77, 109, 0.15);
    margin: 0 auto 20px;
    max-width: 500px;
    border: 2px solid var(--bg-color);
}

#thought-question {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

#thought-answer {
    font-size: 1.4rem;
    margin-bottom: 30px;
    color: var(--text-color);
    line-height: 1.6;
}

/* Proposal Screen */
.proposal-text {
    font-size: 3rem;
    margin-bottom: 50px;
    animation: bounce 2s infinite;
    color: var(--accent-color);
}

.heart-btn {
    background: linear-gradient(135deg, #ff4d6d 0%, #ff8fa3 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Pacifico', cursive;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
    transition: all 0.3s ease;
    margin: 10px;
    position: relative;
    z-index: 2;
}

.secondary-btn {
    background: white;
    color: var(--primary-color);
}

.secondary-btn:hover {
    background: #f0f0f0;
    transform: none;
    /* Disable default hover scale for No button as it moves */
}

/* Make sure No button can move freely */
#no-btn {
    position: absolute;
    /* Initial styling to place it next to Yes, but JS will take over */
}

/* Success Screen */
.heart-container {
    position: relative;
    width: 600px;
    height: 600px;
    max-width: 70%;
    aspect-ratio: 1 / 1;
    margin: 0 auto 30px;
    /* CSS Mask for heart shape */
    mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 512 512" width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"/></svg>');
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 512 512" width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"/></svg>');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;

    animation: heartbeat 1.5s infinite;
}

.heart {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.photo {
    width: 80%;
    height: 100%;
    object-fit: cover;
}

.love-message {
    font-size: 2.2rem;
    line-height: 1.5;
    color: var(--text-color);
    margin-top: 20px;
    animation: fadeIn 2s ease-in;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.05);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.05);
    }

    60% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dots for progress */
.progress-dots {
    margin-top: 20px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    h1.title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card {
        padding: 20px;
    }

    #thought-question {
        font-size: 1.4rem;
    }

    #thought-answer {
        font-size: 1.1rem;
    }

    .proposal-text {
        font-size: 2rem;
    }

    .heart-btn {
        padding: 12px 30px;
        font-size: 1.2rem;
    }

    .love-message {
        font-size: 1.5rem;
    }

    .heart-container {
        width: 300px;
        height: 300px;
    }
}