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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #f9f9f9, #f0f0f0);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 70px 20px 20px;
}

/* Logo Container */
.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.logo-image {
    width: 120px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo-container a:hover .logo-image {
    transform: scale(1.05);
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 30px;
    margin-top: 10px;
}

/* Card flip container */
.card-container {
    perspective: 1500px;
    width: 100%;
    height: 600px;
}

.card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

/* When dragging, disable transition for instant feedback */
.card-wrapper.dragging {
    transition: none;
    cursor: grabbing;
}

.card-wrapper.flipped {
    transform: rotateY(180deg);
}

/* Common card styles */
.card {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Add flip hint */
.card::after {
    content: "Fes clic per revelar";
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 0.8rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::after {
    opacity: 1;
}

/* Front card */
.card-front {
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 1;
    transform: rotateY(0deg);
}

/* Back card */
.card-back {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    z-index: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #fdf7f9, #fff); /* Subtle gradient background */
}

.rose-container {
    flex: 1.2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 0;
    margin-right: -40px;
    overflow: hidden;
}

.rose-image {
    max-width: 100%;
    height: auto;
    max-height: 600px;
    will-change: transform;
    cursor: pointer;
}

.text-container {
    flex: 0.8;
    padding: 40px 40px 40px 0;
    margin-left: -40px;
    z-index: 1;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: 400px;
}

.message-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    box-sizing: border-box;
}

.message-intro {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 40px;
    color: #000;
}

.message-content {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    color: #000;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    display: block;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: #000;
    line-height: 1.1;
}

.title-wrapper {
    margin-bottom: 15px;
    min-height: 8rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.initial-title, .final-title {
    width: 100%;
    text-align: center;
    margin: 0;
}

.initial-title {
    opacity: 1;
    font-size: 2rem;
}

.final-title {
    opacity: 0;
    font-size: 3rem;
}

.message-wrapper {
    min-height: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.message {
    font-size: 1.5rem;
    color: #000;
    font-weight: normal;
    width: 100%;
    text-align: center;
    margin: 0;
}

.initial-message {
    opacity: 1;
}

.final-message {
    opacity: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 90px 15px 15px;
    }
    
    .logo-container {
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
    
    .logo-image {
        width: 130px;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin-top: 5px;
    }
    
    .card-container {
        width: 100%;
        height: 700px;
    }
    
    .card-front {
        flex-direction: column-reverse;
    }
    
    .rose-container {
        justify-content: center;
        padding-right: 0;
        margin-right: 0;
        flex: 1.5;
        margin-top: 0;
    }
    
    .rose-image {
        max-height: 450px;
        margin-top: 0;
    }
    
    .text-container {
        padding: 30px 30px 20px;
        margin-left: 0;
        text-align: center;
        flex: 1;
        width: 100%;
    }
    
    h1 {
        font-size: 2.5rem;
        word-break: break-word;
    }
    
    .message {
        font-size: 1.2rem;
    }
    
    .message-intro {
        font-size: 1.5rem;
    }
    
    .message-container {
        padding: 10px;
        min-height: 150px;
    }
    
    .message-content {
        font-size: 2.8rem;
    }
    
    .buy-button {
        padding: 12px 20px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 400px;
        height: auto;
        white-space: normal;
        line-height: 1.3;
    }
    
    .button-text {
        text-align: center;
        flex: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 75px;
    }
    
    .logo-container {
        top: 10px;
        width: 100%;
    }
    
    .logo-image {
        width: 110px;
    }
    
    .social-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-btn {
        margin-bottom: 10px;
    }
}

.note {
    color: #888;
    font-style: italic;
    margin-bottom: 20px;
}

.rose-media {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.5s ease;
}

#rose-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rose-gif {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.initial-view {
    opacity: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.bloom-view {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.bloom-view.active {
    opacity: 1;
}

.initial-view.inactive {
    opacity: 0;
}

.personal-message {
    margin-top: 30px;
    color: #333;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 1s ease;
    transform: translateY(20px);
}

.personal-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none;
}

.signature {
    font-style: italic;
    margin-top: 20px;
    text-align: right;
    font-size: 1.1rem;
    color: #e91e63;
}

/* Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: rgba(233, 30, 99, 0.6);
    border-radius: 50%;
    pointer-events: none;
}

.personal-message p {
    margin-bottom: 15px;
    line-height: 1.6;
    min-height: 1.6em;
}

/* Removing the cursor styling */
.personal-message p.typing {
    white-space: nowrap;
    overflow: hidden;
}

/* Buttons Container Outside Card */
.buttons-container {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.share-text {
    margin-bottom: 15px;
    color: #666;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
}

.buttons-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.buttons-row.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Social Buttons */
.social-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: nowrap;
}

/* Wrapper for social buttons container and buy button */
.buttons-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.share-btn:hover::before {
    transform: translateX(100%);
}

.share-btn i {
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
}

/* Social media specific colors (class-based to avoid nth-child ordering issues) */
.share-btn--native { background: #127372; } /* Native share */
.share-btn--facebook { background: #3b5998; }
.share-btn--whatsapp { background: #25d366; }
.share-btn--twitter { background: #000000; }
.share-btn--tiktok { background: #000000; }

/* Native share button: only show on mobile browsers */
.share-btn--native { display: none; }
@media (max-width: 768px) {
    .share-btn--native { display: flex; }
}

/* Buy Button Redesign */
.buy-button-container {
    text-align: center;
    width: 100%;
}

.buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #127372;
    color: white;
    padding: 14px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 50px;
    white-space: nowrap;
    max-width: 100%;
}

.buy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.buy-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.buy-button:hover::before {
    transform: translateX(100%);
}

.buy-button:hover .button-icon {
    transform: translateX(5px);
}

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

.button-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .buttons-container {
        margin-top: 30px;
    }
    
    .buttons-row {
        flex-direction: column;
        gap: 25px;
    }
    
    .buttons-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .social-buttons-container {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .share-text {
        margin-bottom: 12px;
        font-size: 1.1rem;
    }
    
    .social-buttons {
        justify-content: center;
    }
    
    .share-btn {
        width: 45px;
        height: 45px;
    }
    
    .share-btn i {
        font-size: 1.2rem;
    }
    
    .button-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .social-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .share-btn {
        width: 42px;
        height: 42px;
    }
    
    .share-text {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .buttons-container {
        margin-top: 20px;
    }
    
    .buttons-row {
        gap: 20px;
    }
    
    .buy-button {
        padding: 10px 15px;
        font-size: 0.8rem;
        min-height: 48px;
    }
    
    .button-icon {
        font-size: 1.1rem;
    }
}

/* Card flipping enabled state */
.card-wrapper:not(.flipping-enabled) {
    cursor: default;
}

.card-wrapper.flipping-enabled {
    cursor: pointer;
}

/* Media Queries for responsiveness */
@media (max-width: 480px) {
    .social-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-btn {
        margin-bottom: 10px;
    }
}

.donation-amount {
    margin-top: 20px;
    font-size: 1rem;
    color: #555;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
    /* Normal non-flipped state */
    .card-wrapper {
        transform: none !important;
        transition: transform 0s !important;
    }

    .card-front {
        transition: opacity 0.6s ease-in, transform 0.6s;
        opacity: 1;
    }
    
    .card-back {
        transition: opacity 0.6s ease-out 0.6s, transform 0.6s 0.6s;
        opacity: 0;
        transform: scale(0.9);
    }
    
    /* Flipped state */
    .card-wrapper.flipped .card-front {
        opacity: 0;
        transform: scale(0.9);
        transition: opacity 0.6s ease-out, transform 0.6s;
    }
    
    .card-wrapper.flipped .card-back {
        opacity: 1;
        transform: scale(1);
        transition: opacity 0.6s ease-in 0.6s, transform 0.6s 0.6s;
    }
}

/* Shared message styling */
.shared-message {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2rem;
    color: #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #127372;
    animation: fadeIn 0.5s ease-in-out;
}

.recipient-name {
    font-weight: bold;
    color: #127372;
}

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

@media (max-width: 768px) {
    .shared-message {
        font-size: 1rem;
        padding: 12px 15px;
    }
}

@media (max-width: 480px) { 
   /* .card, .card-wrapper, .card-container  {
    	height: auto!important;
    } */
    body {
    	min-height: auto !important;
    }
    .text-container {
        padding: 0px 30px 0px 30px !important;
        margin: 0px !important;
        min-height: auto !important;
    }
}  
