@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&family=Open+Sans:wght@300;400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Scheherazade+New:wght@400;700&display=swap');


body {
    margin: 0;
    min-height: 100vh;
    background-color: #ffffff; /* White background */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    overflow-y: auto; /* Allow vertical scrolling */
    font-family: 'Open Sans', sans-serif; /* Updated font-family */
    position: relative;
}

/* Styles for the initial landing page wrapper */
#landing-page-wrapper {
    position: fixed; /* Fixes it to the viewport */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100; 
    background-color: #ffffff; 
    transition: opacity 1s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

#landing-page-wrapper.fade-out-full {
    opacity: 0;
    pointer-events: none;
}

.container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%; 
    height: 100%; 
    overflow: hidden;
}

#main-content {
    text-align: center;
}

.arabic-calligraphy-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 50%;
    height: auto;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

#revelation-text {
    font-size: clamp(2rem, 8vw, 6rem);
    color: #007a68; 
    white-space: nowrap;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; 
}

#revelation-text span {
    display: inline-block;
    filter: blur(10px);
    opacity: 0;
    transition: filter 1s ease-out, opacity 1s ease-out;
}

#revelation-text span.focused {
    filter: blur(0);
    opacity: 1;
}

#arabic-revelation-text {
    font-family: 'Scheherazade New', 'Noto Naskh Arabic', Arial, sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #006400; /* Keeping this distinct as it's Arabic */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

#arabic-revelation-text.visible {
    opacity: 1;
    transform: translateY(0);
}

#word-sequence-container {
    position: relative;
    width: 80%;
    height: 6vw;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.word-sequence {
    font-size: clamp(1rem, 3vw, 2.5rem);
    color: #A4B4A5;
    opacity: 0;
    position: absolute;
    transition: opacity 0.8s ease-in-out;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

.word-sequence.fade-in {
    opacity: 1;
}

.word-sequence.fade-out {
    opacity: 0;
}

#final-sentence {
    font-size: clamp(1rem, 3vw, 2.5rem);
    color: #A4B4A5;
    opacity: 0;
    transition: opacity 1.5s ease-out;
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 20px;
}

#final-sentence.visible {
    opacity: 1;
}

#final-sentence.hidden {
    display: none;
}

/* --- Story Sections --- */
.story-section {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    text-align: center; 
    padding: 40px 20px;
    box-sizing: border-box;
    color: #333;
}


.story-section h1 { /* Changed from h2 to h1 to match the HTML files */
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 20px;
    color: #007a68;
    text-align: center;
    max-width: 800px; 
    width: 100%; 
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; 
}

.story-content-wrapper {
    display: flex; 
    justify-content: center;
    align-items: stretch; /* Ensures all items in the row have the same height */
    gap: 40px; 
    width: 100%; 
    max-width: 1200px; 
    margin-bottom: 30px;
    padding: 0 20px;
    box-sizing: border-box;
    flex-wrap: wrap; /* Allows columns to wrap on smaller screens */
}

.text-column {
    flex: 1; /* Allows columns to grow and shrink */
    min-width: 300px; /* Minimum width before wrapping */
    max-width: 550px; /* Maximum width for each column */
    background-color: #fff; /* White background for the card */
    padding: 12.5px; /* Reduced padding for 50% height reduction */
    border-radius: 10px; /* Rounded corners for the card */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    display: flex; /* Use flex to align content within the card */
    flex-direction: column; /* Stack content vertically within the card */
    justify-content: flex-start; /* Align content to the top */
    align-items: flex-start; /* Align text to the start (left for LTR, right for RTL) */
}

.english-column p {
    text-align: left;
}

.arabic-column p {
    text-align: right ; 
    font-family: 'Scheherazade New', 'Noto Naskh Arabic', serif;
    margin-left: auto;
    width: 100%; 
    font-weight: bold; /* Make Arabic text bold */
}

p.animated-text-lines {
    font-size: 1.2vw; /* Reduced font size for better fit */
    max-width: 800px; /* Max width for consistency */
    line-height: 1.6;
    margin-bottom: 15px; /* Adjusted margin-bottom */
    display: flex;
    flex-direction: column;
    text-align: left; /* Default for English */
    width: 100%;
    box-sizing: border-box;
}

p.animated-text-lines span {
    display: block;
    opacity: 0;
    transform: translateY(10px); /* Adjusted translateY for smaller text */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    margin: 0;
    padding: 0;
    text-align: left; /* Default for English */
    width: 100%;
    box-sizing: border-box;
}

p.animated-text-lines span.fade-in-line {
    opacity: 1;
    transform: translateY(0);
}

/* FIX: Ensure Arabic text is always visible and correctly aligned */
.arabic-column p span {
    opacity: 1 !important; /* Override initial opacity to ensure visibility */
    transform: translateY(0) !important; /* Override initial transform to ensure visibility */
    text-align: right; /* Ensure text aligns to the right */
    width: 100%; /* Ensure spans take full width within the column */
}


.blessings-inline-image {
    display: inline-block;
    vertical-align: middle;
    height: 1em; /* Adjusted height for smaller text */
    width: auto;
    margin: 0 0.1em; /* Adjusted margin */
    opacity: 0;
    transform: translateY(5px); /* Adjusted translateY */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blessings-inline-image.fade-in-image {
    opacity: 1;
    transform: translateY(0);
}

.call-to-action {
    background-color: #006400; 
    color: #fff;
    border: none;
    padding: 10px 20px; /* Reduced padding for smaller button */
    font-size: clamp(0.7rem, 1.2vw, 1rem); /* Reduced font size for button */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px; /* Adjusted margin-top */
}

.call-to-action:hover {
    background-color: #4CAF50;
    transform: translateY(-3px);
}

#scroll-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    color: #006400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
}

#scroll-indicator.visible {
    opacity: 1;
}

#scroll-indicator span {
    font-size: 1vw; /* Adjusted font size */
}

.scroll-arrow {
    font-size: 2vw; /* Adjusted font size */
    line-height: 1;
}

.arrow-up {
    animation: bounce-up 2s infinite;
}

@keyframes bounce-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.arrow-down {
    animation: bounce-down 2s infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

#full-screen-video-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0);
    z-index: 200;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

#full-screen-video-player.active {
    opacity: 1;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.95);
}

#full-screen-video-player .video-wrapper {
    position: absolute; 
    background-color: #000; 
    border-radius: 5px; 
    overflow: hidden; 
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); 
    
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                left 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                width 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                height 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                border-radius 0.5s ease;
}

#full-screen-video-player .video-wrapper.is-expanded {
    top: 50% ;
    left: 50% ;
    width: 90vw ;
    height: 50.625vw ;
    max-width: 1200px ;
    max-height: 675px ;
    transform: translate(-50%, -50%) ;
    border-radius: 10px;
}

#full-screen-video-player #video-iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.close-video-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: clamp(1rem, 3vw, 2.5rem);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 201;
    transition: color 0.3s ease;
}

.close-video-button:hover {
    color: #ff0000;
}

.story-section:nth-of-type(odd) {
    background-color: #f8f8f8;
}
.story-section:nth-of-type(even) {
    background-color: #e8e8e8;
}

.arabic-text {
    text-align: right;
    align-items: flex-end; /* Ensures lines align to the right within the flex column */
}

/* Important overrides for video player */
#full-screen-video-player.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
    background-color: rgba(0, 0, 0, 0.95);
}

#full-screen-video-player .video-wrapper.is-expanded {
    top: 50% !important;
    left: 50% !important;
    width: 90vw !important;
    height: 50.625vw !important;
    max-width: 1200px !important;
    max-height: 675px !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 10px;
    display: block;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .story-content-wrapper {
        flex-direction: column; /* Stack columns vertically on smaller screens */
        gap: 20px; /* Adjust gap for stacked layout */
    }

    .text-column {
        max-width: 100%; /* Allow columns to take full width when stacked */
        min-width: unset; /* Remove min-width constraint when stacked */
    }

    p.animated-text-lines {
        font-size: 3vw; /* Adjusted font size for mobile screens */
    }
    
    .scroll-arrow {
        font-size: 5vw; /* Make arrows larger on mobile */
    }

    #scroll-indicator span {
        font-size: 3vw; /* Adjust text size for mobile */
    }

    .close-video-button {
        font-size: 5vw; /* Adjust close button size for mobile */
    }
}
