:root {
    --primary-green-darkest: #064e3b;
    /* Tailwind green-900 */
    --primary-green-dark: #057a55;
    /* Tailwind green-700 (adjusted) */
    --primary-green-base: #047857;
    /* Tailwind green-800 -> now base green */
    --primary-green-medium: #10b981;
    /* Tailwind green-500 */
    --primary-green-light: #34d399;
    /* Tailwind green-400 */
    --primary-green-lightest: #d1fae5;
    /* Tailwind green-100 */
    --accent-gold: #facc15;
    /* Tailwind yellow-400 */
    --accent-gold-dark: #ca8a04;
    /* Tailwind yellow-500 */
    --text-light: #f9fafb;
    /* Tailwind gray-50 */
    --text-medium: #d1d5db;
    /* Tailwind gray-300 */
    --text-dark: #1f2937;
    /* Tailwind gray-800 */
    --background-light: #f0fdf4;
    /* Tailwind green-50 */
    --background-card: #ffffff;
    --border-color: #e5e7eb;
    /* Tailwind gray-200 */
    --border-color-light: #f3f4f6;
    /* Tailwind gray-100 */
}

body {
    font-family: "Cairo", sans-serif;
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.main-layout-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Ensures this container takes up available space, pushing footer down */
}

/* Scrollable areas - Modified for global scroll on index */
.sidebar-scroll,
.content-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.4) transparent;
    background: var(--background-card);
    border-radius: 0.5rem;
}

/* Specific styling for pages that are NOT the index page */
.flex-grow.flex.flex-col.overflow-hidden .content-scroll {
    height: calc(100vh - 4rem - 1.5rem);
    overflow-y: auto;
}


.sidebar-scroll {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.sidebar-scroll::-webkit-scrollbar,
.content-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.content-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(34, 197, 94, 0.5);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-track,
.content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.4) transparent;
    padding-bottom: 12px;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(34, 197, 94, 0.5);
    border-radius: 3px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* Navbar Enhancements */
nav {
    background: var(--primary-green-darkest);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 4rem;
}

nav .nav-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    height: 100%;
}

nav .logo-link {
    transition: opacity 0.3s ease;
}

nav .logo-link:hover {
    opacity: 0.85;
}

nav .logo-text-main {
    font-weight: 700;
    font-size: 1.125rem;
}

nav .logo-text-sub {
    font-size: 0.8rem;
    opacity: 0.8;
}

nav .nav-links a {
    color: var(--text-medium);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
}

nav .nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-gold);
    transition: width 0.3s ease;
}

nav .nav-links a:hover,
nav .nav-links a.active-link {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.05);
}

nav .nav-links a:hover::after,
nav .nav-links a.active-link::after {
    width: 70%;
}

nav .nav-links a.active-link {
    color: var(--accent-gold) !important;
}

nav .nav-links a.active-link::after {
    background-color: var(--accent-gold);
    width: 70%;
}

nav .social-icon {
    color: var(--text-medium);
    padding: 0.625rem;
    font-size: 1rem;
    border-radius: 50%;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
}

nav .social-icon:hover {
    color: var(--accent-gold);
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

nav .lang-switcher a {
    padding: 0.375rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    font-weight: 600;
    color: var(--text-medium);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

nav .lang-switcher a.font-semibold {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-green-darkest);
}

nav .lang-switcher a:not(.font-semibold):hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

#mobile-menu {
    background-color: var(--primary-green-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#mobile-menu a {
    color: var(--text-light);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

#mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}

#mobile-menu .social-icon:hover {
    color: var(--accent-gold);
}

/* Main content area layout */
.content-area-with-sidebars {
    padding-top: 4rem;
    /* For fixed navbar */
    padding-bottom: 1.5rem;
    /* Space above static footer */
    flex-grow: 1;
    display: flex;
    gap: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 100%;
}

/* Headings */
h2.sidebar-section-title,
main h2 {
    position: relative;
    padding-bottom: 0.625rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--primary-green-darkest);
}

h2.sidebar-section-title::after,
main h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-green-medium);
    border-radius: 2px;
}

main h2 {
    font-size: 1.875rem;
}

h2.sidebar-section-title {
    font-size: 1.125rem;
}

main h2.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Buttons */
button,
.button-like {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    border-radius: 0.375rem;
    font-weight: 600;
}

button:focus,
.button-like:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
}

button:active,
.button-like:active {
    transform: translateY(1px);
}

/* Page Footer - Static */
.page-footer {
    background-color: var(--primary-green-darkest);
    color: var(--text-medium);
    font-size: 0.875rem;
    width: 100%;
    height: auto;
    min-height: 4.5rem;
    padding: 2.5rem 1rem;
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    /* Pushes footer to bottom if content is short */
}

.page-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), var(--primary-green-medium), var(--accent-gold));
    opacity: 0.9;
}

.footer-content-wrapper {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 220px;
}

.footer-section h4 {
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    padding-bottom: 0.375rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-gold);
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li a {
    color: var(--text-medium);
    text-decoration: none;
    padding: 0.25rem 0;
    display: inline-block;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-gold);
    padding-left: 5px;
}

.footer-section p,
.footer-section address {
    margin: 0.25rem 0;
    line-height: 1.6;
    font-style: normal;
}

.footer-social-icons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.footer-social-icons a {
    color: var(--text-medium);
    font-size: 1.25rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-social-icons a:hover {
    color: var(--accent-gold);
    transform: scale(1.15);
}

.footer-bottom-text {
    text-align: center;
    width: 100%;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(209, 213, 219, 0.8);
}

/* Article cards (used in sliders) */
article.slide {
    transition: box-shadow 0.35s ease, transform 0.35s ease;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

article.slide:hover {
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.18);
    transform: translateY(-4px);
}

article.slide:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.12);
}

/* Slider Styles */
.slider-container {
    position: relative;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.slider-track {
    display: flex;
    overflow: hidden;
    scroll-behavior: smooth;
    border-radius: 0.75rem;
}

.slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0.75rem;
}

.slide img {
    object-fit: cover;
    width: 100%;
    height: 380px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0;
}

.slide-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-green-darkest);
    margin-bottom: 0.5rem;
}

.slide-content p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(6, 78, 59, 0.75);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background-color: var(--accent-gold-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    transform: translateY(-50%) scale(1.08);
}

.slider-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.6);
}

.slider-btn.left {
    left: 1rem;
}

.slider-btn.right {
    right: 1rem;
}

.slider-play-pause-btn {
    background-color: rgba(6, 78, 59, 0.75);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 15;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-play-pause-btn:hover {
    background-color: var(--accent-gold-dark);
    transform: scale(1.1);
}

/* Welcome Banner --- UPDATED FOR NEW LAYOUT --- */
.welcome-banner {
    position: relative;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(4, 120, 87, 0.25);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
    user-select: none;
    min-height: 280px;
    /* REDUCED HEIGHT */
    background: none;
}

.welcome-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background: url('../img/banner.jpg') no-repeat center center/cover;
    filter: brightness(55%) contrast(105%);
}

.welcome-banner>* {
    position: relative;
    z-index: 1;
}

/* CORRECTED: Classes for left/right text containers */
.welcome-text {
    flex: 1;
    /* This is the key change */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertically centers content */
}

.welcome-text-left {
    align-items: flex-start;
    text-align: left;
}

.welcome-text-right {
    align-items: flex-end;
    text-align: right;
}

.welcome-text h1 {
    font-size: 2rem;
    /* Adjusted for smaller banner */
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    line-height: 1.25;
}

.welcome-text .highlight-mauritanie {
    color: var(--accent-gold);
}

.welcome-text p {
    font-size: 1rem;
    /* Adjusted for smaller banner */
    margin-top: 0.75rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.7;
}

.welcome-banner img.embassy-flag {
    max-width: 120px;
    /* Adjusted for smaller banner */
    height: auto;
    border-radius: 0.5rem;
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.35));
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    /* Prevent the image from shrinking */
}

.welcome-banner img.embassy-flag:hover {
    transform: scale(1.07);
}

/* MFA Banner - Updated Style */
.mfa-banner {
    background-color: var(--background-card);
    border: 1px solid var(--border-color-light);
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    color: var(--primary-green-darkest);
    padding: 1.75rem 2rem;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    user-select: none;
}

.mfa-banner:hover {
    border-color: var(--primary-green-medium);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
    transform: translateY(-3px);
}

.mfa-banner img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mfa-banner:hover img {
    transform: scale(1.05);
}

.mfa-banner span .fa-external-link-alt {
    font-size: 0.8em;
    opacity: 0.7;
}


/* Back To Top Button */
#backToTopBtn {
    position: fixed;
    right: 25px;
    background-color: var(--primary-green-base);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    z-index: 1000;
    transition: opacity 0.3s ease, background-color 0.3s ease, bottom 0.3s ease, transform 0.2s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

#backToTopBtn.visible {
    opacity: 1;
    visibility: visible;
}

#backToTopBtn:hover {
    background-color: var(--accent-gold-dark);
    transform: scale(1.08) translateY(-2px);
}

/* Nouakchott Time (Right Sidebar) */
.nouakchott-time {
    background-color: var(--primary-green-lightest);
    border: 1px solid var(--primary-green-light);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.nouakchott-time h3 {
    color: var(--primary-green-darkest);
    font-weight: 700;
    margin-bottom: 0.375rem;
    font-size: 1rem;
}

.nouakchott-time p {
    color: var(--primary-green-dark);
    font-size: 1.375rem;
    font-weight: 700;
}

/* Sidebar Link Item (Right Sidebar) */
.sidebar-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    color: var(--primary-green-darkest);
    font-weight: 600;
}

.sidebar-link-item:hover {
    background-color: var(--primary-green-lightest);
    color: var(--accent-gold-dark) !important;
    transform: translateX(4px);
}

.sidebar-link-item i {
    color: var(--primary-green-base);
    transition: color 0.2s ease;
    width: 1.25em;
    text-align: center;
}

.sidebar-link-item:hover i {
    color: var(--accent-gold-dark);
}

/* Diplomats Section (Left Sidebar) */
.diplomat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #fdfefe;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.diplomat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.09);
}

.diplomat-item img {
    width: 120px;
    height: 150px;
    border-radius: 0.375rem;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--primary-green-medium);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.diplomat-item .diplomat-info h3 {
    font-weight: 700;
    color: var(--primary-green-darkest);
    margin-bottom: 0.125rem;
    font-size: 1.05rem;
}

.diplomat-item .diplomat-info p {
    font-size: 0.875rem;
    color: #4b5563;
}

/* Image Gallery (Horizontal Scroll in Main Content) */
#imageGalleryContainer .relative {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(6, 78, 59, 0.75);
    color: white;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.gallery-nav-btn:hover {
    background-color: var(--accent-gold-dark);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.6);
}

#galleryPrev {
    left: 0.75rem;
}

#galleryNext {
    right: 0.75rem;
}

#imageGallery img {
    height: 220px;
    width: auto;
    max-width: 340px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 0.625rem;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#imageGallery img:hover {
    transform: scale(1.04);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.18);
}

/* ======================================================================== */
/* =================== RESPONSIVE DESIGN MEDIA QUERIES ==================== */
/* ======================================================================== */

/* Medium devices (tablets, less than 1024px) */
@media (max-width: 1024px) {
    .content-area-with-sidebars {
        flex-direction: column;
        gap: 1.5rem;
    }

    aside.sidebar-scroll {
        width: 100%;
        height: auto;
        order: 3; /* Places sidebars after main content */
    }
    
    main.content-scroll {
       order: 2;
    }
    
    aside.w-64.xl\:w-72:first-of-type {
       order: 1; /* Keep diplomat sidebar on top */
    }

    .sidebar-scroll,
    .content-scroll {
        height: auto;
        overflow-y: visible;
    }
    
    .welcome-text h1 {
        font-size: 1.75rem;
    }

    .welcome-text p {
        font-size: 0.9rem;
    }

    .welcome-banner img.embassy-flag {
        max-width: 110px;
    }
    
    .diplomat-item {
      flex-direction: row;
      text-align: left;
      gap: 1rem;
    }
    
    .diplomat-item img {
      width: 80px;
      height: 100px;
      margin-bottom: 0;
    }
}

/* Small devices (phones, less than 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* Base font size adjustment */
    }

    nav .nav-container {
      padding-left: 0.5rem;
      padding-right: 0.5rem;
    }
    
    nav .logo-text-main {
      font-size: 1rem;
    }
    
    .hidden.md\:flex {
      display: none;
    }
    
    button.md\:hidden {
      display: block;
    }

    .content-area-with-sidebars {
      padding-left: 0.5rem;
      padding-right: 0.5rem;
      gap: 1rem;
    }
    
    main.content-scroll {
      padding: 1rem;
    }

    aside.sidebar-scroll:last-of-type {
        display: none; /* Hide the right sidebar on the smallest screens */
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
        min-height: auto;
    }

    .welcome-text {
        max-width: 100%;
        align-items: center;
        text-align: center;
    }

    .welcome-text-left {
        order: 2;
        margin-top: 1rem;
    }

    .welcome-banner img.embassy-flag {
        order: 1;
        max-width: 100px;
    }

    .welcome-text-right {
        order: 3;
        margin-top: 1.5rem;
    }
    
    .slide img {
      height: 250px;
    }
    
    .slide-content h3 {
      font-size: 1.1rem;
    }
    
    .slide-content p {
      font-size: 0.875rem;
    }
    
    .footer-content-wrapper {
      flex-direction: column;
      align-items: center;
      text-align: center;
    }
    
    .footer-section h4::after {
      left: 50%;
      transform: translateX(-50%);
    }

    .footer-social-icons {
      justify-content: center;
    }
    
    #backToTopBtn {
      width: 40px;
      height: 40px;
      font-size: 18px;
      right: 15px;
      bottom: 15px;
    }
}
