/* Font-face declarations */
@font-face {
    font-family: 'Alexandria'; /* Changed to Alexandria */
    src: url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700&display=swap');
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal overflow */
    overflow-y: auto; /* Ensure vertical scrolling works properly */
    height: 100%; /* Ensure the body takes the full height */
    box-sizing: border-box;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 48px 20px 48px; /* Adjusted bottom padding to 20px */
    gap: 64px;
    font-family: 'Alexandria', sans-serif; /* Changed to Alexandria */
    background: var(--Main-Theme-of-white, #F5F8FF);
    background-image: url('images/cross.svg'); /* Set the image as the background */
    background-repeat: repeat; /* Repeat the image to create a pattern */
    background-size: 160px; /* Keep the original size of the image */
    background-position: center; /* Center the pattern */
    min-height: 100vh; /* Ensure the body takes the full height of the viewport */
    flex: 1; /* Allow the container to grow and take up available space */
}

.container {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header container */
.header {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

/* Background bar */
.header-bg {
    width: 100%;
    height: 75%;
    position: absolute;
    background: #163588;
}

/* Header text */
.header-text {
    width: 100%;
    color: #F9F9F9;
    word-wrap: break-word;
    z-index: 1;
}

.header-text.arabic {
    direction: rtl; /* Set text direction to RTL */
    text-align: right; /* Align text to the right */
}

.header-text.english {
    text-align: left; /* Align text to the left */
}

.header-text .title {
    font-size: 24px;
    font-weight: 300;
    line-height: auto;
}

.header-text.arabic .subtitle {
    font-size: 32px;
    font-weight: 500;
    line-height: 45px;
}

.header-text.english .subtitle {
    font-size: 32px;
    font-weight: 500;
    line-height: auto;
}

/* Header image */
.header-image {
    width: 240px;
    height: 240px;
    z-index: 1;
    cursor: pointer;
}

.input-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 100px;
    margin: 32px 0;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%; /* Make the container take full width */
    gap: 20px;
}

.input-headlines {
    display: flex;
    flex-direction: row; /* Arrange items horizontally */
    justify-content: space-between; /* Push items to the edges */
    align-items: center; /* Vertically align items */
    width: 100%; /* Make the container take full width */
}

.input-label {
    color: #163588;
    font-size: 22px;
}

.input-label.arabic {
    color: #163588;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    word-wrap: break-word;
    direction: rtl; /* Set text direction to RTL */
    text-align: right; /* Align text to the right */
}

.input-label.english {
    color: #163588;
    font-size: 20px;
    font-weight: 500;
    line-height: auto;
    word-wrap: break-word;
    text-align: left; /* Align text to the left */
}

.input-box {
    width: 100%;
    height: 40px;
    border: 1px solid var(--Main-Theme-Light, #D9E3FF);
    border-radius: 50px;
    padding: 4px 4px;
    text-align: center;
    font-family: 'Alexandria';
    font-size: 16px;
    -moz-appearance: textfield; /* For Firefox */
    -webkit-appearance: none; /* For Chrome, Safari, and Edge */
    appearance: none; /* Standard property */
}

.input-box::-webkit-inner-spin-button,
.input-box::-webkit-outer-spin-button {
    -webkit-appearance: none; /* Remove spinner buttons in WebKit browsers */
    appearance: none; /* Ensure compatibility */
    margin: 0; /* Remove default margin */
}

.input-box::-moz-inner-spin-button {
    display: none; /* Hide spinner buttons in Firefox */
}

.input-box:focus {
    border: 1px solid #A00000; /* Change border color to red when active */
    outline: none; /* Remove the default outline */
}

.or-divider {
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle {
    width: 86px;
    height: 86px;
    border: 1px solid #163588; /* Circle border color */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.circle-text {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-evenly; /* Distribute items evenly with equal spacing */
    align-items: center;
}

.or-text {
    color: #163588;
    font-size: 24px;
    margin: 0;
    word-wrap: break-word;
    text-align: center; /* Center the text */
    font-weight: 500;
}

.or-text.arabic {
    direction: rtl; /* Ensure RTL alignment */
}

.calculate-button {
    width: 270px;
    height: 54px;
    background: #A00000;
    color: white;
    text-align: center;
    line-height: 54px;
    border-radius: 50px;
    box-shadow: 0px 0px 15px rgba(69, 69, 69, 0.25);
    cursor: pointer;
    direction: rtl; /* Set text direction to RTL */
}

.calculate-button:hover {
    background: #800000; /* Darker red when hovered */
}

.horizontal-container {
    display: flex; /* Use flexbox for horizontal layout */
    justify-content: space-between; /* Spread items across the full width */
    width: 100%; /* Ensure the container takes the full width */
    gap: 64px; /* Optional: Add spacing between items */
    color: #A00000;
}

#arabic-result, #result {
    flex: 1; /* Ensure both items take equal width */
    width: 100%; /* Ensure the container takes the full width */
}

.results {
    width: 60%; /* Ensure the container spans the full width */
    display: flex; /* Use flexbox for layout if needed */
    justify-content: center; /* Center the content horizontally */
    margin: 16px 0; /* Optional: Add vertical spacing */
}

.result {
    width: 100%; /* Ensure the result spans the full width of its parent */
    padding: 16px; /* Optional: Add padding for better spacing */
    box-sizing: border-box; /* Include padding in the width calculation */
    text-align: center;
    color: #A00000;
    font-size: 20px;
}

#result2 {
    text-align: left; /* Align text to the right */
    font-size: 16px;
    font-weight: 400; /* Use the same weight for consistency */
    flex: 1;
}

#arabic-result {
    direction: rtl; /* Set text direction to RTL */
    text-align: right; /* Align text to the right */
    font-size: 16px;
    font-weight: 400; /* Use the same weight for consistency */
    flex: 1;
}

#result-date {
    font-size: 20px;
    font-weight: 600; /* Use the same weight for consistency */
    line-height: 37.44px; /* Ensure the same line height */
}

.info-all {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    gap: 24px;
}

.info-section {
    display: flex;
    gap: 64px;
    height: auto; /* Changed from 'fill' to 'auto' for proper height handling */
}

.info-section > * {
    flex: 1; /* Make all child elements take equal width */
}

.info.arabic,
.info {
    color: var(--Dark-Grey, #454545);
    font-size: 18px; /* Ensure both Arabic and English have the same size */
    font-weight: 600; /* Use the same weight for consistency */
    line-height: auto; /* Ensure the same line height */
    word-wrap: break-word;
}

.info.arabic {
    direction: rtl; /* Set text direction to RTL */
    text-align: right; /* Align text to the right */
}

.info {
    text-align: left; /* Align text to the left */
}

.info.arabic .details,
.info .details {
    color: var(--Dark-Grey, #454545);
    font-size: 14px; /* Ensure both Arabic and English have the same size */
    font-weight: 400; /* Use the same weight for consistency */
    line-height: 26px; /* Ensure the same line height */
    word-wrap: break-word;
}

.info.arabic .details {
    direction: rtl; /* Set text direction to RTL */
    text-align: right; /* Align text to the right */
}

.info .details {
    text-align: left; /* Align text to the left */
}

.footer {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    word-wrap: break-word;
    padding: 20px 0;
    border-top: 1px solid rgba(128, 128, 128, 0.3);
}

/* Mobile-specific styles */
@media (max-width: 1000px) {
    body {
        margin: 0;
        padding: 0, 32px, 32px, 32px;
        gap: 32px;
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .container {
        max-width: 100%; /* Prevent content from overflowing */
    }
    
    /* Header container */
    .header {
        top: 0; /* Start from the top of the page */
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        flex-direction: column; /* Stack items vertically */
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }
    
    /* Background bar */
    .header-bg {
        width: 75%;
        height: 100%;
        position: absolute;
        background: #163588;
        top: 0; /* Start from the top of the page */
        margin: 0; /* Remove any default margin */
        padding: 0; /* Remove any default padding */
        justify-content: center;
        align-items: center;

    }
    
    /* Header text */
    .header-text {
        width: 75%;
        }

    .header-text.arabic {
        text-align: center; /* Align text to the right */
    }
    
    .header-text.english {
        text-align: center; /* Align text to the left */
    }

    .header-text .title {
        font-size: 14px;
        line-height: 20px;
    }
    
    .header-text.arabic .subtitle {
        font-size: 20px;
        line-height: 26px;
    }
    
    .header-text.english .subtitle {
        font-size: 20px;
        line-height: auto;
    }
    
    /* Header image */
    .header-image {
        width: 150px;
        height: 150px;
        z-index: 1;
    }
    
    .input-section {
        flex-direction: column; /* Stack items vertically */
        gap: 16px;
        margin: 32px;
        width: 100%;
    }
    
    .input-group {
        width: 100%; /* Make the container take full width */
        gap: 20px;
    }
    
    .input-headlines {
        display: flex;
        flex-direction: row; /* Arrange items horizontally */
        justify-content: space-between; /* Push items to the edges */
        align-items: center; /* Vertically align items */
        width: 100%; /* Make the container take full width */
    }
    
    .input-label {
        font-size: 16px;
    }
    
    .input-label.arabic {
        font-size: 16px;
        line-height: 24px;
    }
    
    .input-box {
        height: 54px;
        font-size: 16px;
    }
    
    .input-box:focus {
        border: 1px solid #A00000; /* Change border color to red when active */
        outline: none; /* Remove the default outline */
    }
    
    .circle {
        width: 70px;
        height: 70px;
    }

    .or-text {
        font-size: 18px;
    }

    .horizontal-container {
        display: flex; /* Use flexbox for horizontal layout */
        justify-content: space-between; /* Spread items across the full width */
        width: 100%; /* Ensure the container takes the full width */
        gap: 16px; /* Optional: Add spacing between items */
        margin: 16px 0;
    }

    .results {
        width: 100%; /* Ensure the container spans the full width */
        margin: 16px 0; /* Optional: Add vertical spacing */
    }
    
    .result {
        font-size: 16px;
    }
    
    #result2 {
        font-size: 14px;
        line-height: auto;
    }
    
    #arabic-result {
        font-size: 14px;
        line-height: 20px;
    }
    
    #result-date {
        font-size: 20px;
        line-height: 28px; /* Ensure the same line height */
    }
    
    .info-section {
        flex-direction: column; /* Stack items vertically */
        gap: 24px;
        width: 100%;
    }
 
    .info.arabic,
    .info {
        font-size: 16px; /* Ensure both Arabic and English have the same size */
        line-height: auto; /* Ensure the same line height */
    }
    
    .info.arabic .details,
    .info .details {
        font-size: 12px; /* Ensure both Arabic and English have the same size */
        line-height: 20px; /* Ensure the same line height */
    }
    
    .footer {
        font-size: 12px;
    }
}