/* =================================
   Global Styles & Variables
   ================================= */
:root {
    --primary-color: #b5e941;
    --secondary-color: #1b4b00;
    --text-dark: #33322e;
    --text-light: #777574;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #dee2e6;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

.section-title {
    color: var(--secondary-color);
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 40px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
    padding: 10px 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}


/* =================================
   Reusable Components
   ================================= */

/* --- Header & Footer --- */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    position: sticky;
    top: 0;
    z-index: 1020;
    /* Ensure it's above other content */
}

.main-header .navbar-brand {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.main-header .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    margin: 0 0.5rem;
}

.main-header .nav-link.active,
.main-header .nav-link:hover {
    color: var(--primary-color);
}

.main-footer {
    background-color: var(--text-dark);
    color: var(--background-light);
    padding: 2rem 0;
    text-align: center;
}

.main-footer p {
    margin: 0;
    color: var(--text-light);
}

/* --- Page Header (Banner) --- */
.page-header {
    
    background-color: var(--primary-color);
    /*background: url('../images/syrian_cover_1500x300.png'), linear-gradient(#b4e9417a, #1b4b0073) ;*/
    background-size: cover;
    background-blend-mode: luminosity;
    color: var(--secondary-color);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 5px solid var(--secondary-color);
}

.page-header h1 {
    font-weight: 700;
    margin: 0;
}

/* --- Cards (for Institutions, Ads, Partners, etc.) --- */
.data-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* height: 100%; */
    text-decoration: none;
    color: var(--text-dark);
}

.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.data-card .card-img-container {
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    position: relative;
    background-color: #eee;
}

.data-card .card-img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.data-card .card-body {
    padding: 1.25rem;
    /* flex-grow: 1; */
    display: flex;
    flex-direction: column;
}

.data-card .card-title {
    color: var(--secondary-color);
    font-weight: 700;
}

.data-card .card-text {
    color: var(--text-light);
    /* flex-grow: 1; */
    /* margin-bottom: 1rem; */
}

.data-card .rating-stars {
    color: #ffc107;
}

/* --- Forms --- */
.form-container {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .form-container {
        padding: 3rem;
    }
}

/* --- Homepage Specific --- */
.home-category-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.home-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.home-category-card i {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.home-category-card:hover i {
    color: var(--secondary-color);
}

.home-category-card span {
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0.5rem;
}


/* =================================
   Ads Carousel Enhancements
   ================================= */

.ad-card img {
    max-height: 120px;
    width: 100%;
    object-fit: cover;
    /* Ensures the image covers the area nicely */
}

#adsCarousel .carousel-control-prev-icon,
#adsCarousel .carousel-control-next-icon {
    background-color: var(--secondary-color);
    /* Dark green background */
    border-radius: 50%;
    /* Make it circular */
    padding: 1.2rem;
    /* Increase size */
    background-size: 50%;
    /* Make the arrow icon smaller inside the circle */
    opacity: 20%;
}

#adsCarousel .carousel-control-prev {
    left: -25px;
    /* Position outside the carousel for better visibility */
}

#adsCarousel .carousel-control-next {
    right: -25px;
    /* Position outside the carousel for better visibility */
}

/* On smaller screens, bring the controls back inside */
@media (max-width: 992px) {

    #adsCarousel .carousel-control-prev {
        left: -25px;
    }

    #adsCarousel .carousel-control-next {
        right: -25px;
    }
}

/* =================================
   Partner & Action Button Enhancements
   ================================= */

/* Partner Card Image Frame */
.partner-logo-frame {
    width: 60px;
    /* Fixed width for the frame */
    height: 60px;
    /* Fixed height for the frame */
    min-width: 60px;
    /* Prevent shrinking */
    margin-left: 15px;
    /* RTL equivalent of margin-right */
    padding: 5px;
    /* Space between image and frame border */
    border: 1px solid var(--border-color);
    border-radius: 50%;
    /* Circular frame */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    transition: border-color 0.3s ease;
}

.partner-card:hover .partner-logo-frame {
    border-color: var(--primary-color);
    /* Highlight frame on hover */
}

.partner-logo-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Ensure logo fits without distortion */
}

/* Remove fixed width/height from the image itself, frame controls it */
.partner-card img {
    width: auto;
    height: auto;
}


/* New Action Card Buttons Styling */
.action-card-button {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.action-card-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.action-card-button i {
    color: var(--secondary-color);
    transition: color 0.3s ease;
    margin-bottom: 0.5rem;
}

.action-card-button:hover i {
    color: var(--primary-color);
}

.action-card-button span {
    font-weight: 700;
    color: var(--secondary-color);
}

/* =================================
   Institution Profile Page
   ================================= */
.info-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.5rem;
}

.info-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.rating-stars {
    color: #ffc107;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--background-light);
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: scale(1.1);
}

/* =================================
   Form Container (Shared by multiple pages)
   ================================= */
.form-container {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .form-container {
        padding: 3rem;
    }
}

/* =================================
   Testimonials Carousel Controls
   ================================= */

#testimonialsCarousel {
    padding: 0 30px;
    /* Add padding to make space for controls */
}

#testimonialsCarousel .carousel-control-prev,
#testimonialsCarousel .carousel-control-next {
    width: 5%;
    /* Adjust width of control area */
}

#testimonialsCarousel .carousel-control-prev-icon,
#testimonialsCarousel .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.2);
    /* Semi-transparent background */
    border-radius: 50%;
    background-size: 60%;
}

#testimonialsCarousel .carousel-control-prev {
    left: -10px;
    /* Position control slightly outside */
}

#testimonialsCarousel .carousel-control-next {
    right: -10px;
    /* Position control slightly outside */
}

/* ===================================================
   Carousel Height & Image Responsiveness Fixes
   =================================================== */

/* 1. Fix Height for Photo Carousel */
#photoCarousel .carousel-inner {
    height: 450px;
    /* Set a fixed height for the carousel container */
    border-radius: 8px;
    /* Ensure the container itself has rounded corners */
}

#photoCarousel .carousel-item {
    height: 100%;
    /* Make each slide fill the container's height */
}

#photoCarousel .carousel-item img {
    height: 100%;
    /* Force the image to fill the height of the slide */
    width: 100%;
    /* Force the image to fill the width of the slide */
    object-fit: cover;
    /* This is the key: it makes the image cover the entire area
                               without distortion. It will crop the image slightly
                               (from the sides or top/bottom) to fit the container. */
    object-position: center;
    /* Center the image within its frame */
}

/* On smaller screens (like mobile), let the height be automatic to avoid overly tall images */
@media (max-width: 768px) {
    #photoCarousel .carousel-inner {
        height: auto;
        /* Let the image's aspect ratio determine the height */
    }
}


/* 2. Fix Height for Video Carousel */
#videoCarousel .carousel-inner {
    border-radius: 8px;
    /* Ensure the container has rounded corners */
    background-color: #000;
    /* Add a black background for a cinematic feel */
}

/* The .ratio class from Bootstrap already handles the responsiveness of the iframe,
   so we don't need to set a fixed height here. The video will always maintain
   its 16:9 aspect ratio, which is ideal. */


/* 3. Ensure Partner Logos are Responsive and Centered */
.partner-logo-frame img {
    /* These properties were already good, but we re-state them for clarity */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* 'contain' is better for logos to ensure the whole logo is visible */
    object-position: center;
}

/* =================================
   Authentication Pages Styling
   ================================= */

.auth-form-container {
    max-width: 480px;
    padding: 2rem;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Fix for floating labels in RTL with Bootstrap */
.form-floating > label {
    right: 0;
    left: auto;
}
