/* style.css */

/* Sets the main container for the infinite scroll. */
.main-container {
    min-height: 100dvh;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* This container handles the scrolling and snapping. */
.scroll-container {
    width: 100dvw;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.post-card-container {
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    box-sizing: border-box;
    padding: 0;
    /* remove padding to allow full height */
}

.post-card {
    position: relative;
    width: 100%;
    height: 100%;
    /* fills container */
    max-width: 600px;
    /* optional: for large screens */
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 111;
}


.post-card .abvri {
    margin-bottom: 20px;
}

/*
  The image container is now an absolute child of .post-card.
  - It fills the entire space created by the padding-top hack.
*/
.post-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e2e8f0;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* zoom & crop if needed */
    object-position: center;
    transition: transform 0.3s ease;
}



/*
  The overlay for content must also be an absolute child of the main .post-card.
  - This ensures it sits on top of the image container.
*/
.post-content-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
    /* above the image */
    pointer-events: auto;
    /* ensure it receives clicks */
}

/* Styles for the various card elements */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    backdrop-filter: blur(8px);
    opacity: 0.7;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    backdrop-filter: blur(8px);
    opacity: 0.7;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    cursor: pointer;
    border: 1px solid white;
}

.options-icon {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.context-tag {
    border-radius: 9999px;
    padding: 0.25rem 1rem;
    align-self: center;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    backdrop-filter: blur(8px);
    opacity: 0.7;
}

.bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
}

.abbreviation-text {
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    opacity: 0.7;
}

.full-form-text {
    font-size: 1.125rem;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    opacity: 0.7;
}

.expand-button {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    color: white;
    transition-property: all;
    transition-duration: 0.3s;
}

.expanded-description {
    position: relative;
    bottom: 7rem;
    left: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.description-text {
    color: #1f2937;
    font-size: 0.875rem;
}

.play-button {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    color: white;
    transition-property: all;
    transition-duration: 0.3s;
}

.link-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.share-button {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    opacity: 0.7;
    backdrop-filter: blur(8px);
    transition-property: opacity;
    transition-duration: 0.3s;
}

.share-button:hover {
    opacity: 1;
}

.loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
}

.ask-button {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border: none;
    color: white;
    padding: 8px 9px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2), 0 3px 3px rgba(0, 0, 0, 0.23);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    outline: none;
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ask-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.75s ease-in-out;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
}

.ask-button:hover:before {
    transform: translate(-50%, -50%) scale(1);
}

.ask-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


.expanded-content {
    background-color: white;
    text-align: justify;
    padding: 10px;

}

.expanded-description-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    z-index: 999;
}

.expanded-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.expanded-text-container {
    flex: 1;
    /* take remaining height */
    overflow-y: auto;
    /* scroll if content exceeds height */
    padding-right: 5px;
    /* small padding for scrollbar */
}

.expanded-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Container for the button and the radiating effect */
.button-container {
    position: relative;
    margin: 10px auto;
    overflow: hidden;
}

/* The button itself */
.full-screen-button {
    width: 100%;
    height: 100%;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10;
    padding: 10px 10px 5px;
}

/* The radiating "sun" element */
.radiating-sun {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.8), rgba(252, 252, 216, 0));
    border-radius: 50%;
    z-index: 5;
    transition: all 0.5s ease;
}

/* Updated keyframes for the radiating animation */
@keyframes radiate-out {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }

    100% {
        width: 200vw;
        /* Fills the viewport width */
        height: 200vh;
        /* Fills the viewport height */
        opacity: 1;
        /* Ensures full opacity at the end */
    }
}

/* Trigger the animation on click */
.button-container.clicked .radiating-sun {
    animation: radiate-out 1.5s forwards;
}

.waiting-textcloud {
    position: absolute;
    top: 101px;
    /* leave 50px space at top */
    left: 0;
    right: 0;
    bottom: 0;
    /* stretch down */

    width: 100%;
    height: auto;
    /* height is determined by top+bottom */

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
    font-family: sans-serif;
    animation: pulse-bg 3s infinite alternate;
}



.waiting-textcloud span {
    position: absolute;
    animation: float 6s infinite ease-in-out;
    opacity: 0.7;
    color: #3DDC84;
}

.waiting-textcloud span:nth-child(1) {
    top: 20%;
    left: 10%;
    font-size: 24px;
    animation-delay: 0s;
}

.waiting-textcloud span:nth-child(2) {
    top: 60%;
    left: 20%;
    font-size: 18px;
    animation-delay: 1s;
}

.waiting-textcloud span:nth-child(3) {
    top: 40%;
    left: 70%;
    font-size: 32px;
    animation-delay: 2s;
}

.waiting-textcloud span:nth-child(4) {
    top: 10%;
    left: 50%;
    font-size: 20px;
    animation-delay: 3s;
}

.waiting-textcloud span:nth-child(5) {
    top: 75%;
    left: 40%;
    font-size: 28px;
    animation-delay: 4s;
}

.waiting-textcloud span:nth-child(6) {
    top: 30%;
    left: 30%;
    font-size: 22px;
    animation-delay: 5s;
}

.waiting-textcloud span:nth-child(7) {
    top: 50%;
    left: 25%;
    font-size: 26px;
    animation-delay: 1.5s;
}

.waiting-textcloud span:nth-child(8) {
    top: 90%;
    left: 20%;
    font-size: 30px;
    animation-delay: 2.5s;
}

.waiting-textcloud span:nth-child(9) {
    top: 15%;
    left: 75%;
    font-size: 16px;
    animation-delay: 3.5s;
}

.waiting-textcloud span:nth-child(9) {
    top: 10%;
    left: 5%;
    font-size: 19px;
    animation-delay: 1s;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(0px) scale(1);
        opacity: 0.6;
    }
}

@keyframes pulse-bg {
    from {
        background-color: rgba(61, 220, 132, 0.05);
    }

    to {
        background-color: rgba(61, 220, 132, 0.15);
    }
}

#elaboration-button {
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cta {
    display: flex;
    padding: 11px 33px;
    text-decoration: none;
    font-size: 25px;
    color: white;
    background: #6225e6;
    transition: 1s;
    box-shadow: 6px 6px 0 black;
    transform: skewX(-15deg);
    border: none;
    cursor: pointer;
}


.cta:focus {
    outline: none;
}

.cta:hover {
    transition: 0.5s;
    box-shadow: 10px 10px 0 #fbc638;
}

.cta .second {
    transition: 0.5s;
    margin-right: 0px;
}

.cta:hover .second {
    transition: 0.5s;
    margin-right: 45px;
}

.span {
    transform: skewX(15deg);
}

.second {
    width: 20px;
    margin-left: 30px;
    position: relative;
    top: 12%;
}

.one {
    transition: 0.4s;
    transform: translateX(-60%);
}

.two {
    transition: 0.5s;
    transform: translateX(-30%);
}

.cta:hover .three {
    animation: color_anim 1s infinite 0.2s;
}

.cta:hover .one {
    transform: translateX(0%);
    animation: color_anim 1s infinite 0.6s;
}

.cta:hover .two {
    transform: translateX(0%);
    animation: color_anim 1s infinite 0.4s;
}

@keyframes color_anim {
    0% {
        fill: white;
    }

    50% {
        fill: #fbc638;
    }

    100% {
        fill: white;
    }
}

.post-close-button {
    display: inline-flex;
    /* flex container to center the glyph */
    align-items: center;
    /* vertical center */
    justify-content: center;
    /* horizontal center */

    /* Make it a square hit target and keep glyph centered */
    width: 40px;
    height: 40px;
    padding: 0;
    /* remove browser default padding */
    box-sizing: border-box;

    /* Visuals */
    border: none;
    background: transparent;
    /* or use your color */
    color: #aaa;
    /* keep current color */
    font-weight: bold;
    line-height: 1;
    /* prevents baseline shifting */

    /* Mobile / browser cleanup */
    -webkit-appearance: none;
    /* remove iOS button chrome */
    appearance: none;
    outline: none;
    cursor: pointer;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

/* responsive sizing (optional) */
.post-close-button {
    width: clamp(25px, 30px, 35px);
    height: clamp(25px, 30px, 35px);
    font-size: clamp(18px, 3.5vw, 28px);
}