/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #fce4ec;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem 0; /* Aggiunge un po' di spazio verticale su mobile */
    text-align: center;
    color: #333;
}

#main-logo {
    max-width: 80%;
    height: auto;
    margin-bottom: 2rem;
}

.page {
    display: none;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 700px;
    box-sizing: border-box;
    z-index: 1;
    position: relative;
}

.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h2 {
    color: #c2185b;
    font-weight: 700;
}

h3 {
    color: #555;
    font-weight: 600;
}

p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
}

.disclaimer {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2rem;
}

button, .astromix-button {
    background-image: linear-gradient(45deg, #ff4081, #e91e63);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

button:hover, .astromix-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

.input-section {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

label {
    margin-top: 10px;
    font-weight: 600;
    color: #c2185b;
}

input[type="text"], input[type="date"] {
    padding: 12px;
    margin-top: 5px;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 80%;
    max-width: 300px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, input[type="date"]:focus {
    outline: none;
    border-color: #ff4081;
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.3);
}

.result-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 2rem;
    width: 100%;
}

.result-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.result-image-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
}

#result-image {
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    border-radius: 8px;
    display: none;
}

#result-message {
    display: none;
    font-style: italic;
    color: #333;
}

.social-share, .astromix-section {
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    width: 100%;
}

.home-button {
    background-image: linear-gradient(45deg, #9c27b0, #6a1b9a);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
    margin-top: 1rem;
}

.home-button:hover {
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.5);
}

/* Hearts Meter Styling */
.meter-container {
    width: 80px;
    height: 300px;
    position: relative;
    margin: 1rem auto;
    background: transparent;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: space-around;
    padding: 10px;
    border: 2px solid #f06292;
    border-radius: 20px;
}

#hearts-meter-container {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    height: 100%;
    position: relative;
    justify-content: space-between;
    align-items: center;
}

.meter-heart {
    width: 25px;
    height: 25px;
    background-color: #ccc;
    transform: rotate(-45deg);
    transition: all 0.5s ease-in-out;
    margin: 2px 0;
    position: relative;
    left: 4px; 
}

.meter-heart::before, .meter-heart::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: 50%;
}

.meter-heart::before { top: -50%; left: 0; }
.meter-heart::after { left: 50%; top: 0; }

.heart-filled {
    opacity: 1;
}

.heart-10-color { background-color: #0000FF; }
.heart-20-color { background-color: #1e87a1; }
.heart-30-color { background-color: #5da987; }
.heart-40-color { background-color: #008000; }
.heart-50-color { background-color: #FFFF00; }
.heart-60-color { background-color: #FFA500; }
.heart-70-color { background-color: #FF0000; }
.heart-80-color { background-color: #550755; }
.heart-90-color { background-color: #940794; }
.heart-100-color { background-color: #ca4b8a; }


#meter-label {
    font-weight: bold;
    color: #c2185b;
    font-size: 2rem;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Landing Page Animation */
@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#landing-page #main-logo,
#landing-page p,
#landing-page button,
.disclaimer {
    opacity: 0;
    animation: fadeInSlideUp 0.8s ease-out forwards;
}

#landing-page p { animation-delay: 0.2s; }
#landing-page button { animation-delay: 0.4s; }
.disclaimer { animation-delay: 0.6s; }

/* Hearts Animation */
#hearts-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.heart {
    position: absolute;
    width: 25px;
    height: 25px;
    transform: rotate(-45deg);
    opacity: 0;
    animation: heart-float 10s linear forwards;
}

.heart::before, .heart::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: 50%;
}

.heart::before { top: -50%; left: 0; }
.heart::after { left: 50%; top: 0; }

.heart.heart-red { background-color: #e91e63; }
.heart.heart-pink { background-color: #ff4081; }
.heart.heart-lightpink { background-color: #f8bbd0; }
.heart.heart-yellow { background-color: #ffc107; }
.heart.heart-purple { background-color: #9c27b0; }

@keyframes heart-float {
    0% {
        opacity: 0.7;
        transform: translateY(110vh) rotate(-45deg) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) rotate(-45deg) scale(1.5);
    }
}

/* Loading Screen Animation */
#loading-screen.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.loader-circle {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #c2185b;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cookie Consent Styling */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none; /* Nascosto di default */
}

.overlay.visible {
    display: block;
}

.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none; /* Nascosto di default */
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cookie-banner.visible {
    display: flex;
}

.cookie-banner p {
    margin: 0;
    font-size: 1rem;
}

.cookie-banner a {
    color: #c2185b;
    font-weight: 600;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none; /* Nascosto di default */
}

.modal.visible {
    display: block;
}

.modal h3 {
    margin-top: 0;
    color: #c2185b;
}

.modal p {
    font-size: 0.9rem;
    text-align: left;
}

/* Responsive Design for Mobile */
@media (max-width: 600px) {
    .result-layout {
        flex-direction: column; /* Impila gli elementi verticalmente */
        align-items: center;   /* Centra gli elementi impilati */
        gap: 20px;             /* Riduce lo spazio tra gli elementi */
    }

    .page {
        padding: 1.5rem 1rem; /* Riduce il padding laterale sulle pagine */
    }

    h2 {
        font-size: 1.5rem; /* Riduce la dimensione dei titoli */
    }

    p {
        font-size: 1rem; /* Riduce la dimensione del testo */
    }

    button, .astromix-button {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .cookie-banner {
        text-align: center;
    }

    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
}
