/*
   Egypt-Morocco Navigation Chamber
   Main Stylesheet
*/

:root {
    /* Colors inspired by Egyptian and Moroccan flags */
    --egypt-red: #ce1126;
    --egypt-white: #ffffff;
    --egypt-black: #000000;
    --morocco-red: #c1272d;
    --morocco-green: #006233;

    /* Main theme colors */
    --primary-color: var(--morocco-red);
    --secondary-color: var(--morocco-green);
    --accent-color: #f8c304; /* Gold color common in Arabic design */
    --text-color: #333333;
    --light-bg: #f5f5f5;
    --dark-bg: #2c3e50;
    --header-bg: var(--primary-color);
    --footer-bg: var(--dark-bg);
}

/* Spinner/Loading styles */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Cairo', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: var(--header-bg);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    margin-right: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: white; /* Ensure logo text is white */
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
}

/* Close menu button - hidden by default */
.close-menu {
    display: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: rgba(255, 255, 255, 0.8); /* Slightly less bright than the logo */
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: white; /* Full white on hover/active */
    background-color: rgba(255, 255, 255, 0.2);
}

/* Language selector */
.language-selector {
    position: relative;
    margin-left: 1.5rem;
}

.language-selector select {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8); /* Match nav links */
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover,
.language-selector select:focus {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Hero section */
.hero {
    color: white;
    text-align: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    height: 600px; /* Fixed height for the hero section */
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 7.5rem 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.slider-dots {
    display: flex;
    gap: 10px;
    margin: 0 20px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    padding: 0;
    margin: 0 5px;
    outline: none;
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.slider-dot.active {
    background-color: white;
}

.slider-arrow {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.7;
    transition: all 0.3s ease;
    outline: none;
}

.slider-arrow:hover,
.slider-arrow:focus {
    opacity: 1;
    transform: scale(1.1);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.1rem !important;
    font-style: italic;
    margin-bottom: 2rem !important;
}

.hero-buttons {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
}

/* Section styles */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    display: inline-block;
}

.section-title h2:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 0.5rem auto 0;
}

/* Featured news */
.featured-news {
    background-color: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.news-excerpt {
    margin-bottom: 1rem;
}

/* About section */
.about-section {
    background-color: var(--light-bg);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Board members */
.board-members {
    background-color: white;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.members-grid.single-member {
    display: flex;
    justify-content: center;
    max-width: 300px;
    margin: 0 auto 2rem;
}

.members-grid.single-member .member-card {
    width: 100%;
}

.member-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.member-card:hover {
    transform: translateY(-5px);
}

.member-image {
    height: 250px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.member-card:hover .member-image img {
    transform: scale(1.05);
}

.member-info {
    padding: 1.5rem;
}

.member-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.member-position {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Contact section */
.contact-section {
    background-color: var(--light-bg);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Map */
.map-container {
    height: 400px;
    margin-top: 3rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 50px;
    margin-right: 10px;
}

.footer-about p {
    margin-bottom: 1rem;
}

.footer-links h3,
.footer-contact h3,
.footer-about h3 {
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-links h3:after,
.footer-contact h3:after,
.footer-about h3:after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 0.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: #ddd;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: white;
}

.footer-contact p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #aaa;
}

/* Sponsors section */
.sponsors-section {
    background-color: var(--light-bg);
    padding: 4rem 0;
}

/* Sponsors Subtitle */
.sponsors-subtitle {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Sponsors Slider */
.sponsors-slider-container {
    margin: 2rem 0;
    overflow: hidden;
    position: relative;
    padding: 0.5rem 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.sponsors-slider {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.sponsors-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
    padding: 1rem 0;
}

.sponsors-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(
            calc(-200px * 8 - 16rem)
        ); /* Width of 8 sponsor items + margins */
    }
}

.sponsor-item {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    height: 120px;
    width: 200px;
    flex-shrink: 0;
    margin: 0 1rem;
}

.sponsor-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.sponsor-item img {
    max-width: 100%;
    max-height: 100px;
    transition: all 0.3s ease;
    filter: grayscale(20%);
}

.sponsor-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Add gradient overlays for smooth transition */
.sponsors-slider-container::before,
.sponsors-slider-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.sponsors-slider-container::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.sponsors-slider-container::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

@media screen and (max-width: 768px) {
    .sponsor-item {
        width: 180px;
        padding: 1rem;
    }

    @keyframes scroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(
                calc(-180px * 8 - 16rem)
            ); /* Width of 8 sponsor items on tablet + margins */
        }
    }
}

@media screen and (max-width: 480px) {
    .sponsor-item {
        width: 150px;
        margin: 0 0.5rem;
    }

    @keyframes scroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(
                calc(-150px * 8 - 8rem)
            ); /* Width of 8 sponsor items on mobile + margins */
        }
    }

    .sponsors-slider-container::before,
    .sponsors-slider-container::after {
        width: 50px;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}
.mt-2 {
    margin-top: 2rem;
}
.mt-3 {
    margin-top: 3rem;
}
.mb-1 {
    margin-bottom: 1rem;
}
.mb-2 {
    margin-bottom: 2rem;
}
.mb-3 {
    margin-bottom: 3rem;
}

/* Overlay and Mobile Menu */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100%;
    background-color: white;
    z-index: 999;
    padding: 20px;
    transition: right 0.3s ease;
    overflow-y: auto;
}

body.menu-active .overlay {
    opacity: 1;
    visibility: visible;
}

body.menu-active .mobile-menu {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
}

.mobile-menu ul li {
    margin: 15px 0;
}

.mobile-menu ul li a {
    color: var(--text-color);
    font-size: 1.1rem;
    display: block;
    padding: 10px;
}

.mobile-menu ul li a:hover {
    background-color: var(--light-bg);
    border-radius: 4px;
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}
