/* Global Variables */
:root {
    --primary-color: #ff1493;
    --secondary-color: #ff69b4;
    --white: #ffffff;
    --black: #000000;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: clamp(4px, 0.5vw, 6px);
    --border-radius-md: clamp(12px, 1.5vw, 15px);
    --border-radius-lg: clamp(14px, 2vw, 16px);
    --spacing-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --spacing-sm: clamp(0.5rem, 1vw, 1rem);
    --spacing-md: clamp(1rem, 1.5vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 2vw, 2rem);
    --font-size-base: clamp(14px, 1vw, 16px);
    --font-size-lg: clamp(18px, 1.5vw, 24px);
    --font-size-xl: clamp(24px, 2vw, 32px);
    --container-padding: clamp(1rem, 5vw, 3rem);
}

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

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100dvh;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    display: grid;
    padding: var(--container-padding);
    place-items: center;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    color: var(--black);
    line-height: 1.5;
    overflow-y: scroll;
}

body::-webkit-scrollbar{
    display: none;
}


/* Utility Classes */
.hide {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* Welcome Message Styles */
.welcome-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1000;
    transition: all 0.5s var(--transition-timing);
    backdrop-filter: blur(10px);
    width: min(90%, 500px);
}

.welcome-message h1 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.start-button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
    background: var(--secondary-color);
}

.start-button:active {
    transform: translateY(0);
}

/* Floating Hearts */
.heart {
    position: fixed;
    width: clamp(15px, 2vw, 25px);
    height: clamp(15px, 2vw, 25px);
    background: var(--primary-color);
    transform: rotate(45deg);
    pointer-events: none;
    filter: drop-shadow(0 3px 6px var(--shadow-color));
    animation: floatHeart 4s ease-in-out infinite;
    z-index: 1;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.heart::before {
    left: -50%;
}

.heart::after {
    top: -50%;
}

/* Gift Container */
.gift-container {
    position: relative;
    width: min(280px, 80vw);
    height: min(280px, 80vw);
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 1500px;
    opacity: 0;
    transform: scale(0);   
    margin: var(--spacing-md) auto;
}


.gift-container.show {
    opacity: 1;
    transform: scale(1);
}

.gift-box {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: all 1s cubic-bezier(0.9, 0, 0.5, 1);
    animation: giftFloat 4s ease-in-out infinite;
    will-change: transform;
}

.gift-box.open {
    transform: rotateX(180deg) scale(0.8);
    animation: none;
}

/* Gift Box Sides */
.side {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 3px solid var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 30px var(--shadow-color);
    backface-visibility: hidden;
    overflow: hidden;
}

.side::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border: 3px dashed rgba(255, 255, 255, 0.7);
    animation: borderPulse 2s ease-in-out infinite;
}

.side::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 2s linear infinite;
}

/* Gallery Styles */
.gallery {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 1400px);
    opacity: 0;
    visibility: hidden;
    transition: all 1s var(--transition-timing);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--spacing-md);
    padding: var(--container-padding);
}

.gallery-item {
    background: var(--white);
    padding: clamp(0.8rem, 2vw, 1.2rem);
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 25px var(--shadow-color);
    transform: rotate(var(--rotation));
    transition: all 0.4s var(--transition-timing);
    isolation: isolate;
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.05) rotate(var(--rotation));
    z-index: 2;
    box-shadow: 0 12px 30px var(--shadow-color);
}

.gallery-item img {
    width: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    transition: all 0.1s ease;
}

.gallery-caption {
    text-align: center;
    margin-top: var(--spacing-sm);
    color: #666;
    font-size: 0.9rem;
}

/* Music Toggle */
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: var(--white);
}

.music-toggle i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Credits */
.credits {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: var(--white);
    font-size: 0.9rem;
    text-shadow: 0 1px 3px var(--shadow-color);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes floatHeart {
    0% { transform: translateY(0) rotate(45deg) scale(1); }
    50% { transform: translateY(-30px) rotate(60deg) scale(1.1); }
    100% { transform: translateY(0) rotate(45deg) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(100%) skewX(-15deg); }
}

/* Ribbon effects */
.ribbon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff1493, #ff69b4);
    top: -30px;
    left: calc(50% - 30px);
    transform-origin: bottom;
    transform: rotate(45deg);
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ribbon::before,
.ribbon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    top: 0;
    left: 0;
    opacity: 0.7;
    animation: ribbonPulse 1.5s ease-in-out infinite alternate;
}


/* Open gift box animations */
.gift-box.open {
    transform: rotateX(360deg) scale(0.9);
    animation: none;
}

.gift-box.open .front { 
    transform: translateZ(250px) rotateX(180deg) scale(0.2);
    opacity: 0;
}

.gift-box.open .back { 
    transform: translateZ(-250px) rotateY(180deg) scale(0.2);
    opacity: 0;
}

.gift-box.open .left { 
    transform: translateX(-250px) rotateY(-90deg) scale(0.2);
    opacity: 0;
}

.gift-box.open .right { 
    transform: translateX(250px) rotateY(90deg) scale(0.5);
    opacity: 0;
}

.gift-box.open .top { 
    transform: translateY(-250px) rotateX(90deg) scale(0.5);
    opacity: 0;
}

.gift-box.open .bottom { 
    transform: translateY(250px) rotateX(-90deg) scale(0.5);
    opacity: 0;
}

.gift-box.open .ribbon {
    transform: rotate(45deg) scale(0) translateY(-100px);
}

@keyframes giftFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0); 
    }
    25% { 
        transform: translateY(-15px) rotate(2deg); 
    }
    75% { 
        transform: translateY(-5px) rotate(-1deg); 
    }
}

@keyframes shine {
    from {
        transform: translateX(-100%) rotate(45deg);
    }
    to {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes borderPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.7);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.3);
    }
}

@keyframes ribbonPulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* Polaroid tape effects */
.polaroid-tape {
    position: absolute;
    width: 40px;
    height: 15px;
    background: rgba(255, 255, 255, 0.6);
    transform: rotate(var(--tape-rotation));
}

.polaroid-tape.left {
    top: -5px;
    left: 20px;
}

.polaroid-tape.right {
    top: -5px;
    right: 20px;
}

.gallery-item::before {
    content: '❤️';
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0);
}

.gallery-item:hover::before {
    opacity: 1;
    transform: scale(1);
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.active {
    display: flex;
    opacity: 1;
    animation: modalFadeIn 0.5s ease-out;
}

.modal-content {
    position: relative;
    margin: auto;
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, #fff1f1, #ffe6e6);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.modal-title {
    color: #ff4b6e;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: #ff4b6e;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #ff2d55;
    transform: scale(1.1);
}

.modal-image-container {
    position: relative;
    width: 100%;
    padding-top: 50%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-caption {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 18px;
    font-weight: 500;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.modal-nav button {
    pointer-events: auto;
    background: rgba(255, 75, 110, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-nav button:hover {
    background: rgba(255, 45, 85, 0.9);
    transform: scale(1.1);
}

.heart-decoration {
    position: absolute;
    font-size: 24px;
    color: #ff4b6e;
    animation: float 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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


.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: #fff9f9;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #ff4081;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff1493;
}

.modal-image-container {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.modal-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-text {
    text-align: center;
    padding: 0 20px;
}

.modal-title {
    color: #ff4081;
    font-size: 24px;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
}

.modal-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-quote {
    font-style: italic;
    color: #ff69b4;
    font-size: 14px;
    padding: 10px;
    border-top: 1px solid #ffe4e1;
    border-bottom: 1px solid #ffe4e1;
}
