/* 
 * ROMANTIC PROPOSAL HOMEPAGE STYLES
 * Optimized for iPhone 14 Pro and mobile devices
 */

/* Color variables - change these to customize the color scheme */
:root {
    --primary-color: #ff4d6d; /* Main pink color */
    --secondary-color: #ff8fa3; /* Lighter pink */
    --dark-color: #590d22; /* Dark maroon for text */
    --light-color: #fff0f3; /* Very light pink for background */
    --font-heading: 'Playfair Display', Georgia, serif; /* Heading font */
    --font-body: 'Raleway', 'Helvetica Neue', sans-serif; /* Body font */
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);
}

/* General page styling with iOS safe area support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
}

body {
    font-family: var(--font-body);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    /* Safe area padding for iPhone notch */
    padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
    /* Subtle background pattern */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffccd5' fill-opacity='0.3' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Container for centering content with safe area support */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-left: calc(20px + var(--safe-area-inset-left));
    padding-right: calc(20px + var(--safe-area-inset-right));
}

/* Header styling */
header {
    text-align: center;
    padding: 40px 20px;
    padding-top: calc(40px + var(--safe-area-inset-top));
    animation: fadeIn 2s ease-in;
}

h1, h2 {
    font-family: var(--font-heading);
    color: var(--dark-color);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
}

/* Main content sections */
section {
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* About section */
.about {
    text-align: center;
}

.about p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Memories section styling */
.memories {
    text-align: center;
}

.memory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

.memory-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    height: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.memory-item:hover {
    transform: translateY(-5px);
}

.memory-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.memory-item:hover img {
    transform: scale(1.05);
}

.memory-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 1.1rem;
}

/* Reasons section styling */
.reasons {
    text-align: center;
}

.reasons-list {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.reasons-list ul {
    list-style-type: none;
}

.reasons-list li {
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(255, 143, 163, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-size: 1.1rem;
}

/* Proposal section - the main interactive element */
.proposal {
    text-align: center;
    padding: 50px 20px;
}

.proposal-text {
    font-size: 1.6rem;
    margin-bottom: 40px;
    line-height: 1.8;
}

.buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.btn {
    padding: 18px 40px;
    font-size: 1.3rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    font-weight: bold;
    width: 100%;
    max-width: 300px;
}

.yes-btn {
    background-color: var(--primary-color);
    color: white;
}

.yes-btn:hover, .yes-btn:active {
    background-color: var(--dark-color);
    transform: scale(1.05);
}

.no-btn {
    background-color: #e0e0e0;
    color: var(--dark-color);
    position: relative; /* For the moving effect */
}

/* Footer styling */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    color: var(--dark-color);
    opacity: 0.8;
    padding-bottom: calc(30px + var(--safe-area-inset-bottom));
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1s infinite;
    color: var(--primary-color);
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.celebrate {
    animation: celebrate 0.5s ease infinite;
}

/* Confetti effect container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    opacity: 0.7;
}

/* Message popup styling */
.message-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    text-align: center;
    font-size: 1.4rem;
    max-width: 80%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
}

/* Prevent body scroll when message is shown */
.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Slideshow Overlay Styles */
.slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
}

.slideshow-overlay.active {
    opacity: 1;
    visibility: visible;
}

.slideshow-container {
    width: 100%;
    height: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.slideshow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.slideshow-counter {
    font-size: 1.1rem;
}

.slideshow-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-slides {
    flex: 1;
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.slideshow-slide {
    display: none;
    width: 100%;
    height: 100%;
    max-height: 70vh;
    justify-content: center;
    align-items: center;
}

.slideshow-slide.active {
    display: flex;
}

.slideshow-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.slideshow-controls {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    padding: 0 10px;
    z-index: 5;
}

.slideshow-prev, .slideshow-next {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-exit-prompt {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.slideshow-exit-prompt p {
    margin-bottom: 10px;
    opacity: 0.8;
}

.exit-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 200px;
    margin: 0 auto;
}

/* Responsive design for larger mobile devices and tablets */
@media (min-width: 480px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.3rem;
    }
    
    .memory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .slideshow-container {
        padding: 20px;
    }
}

@media (min-width: 768px) {
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .buttons {
        flex-direction: row;
    }
    
    .btn {
        width: auto;
    }
    
    .proposal-text {
        font-size: 2rem;
    }
}

/* iPhone 14 Pro specific optimizations */
@media only screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) {
    header {
        padding-top: calc(40px + var(--safe-area-inset-top) + 10px);
    }
    
    h1 {
        font-size: 2.7rem;
    }
    
    .proposal-text {
        font-size: 1.5rem;
    }
    
    .slideshow-slides {
        padding: 70px 15px;
    }
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important; /* Prevent zoom on focus */
    }
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 54px; /* Minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .memory-item {
        cursor: pointer; /* Better touch indication */
    }
    
    .slideshow-prev, .slideshow-next, .slideshow-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Swipe support for mobile */
.slideshow-slides {
    touch-action: pan-y;
}

/* Add this to your CSS file */
.heart {
    position: fixed;
    top: -50px;
    animation: fall 5s linear infinite;
    z-index: 100;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(90deg);
        opacity: 0;
    }
}

/* Heart explosion animation */
.heart-explosion {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: heartExplode 1s ease-out forwards;
}

@keyframes heartExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Button shrink animation */
.btn.shrink {
    animation: buttonShrink 0.3s ease-out forwards;
}

@keyframes buttonShrink {
    to {
        transform: scale(0.8);
    }
}

/* Style for button links */
.btn-link {
    text-decoration: none;
    display: inline-block;
    width: 100%;
    max-width: 300px;
}

/* Remove default button styles inside links */
.btn-link button {
    width: 100%;
    margin: 0;
}

/* Heart explosion animation */
.heart-explosion {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: heartExplode 1s ease-out forwards;
}

@keyframes heartExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Button constraints */
.buttons {
    position: relative;
    min-height: 200px;
}

/* Button shrink animation */
.btn.shrink {
    animation: buttonShrink 0.3s ease-out forwards;
}

@keyframes buttonShrink {
    to {
        transform: scale(0.8);
    }
}

/* Message popup styling - non-blocking version */
.message-popup.non-blocking {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    text-align: center;
    font-size: 1.2rem;
    max-width: 80%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
}

/* Message popup styling - positioned in proposal section */
.message-popup {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    text-align: center;
    font-size: 1.1rem;
    max-width: 80%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid var(--primary-color);
    color: var(--dark-color);
    font-weight: 500;
}

/* Prevent body scroll when message is shown */
.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* Responsive design for messages */
@media (max-width: 768px) {
    .message-popup {
        font-size: 1rem;
        padding: 12px 20px;
        max-width: 90%;
    }
    
    .message-popup.non-blocking {
        font-size: 1.1rem;
        padding: 15px 20px;
    }
}

/* Heart explosion animation */
.heart-explosion {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: heartExplode 1s ease-out forwards;
}

@keyframes heartExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Button constraints */
.buttons {
    position: relative;
    min-height: 200px;
}

/* Button explosion effect */
.button-exploded {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0) !important;
    transition: all 0.5s ease !important;
}

/* Ensure button has proper stacking context */
.btn {
    position: relative;
    z-index: 10;
}

/* Message popup styling - non-blocking version */
.message-popup.non-blocking {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    text-align: center;
    font-size: 1.1rem;
    max-width: 80%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid var(--primary-color);
    color: var(--dark-color);
    font-weight: 500;
}

/* Responsive design for messages */
@media (max-width: 768px) {
    .message-popup {
        font-size: 1rem;
        padding: 12px 20px;
        max-width: 90%;
    }
    
    .message-popup.non-blocking {
        font-size: 1.1rem;
        padding: 15px 20px;
    }
}