/* Basic styles for layout */
body {
    font-family: sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

html {
    overflow: hidden;
}



/* --- Styles for Card Images and Placeholders --- */
.layout--landscape .card .card-front--outer { 
    background-image: url('Front Page.png');
    background-position: center center;
    background-size: cover;
}

.layout--landscape .card .card-back--outer  { 
    background-image: url('Back Page.png');
    background-position: center center;
    background-size: cover;
}

.layout--landscape .card .card-front--inner { background: linear-gradient(135deg,rgba(0, 0, 0, 0.03),rgba(0, 0, 0, 0.01)); }
.layout--landscape .card .card-back--inner  { 
    background: linear-gradient(135deg,rgba(0, 0, 0, 0.03),rgba(0, 0, 0, 0.01)); 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}



/* --- Foundational Layout and Card Styles --- */
/* --- Foundational Styles --- */
body {
    overflow: hidden;
}

html {
    overflow: hidden;
}

.layout *,.layout *:before,.layout *:after {
    box-sizing: border-box
}

.preloader {
    display: none
}

/* --- Layout and Container Styles --- */
.layout {
    height: 0;
    margin: 0 auto;
    position: relative;
    overflow: visible;
    width: 100%;
}



.layout:before {
    content: "";
    position: absolute;
    z-index: 1000;
    left: 0;
    right: 0;
    top: -100%;
    bottom: 95%;
    background: linear-gradient(to bottom,#fff 95%,#fff0)
}



.layout.overflow--visible:before {
    display: none
}

.is-gesture-enabled {
    cursor: pointer
}

/* --- Card Base Styles --- */



.layout--landscape {
    max-width: 700px;
    padding-bottom: 82%
}

@media screen and (min-width: 700px) {
    .layout--landscape {
        padding-bottom:574px
    }
}

.layout--landscape .card {
    display: block;
    width: 90%; /*Change card width here and in the @media screen and (min-width: 700px)*/
    height: 0;
    padding-top: 64.26%;
    position: absolute;
    top: 10%; 
    left: 50%;
    transition: transform 1s ease-in-out;
    transform-style: preserve-3d;
    perspective: 160vw;
    transform: translateX(-50%) scale(1.3);
}

.layout--is-ready .layout--landscape .card {
    transition: transform 1s ease-in-out
}

.layout--landscape .card .card-side {
    box-shadow: 0 1px 12px #00000026;
    background-repeat: no-repeat;
    background-size: cover;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: transform 1s ease-in-out;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden
}

.layout--landscape .card .card-side span {
    display: none
}

.debug .layout--landscape .card .card-side span {
    display: inline-block;
    background: #000;
    color: #fff;
    width: 180px;
    text-align: center
}

.layout--landscape .card .card-front--outer,.layout--landscape .card .card-back--inner {
    transform-origin: 50% 0%
}

.layout--landscape .card .card-front--inner,.layout--landscape .card .card-back--outer {
    transform-origin: 50% 100%;
    transform: rotateX(-180deg) translate3d(0,100%,0)
}

.layout--landscape .card .card-front--outer:after,.layout--landscape .card .card-front--inner:after,.layout--landscape .card .card-back--inner:after,.layout--landscape .card .card-back--outer:after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0
}



@media screen and (min-width: 700px) {
    .layout--landscape {
        padding-bottom:574px
    }
}

.layout--landscape .card {
    transition: 1s ease-in-out;
    transition-property: opacity,transform
}

/* Specific adjustments for smaller mobile screens */
@media screen and (max-width: 480px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.85); /* Reduce scale to create margin space */
        top: 12%; /* Adjust vertical position */
    }

    .instruction-container {
        bottom: 20px; /* Move instructions lower on small screens */
    }
}

/* Viewport height-based responsive adjustments to prevent overlap */
@media screen and (max-height: 800px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(1.1); /* Reduce scale for shorter screens */
        top: 8%; /* Move card higher */
    }
    
    .instruction-container {
        bottom: 25px;
    }
}

@media screen and (max-height: 700px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.95); /* Further reduce scale */
        top: 6%; /* Move card higher */
    }
    
    .instruction-container {
        bottom: 20px;
    }
}

@media screen and (max-height: 600px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.8); /* Significantly reduce scale */
        top: 4%; /* Move card higher */
    }
    
    .instruction-container {
        bottom: 15px;
    }
}

@media screen and (max-height: 500px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.7); /* Much smaller for very short screens */
        top: 3%; /* Move card to top */
    }
    
    .instruction-container {
        bottom: 10px;
    }
    
    .instruction-text {
        font-size: 14px; /* Smaller text on very short screens */
    }
}

/* Additional mobile width breakpoints for better margin control */
@media screen and (max-width: 600px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(1.0); /* Reduce scale to create margin space */
    }
}

@media screen and (max-width: 400px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.8); /* Further reduce for very small screens */
    }
}

@media screen and (max-width: 350px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.75); /* Even smaller for very narrow screens */
    }
}

/* Combined conditions for small screens with limited height */
@media screen and (max-width: 480px) and (max-height: 700px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.75); /* Optimized scale for small mobile in landscape */
        top: 5%;
    }
    
    .instruction-container {
        bottom: 15px;
    }
}

@media screen and (max-width: 480px) and (max-height: 600px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.7); /* Even smaller for mobile landscape */
        top: 3%;
    }
    
    .instruction-container {
        bottom: 12px;
    }
}

@media screen and (max-width: 400px) and (max-height: 600px) {
    .layout--landscape .card {
        transform: translateX(-50%) scale(0.65); /* Very small for narrow mobile landscape */
        top: 3%;
    }
    
    .instruction-container {
        bottom: 12px;
    }
}

/* Card Text Styling */
.card-text {
    text-align: center;
    width: 100%;
    color: #333;
    line-height: 1.4;
    padding: 5% 5% 0 5%;
    opacity: 0;
    pointer-events: none; /* Prevent interaction when invisible */
}

.card-text.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Allow interaction when visible */
}

.greeting-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 28px;
    margin: 0 0 5% 0;
    line-height: 1.3;
    color: #196F4D;
    height: auto;
    opacity: 0.8;
}

.message-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 20px;
    margin: 0 0 5% 0;
    line-height: 1.2;
}

.signature-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 20px;
    margin: 0;
    line-height: 1.2;
}

.logo-container {
    margin-top: 5%;
    margin-bottom: 2%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container svg {
    max-width: 100px;
    height: auto;
    opacity: 0.8;
}

/* Responsive Font Sizes */
@media screen and (max-width: 700px) {
    .greeting-text {
        font-size: 4vw;
    }

    .message-text,
    .signature-text {
        font-size: 2.5vw;
    }
}

/* Mouse Click Animation and Instructions */
.instruction-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    transition: opacity 0.5s ease-in-out;
}

.instruction-container.fade-out {
    opacity: 0;
}

.mouse-animation {
    position: relative;
    margin-bottom: 15px;
}

.mouse {
    width: 28px;
    height: 42px;
    border: 2px solid #555;
    border-radius: 14px;
    position: relative;
    background: #f1f1f1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

/* Divider line for buttons */
.mouse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 18px;
    background: #aaa;
}

.mouse-button-left,
.mouse-button-right {
    width: 50%;
    height: 18px;
    box-sizing: border-box;
}

.mouse-button-left {
    border-top-left-radius: 12px;
    animation: leftClick 3s ease-in-out 0.2s infinite;
}

.mouse-button-right {
    border-top-right-radius: 12px;
}

@keyframes leftClick {
    0%, 20%, 100% {
        background: transparent;
        transform: translateY(0);
    }
    10% {
        background: rgba(0,0,0,0.1);
        transform: translateY(1px);
    }
}

.click-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 1;
    width: 28px;
    height: 42px;
    border: 2px solid rgba(0, 0, 0, 0.6);
    border-radius: 14px;
    box-sizing: border-box;
    opacity: 0;
    animation: mouseShapePulse 3s ease-out infinite;
    pointer-events: none;
}

@keyframes mouseShapePulse {
    10% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.7;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

.instruction-text {
    color: #555;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
    margin: 0;
}

.instruction-row {
    display: flex;
    align-items: center;
    gap: 15px; /* Adds space between the text and the button */
}

/* New styles for the top-right copy link button */
.copy-link-button {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

.copy-link-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.copy-link-button i {
    color: #555;
    font-size: 16px;
}

.copy-link-button.copied {
    background-color: #196F4D;
    border-color: #196F4D;
    color: #ffffff;
}

.copy-link-button.copied i {
    color: #ffffff;
}

.instruction-text.holiday-message {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    -webkit-background-clip: text;
}

/* --- Tap Animation Styles (for mobile) --- */
.tap-animation {
    display: none; /* Hidden by default, shown via JS */
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.tap-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    animation: tapRippleEffect 3.5s infinite;
}

@keyframes tapRippleEffect {
    0% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(3); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1); opacity: 0.75; }
    65% { transform: translate(-50%, -50%) scale(3); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* --- Share Button Styles --- */
.share-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
}

.share-container .copy-link-button {
    position: relative;
    z-index: 1003;
}

.share-options.visible + .copy-link-button {
    visibility: hidden;
}

.share-options {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    flex-direction: column;
    width: max-content;
}

.share-options.visible {
    display: flex;
}

.share-options button {
    background: none;
    border: none;
    padding: 12px 18px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.share-options button:hover {
    background-color: #f5f5f5;
}

.share-options button i {
    color: #555;
    font-size: 16px;
}
