/* Modern Creative Design for Container Layout */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    /*font-family: "Simplified Arabic", -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;*/
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(15, 137, 59, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 203, 87, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(61, 210, 141, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 15s ease infinite;
}

@keyframes bgShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ===========================
   DESKTOP NAVBAR
   =========================== */

.modern-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo img {
    height: 50px;
    width: auto;
}

/* Desktop Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    color: #2d3748;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-theme));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 12px;
}

.nav-link-modern:hover,
.nav-item.active .nav-link-modern {
    color: white;
    transform: translateY(-2px);
}

.nav-link-modern:hover::before,
.nav-item.active .nav-link-modern::before {
    opacity: 1;
}

/* Buttons */
.btn-primary-modern {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-theme) 100%);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px rgba(15, 137, 59, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(15, 137, 59, 0.4);
    color: white;
}

.btn-outline-modern {
    background: transparent;
    color: var(--color-theme);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid var(--color-theme);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline-modern:hover {
    background: var(--color-theme);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 137, 59, 0.3);
}

/* Language Switcher */
.lang-switcher {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(15, 137, 59, 0.2);
    transition: all 0.3s ease;
    display: block;
}

.lang-switcher:hover {
    transform: rotate(360deg) scale(1.1);
    border-color: var(--color-theme);
    box-shadow: 0 4px 12px rgba(15, 137, 59, 0.2);
}

.lang-switcher img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Toggle - Hidden on Desktop */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    background: rgba(15, 137, 59, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(15, 137, 59, 0.2);
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-theme);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Header - Hidden on Desktop */
.sidebar-header {
    display: none;
}

/* Sidebar Overlay - Hidden on Desktop */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.sidebar-open {
    overflow: hidden;
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main-wrapper {
    padding-top: 80px;
    min-height: calc(100vh - 400px);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   FOOTER
   =========================== */

.modern-footer {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.modern-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-theme), var(--color-secondary), var(--color-grass), var(--color-yellow));
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-theme), var(--color-secondary));
    border-radius: 3px;
}

html[dir="rtl"] .footer-section h4::after {
    left: auto;
    right: 0;
    background: linear-gradient(90deg, var(--color-theme), var(--color-secondary));
}

/* Center h4 underline on mobile */
@media (max-width: 768px) {
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    html[dir="rtl"] .footer-section h4::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

html[dir="rtl"] .footer-links a:hover {
    transform: translateX(-5px);
}

.footer-links a::before {
    content: '→';
    opacity: 0;
    transition: opacity 0.3s ease;
}

html[dir="rtl"] .footer-links a::before {
    content: '←';
}

.footer-links a:hover::before {
    opacity: 1;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-card img {
    filter: brightness(0) invert(1);
    width: 24px;
    height: 24px;
}

.contact-card a {
    color: white;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: white;
    color: var(--color-theme);
    transform: translateY(-8px) rotate(360deg);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 2rem 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: white;
}

/* ===========================
   RESPONSIVE DESIGN - TABLET & MOBILE
   =========================== */

@media (max-width: 1199px) {

    /* Show Mobile Toggle */
    .mobile-toggle {
        display: flex;
    }

    /* Transform Menu to Sidebar */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: auto;
        width: 320px;
        max-width: 85vw;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 1rem;
        gap: 0.3rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
        z-index: 999;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    /* RTL Support */
    html[dir="rtl"] .nav-menu {
        right: auto;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
    }

    html[dir="rtl"] .nav-menu.active {
        transform: translateX(0);
    }

    /* Sidebar Top Border */
    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--color-theme), var(--color-ocean), var(--color-grass), var(--color-yellow));
    }

    /* Show Sidebar Header on Mobile */
    .sidebar-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid rgba(15, 137, 59, 0.1);
        list-style: none;
    }

    html[dir="rtl"] .sidebar-header {
        flex-direction: row-reverse;
    }

    .sidebar-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(15, 137, 59, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        color: var(--color-theme);
        font-size: 24px;
        font-weight: 300;
    }

    .sidebar-close:hover {
        background: var(--color-theme);
        color: white;
        transform: rotate(90deg);
    }

    /* Sidebar Items */
    .nav-item {
        width: 100%;
        display: block;
        margin-bottom: 0.3rem;
    }

    .nav-link-modern {
        width: 100%;
        justify-content: flex-start;
        padding: 0.9rem 1rem;
        margin-bottom: 0;
        font-size: 14px;
    }

    html[dir="rtl"] .nav-link-modern {
        text-align: right;
    }

    /* Sidebar Buttons */
    .nav-menu .btn-outline-modern,
    .nav-menu .btn-primary-modern {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
        padding: 0.8rem 0.5rem;
        font-size: 13px;
        gap: 0.3rem;
    }

    .nav-menu .btn-outline-modern svg,
    .nav-menu .btn-primary-modern svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* Language Switcher in Sidebar */
    .nav-menu .lang-switcher {
        margin: 0.5rem auto;
        width: 38px;
        height: 38px;
    }

    /* Footer Responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ===========================
   MOBILE SPECIFIC (< 768px)
   =========================== */

@media (max-width: 768px) {

    .nav-container {
        padding: 1rem;
    }

    .footer-container {
        padding: 0 1rem;
        text-align: center;
    }

    /* Smaller Sidebar */
    .nav-menu {
        width: 280px;
        padding: 1.5rem 0.8rem;
    }

    .nav-link-modern {
        padding: 0.8rem 0.8rem;
        font-size: 13px;
    }

    .nav-menu .btn-outline-modern,
    .nav-menu .btn-primary-modern {
        padding: 0.75rem 0.5rem;
        font-size: 12px;
    }

    .nav-menu .btn-outline-modern svg,
    .nav-menu .btn-primary-modern svg {
        width: 13px;
        height: 13px;
    }

    .nav-menu .lang-switcher {
        width: 36px;
        height: 36px;
    }

    /* Mobile Footer Centering */
    .footer-grid {
        display: block;
        text-align: center;
    }

    .footer-section {
        width: 100%;
        text-align: center;
        margin-bottom: 2rem;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        width: 48%;
        display: inline-block;
        vertical-align: top;
        min-width: 140px;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links a {
        justify-content: center;
    }

    .footer-links a::before {
        display: none;
    }

    .social-links {
        justify-content: center;
    }

    .contact-card {
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Extra Small (< 480px) */
@media (max-width: 480px) {

    .nav-menu {
        width: 260px;
        max-width: 90vw;
    }

    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        display: block;
        width: 100%;
    }
}
