/* Votre thème CSS original */
/* Navbar Styles */
.navbar {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    direction: rtl;
}

.navbar-container {
    max-width: 1200px;
    height: 200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
}

.navbar-slogan {
    height: 50px;
    width: auto;
}

.navbar-title {
    color: #00A95C;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-lang-switcher {
    background: #00A95C;
    border: 2px solid #00A95C;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-lang-switcher:hover {
    background: #00A95C;
    transform: translateY(-2px);
}

/* Support LTR pour la navbar */
[dir="ltr"] .navbar {
    direction: ltr;
}

[dir="ltr"] .navbar-brand {
    flex-direction: row-reverse;
}

/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    .navbar-brand {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .navbar-logo {
        height: 50px;
    }

    .navbar-slogan {
        height: 40px;
    }

    .navbar-title {
        font-size: 20px;
    }

    .navbar-actions {
        justify-content: center;
    }
}

/* Animation de chargement pour le bouton de langue */
.navbar-lang-switcher.loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

.navbar-lang-switcher.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* En-tête */
.header {
    text-align: right;
    margin-bottom: 20px;
}

.lang-switcher {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-switcher i {
    margin-right: 8px;
}

[dir="rtl"] .lang-switcher i {
    margin-right: 0;
    margin-left: 8px;
}

/* Conteneur du formulaire */
.form-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.form-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
}

.form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Titre du formulaire */
.form-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.form-title i {
    color: #00A95C;
    margin-right: 10px;
}

[dir="rtl"] .form-title i {
    margin-right: 0;
    margin-left: 10px;
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #555;
    font-size: 16px;
}

.form-label i {
    color: #00A95C;
    margin-right: 8px;
}

[dir="rtl"] .form-label i {
    margin-right: 0;
    margin-left: 8px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: color 0.3s ease;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    color: #333;
    border-color: #00A95C;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

[dir="rtl"] .radio-custom {
    margin-right: 0;
    margin-left: 10px;
}

.radio-label input[type="radio"]:checked+.radio-custom {
    border-color: #00A95C;
    background: #00A95C;
}

.radio-label input[type="radio"]:checked+.radio-custom::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked~span {
    color: #00A95C;
    font-weight: 600;
}

/* Champs de saisie */
.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input:focus {
    outline: none;
    border-color: #00A95C;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

/* Messages d'erreur */
.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-input.error {
    border-color: #e74c3c;
}

/* Bouton de soumission */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #00A95C 0%, #FFD700 50%, #D01C1F 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 20px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    margin-right: 10px;
}

[dir="rtl"] .submit-btn i {
    margin-right: 0;
    margin-left: 10px;
}

/* Message d'information */
.info-message {
    background: #e8f4fd;
    border: 1px solid #b3d9f7;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #00A95C;
    font-size: 14px;
    margin-top: 20px;
}

.info-message i {
    margin-right: 8px;
}

[dir="rtl"] .info-message i {
    margin-right: 0;
    margin-left: 8px;
}

/* Animation de chargement */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .form-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .form-title {
        font-size: 20px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        justify-content: flex-start;
    }
}

/* Support RTL */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .header {
    text-align: left;
}

[dir="rtl"] .form-title {
    text-align: center;
}

/* Styles pour SweetAlert en RTL */
.rtl-swal {
    direction: rtl;
    text-align: right;
}

.rtl-swal .swal2-title {
    text-align: right;
}

.rtl-swal .swal2-content {
    text-align: right;
}

.rtl-swal .swal2-actions {
    flex-direction: row-reverse;
}

/* Animation personnalisée pour SweetAlert */
.swal2-popup {
    border-radius: 15px !important;
}

.swal2-title {
    font-size: 20px !important;
    font-weight: 600 !important;
}

.swal2-content {
    font-size: 16px !important;
}

/* Additional styles for MESRS Portal */
.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.card-text {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-light);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.badge-accent {
    background: var(--accent-color);
    color: white;
}

/* Statistics cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.stat-title {
    font-size: 1rem;
    color: var(--text-light);
}

/* Pillar cards */
.pillar-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-top: 4px solid transparent;
}

.pillar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.pillar-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.pillar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.pillar-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* Platform cards */
.platform-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.platform-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.platform-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.platform-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Quick link cards */
.quicklink-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quicklink-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    background: var(--primary-color);
    color: white;
}

.quicklink-card:hover .quicklink-icon,
.quicklink-card:hover .quicklink-title,
.quicklink-card:hover .quicklink-count {
    color: white;
}

.quicklink-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.quicklink-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.quicklink-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Organigram tree */
.organigram-tree {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tree-item:last-child {
    border-bottom: none;
}

.tree-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.tree-info {
    flex: 1;
}

.tree-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.tree-position {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 10px;
}

.tree-contact {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 250px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* Partner logos */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.partner-logo {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.partner-logo img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item a {
    color: var(--text-light);
}

.breadcrumb-item.active a {
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* Dropdown menu styles */
.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 15px 0;
    z-index: 1000;
    display: none;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    border-left-color: var(--primary-color);
    background: var(--light-color);
}

/* RTL support for dropdown */
[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

[dir="rtl"] .dropdown-menu a {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .dropdown-menu a:hover {
    border-left: none;
    border-right-color: var(--primary-color);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    text-align: center;
    padding: 15px;
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
}

#mobileMenu {
    display: none;
    background: white;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Mobile styles */
@media (max-width: 992px) {
    .main-menu .main-nav {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .navbar-actions {
        gap: 10px;
    }
}

@media (min-width: 993px) {

    .mobile-menu-toggle,
    #mobileMenu {
        display: none !important;
    }

    .main-menu .main-nav {
        display: flex !important;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu item hover effects */
.main-nav>li>a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* Active menu item */
.main-nav>li>li>a.active {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--light-color);
}

/* Badge styles */
.dropdown-menu .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
}

/* Mobile submenu arrow rotation */
.fa-chevron-up {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    .navbar-brand {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .navbar-logo {
        height: 50px;
    }

    .navbar-title {
        font-size: 1.1rem;
    }

    .navbar-actions {
        justify-content: center;
        width: 100%;
    }

    /* Mobile menu styles */
    #mobileMenu ul li {
        border-bottom: 1px solid var(--border-color);
    }

    #mobileMenu ul li a,
    #mobileMenu ul li>div {
        display: flex;
        align-items: center;
        padding: 15px 0;
        color: var(--dark-color);
        text-decoration: none;
        font-weight: 500;
    }

    #mobileMenu ul li>div {
        cursor: pointer;
        justify-content: space-between;
    }

    #mobileMenu .submenu {
        display: none;
        padding-left: 20px;
    }

    #mobileMenu .submenu a {
        padding: 10px 0;
        font-weight: normal;
    }
}

/* Search bar responsive */
@media (max-width: 768px) {
    #searchBar .container {
        flex-direction: column;
        gap: 10px;
    }

    #searchBar .container input,
    #searchBar .container button {
        width: 100%;
    }
}

/* Main menu container */
.main-nav {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}

.main-nav>li {
    position: relative;
}

.main-nav>li>a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.main-nav>li>a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* Chevron icon for dropdowns */
.main-nav>li>a .fa-chevron-down {
    font-size: 0.8rem;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.main-nav>li:hover>a .fa-chevron-down {
    transform: rotate(180deg);
}

/* Responsive logo positioning */
@media (max-width: 992px) {
    .navbar-brand {
        flex-direction: column !important;
        text-align: center;
    }

    .navbar-logo {
        order: -1;
        margin-bottom: 10px;
    }

    .navbar-title {
        font-size: 1.2rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .partners-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .tree-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .tree-contact {
        justify-content: center;
    }

    .main-menu ul {
        gap: 15px;
    }

    .navbar-title {
        font-size: 1.1rem;
    }
}