body {
    background-color: #0b090a;
    color: white;
    font-family: 'Funnel Sans', sans-serif;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    text-align: center;
    /* Added to prevent scrollbars during transitions, review if needed */
    overflow: hidden;
}

/* --- Section - Story of the Missing Person --- */

.redTextColor {
    color: #fd2f2fb6;
}

#sm0-nombre {
    color: whitesmoke;
}

#storyOF {
    animation: opacityChange 3s 0s forwards alternate;
}

@keyframes opacityChange {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* --- Section 2 - Case Image --- */

#case-image-container {
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    height: 100vh; /* Ocupa toda la altura de la ventana */
    opacity: 0; /* Para transición */
    /* transition: opacity 2s ease-in-out; */
}

#case-image-container.visible {
    display: flex; /* Mostrar como flexbox */
    opacity: 1; /* Hacer visible */
}

#case-image-display {
    object-fit: contain;
    min-height: 80vh;
    max-width: 80%;
    max-height: 80vh; /* Limitar la altura máxima */
    border-radius: 50px; /* Opcional: bordes redondeados */
    /* animation: shadowAnimation 6s infinite alternate; Animación continua */
}

/* --- Section - Typing --- */

.typing-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: auto; /* Restrict the width of the container */
    max-width: 40vw; /* Ensure it fits smaller screens */
    padding: 40px 30px;
    border: 2px solid rgba(0, 0, 0, 0); /* Optional: Add a border for the box */
    border-radius: 30px; /* Optional: Add rounded corners */
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.11); /* Optional: Add a glow effect */
    font-size: 1.3rem; /* Adjust the font size as needed */
    opacity: 1;
    /* Ensure it's positioned correctly if overlapping */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    animation: shadowAnimationType 6s infinite alternate;
}

@keyframes shadowAnimationType {
    0% {
        box-shadow: 0px 0px 40px rgba(92, 92, 92, 0.1); /* Baja intensidad */
    }
    50% {
        box-shadow: 0px 0px 60px rgba(92, 92, 92, 0.2); /* Baja intensidad */
    }
    100% {
        box-shadow: 0px 0px 40px rgba(92, 92, 92, 0.1); /* Baja intensidad */
    }
}

.sentence {
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Ensure long words break properly */
}

.input-cursor {
    display: inline-block;
    width: 2px;
    height: 18px; /* Match typing container font size */
    background-color: white;
    margin: 0 0 -2px 5px; /* Adjust cursor position */
    animation: blink 0.6s linear infinite alternate;
}

/* --- Section - Ficha de Desaparición --- */

.case-card {
    /* display: none; -> Controlled by JS now */
    display: flex; /* Use flex for layout */
    opacity: 0;

    /* transition: opacity 2s ease ; */
    font-family: 'Funnel Sans', sans-serif; /* Apply Funnel Sans font */
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
    gap: 50px; /* Add spacing between elements */
    max-width: 80%; /* Ensure it fits smaller screens */
    align-items: center; /* Align items at the top */
    justify-content: center; /* Center content horizontally */
    /* Ensure it's positioned correctly for transitions */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
     /* Set explicit width to control layout better */
    width: 80%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.case-card.hidden {
    display: none;
}

.case-card-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
    margin-top: 0px;
    color: white;
    position: relative; /* Keep if needed for layering/pseudo-elements */
     /* Ensure title is part of the flex layout */
    flex-basis: 100%; /* Make title take full width */
    order: -1; /* Ensure title appears first */
}

.case-card img {
    max-width: 80%;
    max-height: 350px; /* Increase the height for better visibility on PC */
    min-height: 400px; /* Set a minimum height */
    object-fit: cover; /* Scale down the image if it's too large */
    clip-path: inset(0 round 5px); /* Apply rounded corners */
    align-self: center; /* Vertically align the image to the center */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    /* transition: max-height 0.3s ease;    Smooth transition for height change */
}

.case-card table {
    flex: 2 1 300px; /* Allow the table to take up more space proportionally */
    max-width: 600px; /* Set a max width for the table */
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.082);
}

.case-card table td {
    padding: 2px 4px; /* Reduce padding for compactness */
    border: 3px solid rgba(0, 0, 0, 0);
    text-align: left;
    vertical-align: middle; /* Align content to the middle */
    color: #afafaf;
    background-color: rgba(255, 255, 255, 0.05);
    /* transition: background-color 0.3s ease; */
}

.case-card table td:first-child {
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 6px 0 6px 10px;
    width: 35%;
    color: #9b9b9b;
}

.case-card table td:last-child {
    word-wrap: break-word;
    padding: 6px 0 6px 10px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #afafaf;
}

@keyframes blink {
    0%, 40% { opacity: 1; }
    60%, 100% { opacity: 0; }
}

/* Common styles for message blocks */

.static-message, .days-missing-message {
     display: none; /* Hidden by default, controlled by JS */
     width: 700px; /* Restrict the width of the container */
     max-width: 80%; /* Ensure it fits smaller screens */
     padding: 20px;
     font-size: 1.5rem; /* Base font size */
     margin-top: 0; /* Remove top margin if positioned absolutely */
     opacity: 0;
     font-family: 'Funnel Sans', sans-serif; /* Apply Funnel Sans font */
     /* Positioning for overlap */
     position: absolute;
     left: 50%;
     top: 50%;
     transform: translate(-50%, -50%);
     box-sizing: border-box;
}

/* Specific transition from original file for static-message */
/* You might want to make these consistent (e.g., all 2s) */

/* Transition duration MATCHING in JS  */

.static-message, .days-missing-message, .content, .case-card, #case-image-container, .typing-container {
    transition: opacity 1s ease-in-out; 
}

 /* Added class from JS to handle visibility */
 .static-message.visible, .days-missing-message.visible {
    display: block; /* Or 'flex' if they need flex properties */
    opacity: 1;
}

/* --- Section - Final Share --- */

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Set the size of the box */
    height: 30px;
    border-radius: 10px; /* Round the corners of the box */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Add a subtle shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Add hover effects */
}

.share-button:hover {
    transform: scale(1.1); /* Slightly enlarge the button on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Enhance the shadow on hover */
}

.social-icon {
    width: 1.5rem; /* Adjust the size of the icons */
    height: auto;
}

/* Regenerate Button */

.regenerate-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.regenerate-button:hover {
    transform: scale(1.1); /* Efecto de zoom al pasar el mouse */
}

.regenerate-icon {
    width: 32px;
    height: 32px;
}

/* Navigation Ready Message */

.navigation-ready-message {
    font-weight: 300;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    position: fixed;
    bottom: 80px; /* Position above instructions */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 5px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    /* transition: opacity 0.5s ease, visibility 0.5s ease; -> Use delay for fade out */
    transition: opacity 0.5s ease, visibility 2s 2s; /* Delay visibility change */
    z-index: 1000;
    animation: shadowAnimation 15s infinite alternate;

}

@keyframes shadowAnimation {
    0% {
        box-shadow: 0px 0px 5px rgba(92, 92, 92, 0.0); /* Baja intensidad */
    }
    50% {
        box-shadow: 0px 0px 60px rgba(92, 92, 92, 0.2); /* Baja intensidad */
    }
    100% {
        box-shadow: 0px 0px 5px rgba(92, 92, 92, 0.0); /* Baja intensidad */
    }
}

.navigation-ready-message.visible {
    opacity: 1;
    visibility: visible;

    /* Reset transition for fade-in */
    transition: opacity 2s ease-in-out, visibility 0s;
}

#nav-ready-desktop{
    display: block;
    
}

#nav-ready-desktop > p {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: center;
}

#nav-ready-mobile{
    display: none;
}

/* --- Arrows --- */
.arrowSVG {
    width: 1.2rem;
    height: auto;
}

/* Swipe Animation Mobile */

.swipeDiv {
    position: absolute;
    padding: 0;

}

.swipeBar {
    margin: 10px auto -8px auto;
    background-color: rgba(255, 255, 255, 0.5);
    width: 200px;
    height: 10px;
    border-radius: 100px;
    background: linear-gradient(to right, #ffffff7a, #00000000);
}

.swipeHand {
    width: 50px;
    height: auto;
    opacity: 0.8;
    animation: swipeAnimation 7s infinite alternate;
    z-index: 1000;
}

@keyframes swipeAnimation {
    0% {
        transform: translateX(70px) rotate(-20deg);
    }
    50% {
        transform: translateX(-70px) rotate(-10deg);
    }
    90% {
        transform: translateX(70px) rotate(-20deg);
    }
    100% {
        transform: translateX(70px) rotate(-20deg);
    }
}

 /* Media query was inside the img rule, moved outside */
 @media (max-width:926px) {
    .static-message > .shareStory {
        font-size: 1.6rem; 
        margin-bottom: 40px;
    }

    /* Ficha Desaparición */
        
    .case-card-title {
        font-size: 1.5rem;
        margin-bottom: 7px;
    }

    .case-card {
        flex-direction: column; /* Stack elements vertically */
        gap: 20px; /* Reduce gap for smaller screens */
        max-width: 90%;
    }

    .case-card img {
        max-height: 150px; /* Reduce the height for smaller screens */
        min-height: 0; /* Set a minimum height */
        object-fit: scale-down;
    }

    .case-card table {
         font-size: 0.8rem;
         border-radius: 0;

    }

    .case-card table td {
        padding: 3px 3px;
        border: 0 solid rgba(0, 0, 0, 0);
    }

    .case-card table td:first-child, .case-card table td:last-child {
        padding: 3px;
    }

    /* Adjust typing/message font size */

    .typing-container, .sentence, .static-message, .days-missing-message {
        font-size: 1.1rem;
    }
    .typing-container {
        min-width: 50vw; /* Restrict the width of the container */
        max-width: 80vw; /* Ensure it fits smaller screens */
    }
    .input-cursor {
        height: 18px;
    }

    /* --- Section - Final Share --- */

    .share-buttons {
        gap: 10vw; /* Reduce gap for smaller screens */
    }

    .social-icon {
        width: 2.7rem;
        height: auto;
    }
    
    .regenerate-button {
        margin: 5px;
    }

    .regenerate-icon {
        width: 2.5rem;
        height: auto;
    }

    /* Navigation */
    .navigation-ready-message {
        padding: 25px 15px;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
        bottom: 30px;
        font-size: 1.1rem;
        width: 70%;
        animation: none;
    }
    #nav-ready-desktop{
        display: none;
    }
    #nav-ready-mobile{
        display: block;
    }
    #nav-ready-mobile > p {
        margin: 0;
        padding: 0;
    }
}