/* ===== CSS Variables ===== */
:root {
    --soft-pink: #fce4ec;
    --pastel-rose: #f8bbd9;
    --blush: #f48fb1;
    --deep-rose: #ec407a;
    --cream: #fff8f0;
    --white: #ffffff;
    --gold: #d4af37;
    --gold-light: #f4e4a6;
    --gold-dark: #b8960c;
    --text-dark: #5d4037;
    --text-muted: #8d6e63;
    
    --shadow-soft: 0 4px 20px rgba(236, 64, 122, 0.15);
    --shadow-medium: 0 8px 40px rgba(236, 64, 122, 0.2);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.3);
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--cream) 50%, var(--pastel-rose) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    position: relative;
}

/* ===== Floating Hearts Background ===== */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    animation: floatUp linear infinite;
    opacity: 0.6;
    filter: drop-shadow(0 2px 4px rgba(236, 64, 122, 0.2));
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

/* ===== Sparkles ===== */
.sparkles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    font-size: 12px;
    animation: sparkle 2s ease-in-out infinite;
    opacity: 0;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== Landing Screen ===== */
.landing-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.landing-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.landing-card {
    background: var(--white);
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    position: relative;
    max-width: 400px;
    width: 100%;
    animation: cardFloat 3s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Card corner decorations */
.card-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--pastel-rose);
}

.card-decoration.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
    border-radius: 15px 0 0 0;
}

.card-decoration.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 15px 0 0;
}

.card-decoration.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 15px;
}

.card-decoration.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 15px 0;
}

.intro-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.intro-heart {
    font-size: 3rem;
    display: block;
    margin: 20px 0 30px;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.15);
    }
}

/* ===== Gift Button ===== */
.gift-button {
    background: linear-gradient(135deg, var(--deep-rose) 0%, var(--blush) 100%);
    color: var(--white);
    border: none;
    padding: 18px 40px;
    font-size: 1.3rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(236, 64, 122, 0.4);
    animation: buttonBounce 2s ease-in-out infinite;
}

@keyframes buttonBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.gift-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 35px rgba(236, 64, 122, 0.5),
                0 0 30px rgba(236, 64, 122, 0.3);
    animation: none;
}

.gift-button:active {
    transform: scale(0.95);
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-hearts {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
}

.mini-heart {
    position: absolute;
    font-size: 1.2rem;
    transition: all 0.4s ease;
}

.gift-button:hover .button-hearts {
    opacity: 1;
}

.gift-button:hover .mini-heart:nth-child(1) {
    transform: translate(-40px, -30px);
    animation: popHeart 0.6s ease forwards;
}

.gift-button:hover .mini-heart:nth-child(2) {
    transform: translate(0, -40px);
    animation: popHeart 0.6s ease 0.1s forwards;
}

.gift-button:hover .mini-heart:nth-child(3) {
    transform: translate(40px, -30px);
    animation: popHeart 0.6s ease 0.2s forwards;
}

@keyframes popHeart {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Button glow effect */
.gift-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.gift-button:hover::before {
    left: 100%;
}

/* ===== Certificate Screen ===== */
.certificate-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 20;
    padding: 20px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.certificate-screen.visible {
    opacity: 1;
    visibility: visible;
}

.certificate-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ===== Certificate ===== */
.certificate {
    background: linear-gradient(180deg, var(--cream) 0%, var(--white) 50%, var(--soft-pink) 100%);
    border-radius: 20px;
    padding: 8px;
    max-width: 500px;
    width: 100%;
    margin: 20px auto;
    box-shadow: var(--shadow-medium), var(--shadow-gold);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.certificate.show {
    transform: scale(1);
    opacity: 1;
}

/* Ribbon */
.ribbon {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 60px;
    z-index: 5;
}

.ribbon-svg {
    width: 100%;
    height: 100%;
}

/* Certificate border */
.certificate-border {
    border: 4px solid var(--gold);
    border-radius: 16px;
    padding: 4px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
}

.certificate-inner {
    background: linear-gradient(180deg, var(--white) 0%, var(--cream) 100%);
    border-radius: 12px;
    padding: 40px 25px 30px;
    position: relative;
}

/* Decorative lines */
.decorative-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.decorative-line .line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    max-width: 100px;
}

.line-ornament {
    color: var(--gold);
    font-size: 0.8rem;
}

/* Certificate Title */
.certificate-title {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--gold-dark);
    text-align: center;
    margin: 10px 0 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.trophy {
    font-size: 1.5rem;
}

/* Awarded to */
.awarded-to {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-bottom: 10px;
}

/* Recipient name */
.recipient-name {
    font-family: 'Great Vibes', cursive;
    font-size: 2.8rem;
    color: var(--deep-rose);
    text-align: center;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(236, 64, 122, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.name-heart {
    animation: heartBeat 1.5s ease-in-out infinite;
}

/* Main title */
.main-title-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--pastel-rose) 100%);
    border-radius: 15px;
}

.for-being {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ===== Traits Section ===== */
.traits-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
    padding: 0 10px;
}

.trait {
    background: linear-gradient(135deg, var(--white) 0%, var(--soft-pink) 100%);
    border: 2px solid var(--pastel-rose);
    border-radius: 25px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(236, 64, 122, 0.1);
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trait.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.trait:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(236, 64, 122, 0.2);
}

.trait-emoji {
    font-size: 1.2rem;
}

.trait-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* ===== Certificate Footer ===== */
.certificate-footer {
    text-align: center;
    margin-top: 25px;
    position: relative;
}

.footer-message {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.footer-signature {
    font-family: 'Great Vibes', cursive;
    font-size: 1.8rem;
    color: var(--deep-rose);
    margin-bottom: 15px;
}

/* Seal */
.seal {
    width: 70px;
    height: 70px;
    margin: 15px auto;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    animation: sealPulse 2s ease-in-out infinite;
}

@keyframes sealPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(212, 175, 55, 0.6);
    }
}

.seal-inner {
    width: 55px;
    height: 55px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold);
}

.seal-heart {
    font-size: 1.2rem;
}

.seal-text {
    font-family: 'Playfair Display', serif;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gold-dark);
    letter-spacing: 2px;
}

.footer-date {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ===== Personal Message ===== */
.personal-message {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(248, 187, 217, 0.3) 0%, rgba(252, 228, 236, 0.5) 100%);
    border-radius: 15px;
    text-align: center;
}

.message-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.message-text:first-child {
    margin-bottom: 5px;
}

/* ===== Love Button ===== */
.love-button {
    background: linear-gradient(135deg, var(--deep-rose) 0%, var(--blush) 100%);
    border: none;
    color: var(--white);
    padding: 16px 35px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 25px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(236, 64, 122, 0.4);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(236, 64, 122, 0.4);
    }
    50% {
        box-shadow: 0 6px 35px rgba(236, 64, 122, 0.6);
    }
}

.love-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 35px rgba(236, 64, 122, 0.5);
    animation: none;
}

.love-button:active {
    transform: scale(0.95);
}

/* ===== Love Screen ===== */
.love-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--cream) 50%, var(--pastel-rose) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.love-screen.visible {
    opacity: 1;
    visibility: visible;
}

.love-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.love-container {
    text-align: center;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Floating hearts burst */
.floating-hearts-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.burst-heart {
    position: absolute;
    font-size: 24px;
    animation: burstOut 2s ease-out forwards;
    opacity: 0;
}

@keyframes burstOut {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: var(--burst-transform) scale(1.2);
    }
}

/* Cat gif container */
.cat-gif-container {
    background: var(--white);
    border-radius: 20px;
    padding: 15px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    overflow: hidden;
    animation: catBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes catBounce {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cat-gif-container .tenor-gif-embed {
    border-radius: 10px;
    overflow: hidden;
}

/* Love message */
.love-message {
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.love-text {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: var(--deep-rose);
    text-shadow: 2px 2px 4px rgba(236, 64, 122, 0.2);
    animation: loveTextPop 0.5s ease-out 0.3s both;
}

@keyframes loveTextPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading container */
.loading-container {
    position: relative;
    z-index: 2;
}

.loading-hearts {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.loading-heart {
    font-size: 1.5rem;
    animation: loadingBounce 1s ease-in-out infinite;
}

.loading-heart:nth-child(1) { animation-delay: 0s; }
.loading-heart:nth-child(2) { animation-delay: 0.1s; }
.loading-heart:nth-child(3) { animation-delay: 0.2s; }
.loading-heart:nth-child(4) { animation-delay: 0.3s; }
.loading-heart:nth-child(5) { animation-delay: 0.4s; }

@keyframes loadingBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.loading-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    max-width: 250px;
    height: 8px;
    background: var(--white);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blush) 0%, var(--deep-rose) 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
}

/* ===== Confetti ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .landing-card {
        padding: 40px 25px;
    }
    
    .intro-text {
        font-size: 1.4rem;
    }
    
    .gift-button {
        padding: 16px 35px;
        font-size: 1.2rem;
    }
    
    .certificate-inner {
        padding: 35px 15px 25px;
    }
    
    .certificate-title {
        font-size: 1.6rem;
    }
    
    .trophy {
        font-size: 1.2rem;
    }
    
    .recipient-name {
        font-size: 2.2rem;
    }
    
    .main-title {
        font-size: 1.3rem;
    }
    
    .trait {
        padding: 8px 14px;
    }
    
    .trait-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 350px) {
    .certificate-title {
        font-size: 1.4rem;
    }
    
    .recipient-name {
        font-size: 1.8rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .hearts-container,
    .sparkles-container,
    .confetti-container,
    .back-button,
    .landing-screen {
        display: none !important;
    }
    
    .certificate-screen {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .certificate {
        transform: none !important;
        opacity: 1 !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
    }
}

