/* --- متغيرات CSS محسنة --- */
:root {
    --primary-color: #034856; /* لون أساسي غامق */
    --secondary-color: #115C55; /* لون ثانوي مكمل */
    --accent-color: #ffd700; /* لون مميز (ذهبي) */
    --light-color: #f8f9fa; /* لون فاتح للخلفيات */
    --text-color-dark: #333; /* لون النص الغامق */
    --text-color-light: #fff; /* لون النص الفاتح */
    --font-family: 'Almarai', sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #f0c500 100%);
}

/* --- إعادة ضبط الأنماط الأساسية --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color-dark);
    line-height: 1.7;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- شريط التنقل العلوي محسن --- */
.navbar {
    position: relative;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/flag.PNG');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.08;
    z-index: -1;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 20px 20px;
    position: relative;
}

.header-title {
    text-align: center;
    flex-grow: 1;
    font-size: 1.8rem;
    line-height: 1.4;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-title::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.header-title p {
    margin: 0;
    display: block;
    line-height: 1.3;
    transition: var(--transition);
}

.logo {
    height: 160px;
    transition: var(--transition);
    filter: drop-shadow(3px 6px 12px rgba(0, 0, 0, 0.2));
    transform-style: preserve-3d;
}

.logo:hover {
    transform: perspective(600px) rotateY(8deg) scale(1.08);
    filter: drop-shadow(5px 8px 15px rgba(0, 0, 0, 0.3));
}

.navbar-collapse {
    width: 100%;
    background: var(--gradient-primary);
    border-radius: 0 0 20px 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-nav {
    display: flex;
    justify-content: center;
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.nav-item:last-child::after {
    display: none;
}

.nav-link {
    display: block;
    padding: 20px 30px;
    color: var(--text-color-light);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn {
    display: none;
    background: var(--gradient-primary);
    color: var(--text-color-light);
    border: none;
    padding: 15px 20px;
    font-size: 1.5rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    transition: var(--transition);
}

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

/* --- السلايدر محسن --- */
.hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 20px;
    box-shadow: var(--box-shadow);
}

.carousel {
    position: relative;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
    transition: var(--transition);
}

.carousel-slide:hover img {
    filter: brightness(1) contrast(1.2);
    transform: scale(1.05);
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 28px;
    padding: 18px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.prev:hover, .next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.prev {
    left: 25px;
}

.next {
    right: 25px;
}

/* --- شريط الأخبار محسن --- */
.news-ticker-section {
    background: var(--gradient-primary);
    color: var(--text-color-light);
    padding: 18px 0;
    font-size: 1.1rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 60px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.news-ticker-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.news-ticker {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.ticker-icon {
    font-size: 1.8rem;
    margin-left: 20px;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.news-ticker marquee {
    flex-grow: 1;
}

.news-ticker a {
    color: var(--text-color-light);
    text-decoration: none;
    margin: 0 50px;
    transition: var(--transition);
    font-weight: 500;
}

.news-ticker a:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* --- الأقسام والبطاقات محسنة --- */
.sections-container {
    padding: 60px 0;
}

.title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin: 0 0 25px;
    font-weight: 800;
    position: relative;
    padding-bottom: 20px;
}

.title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.title::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.section-description {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 50px;
    color: #666;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 60px;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    margin: 50px 0;
}

.card {
    background: var(--text-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-img-container {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-img-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 60%, rgba(255, 215, 0, 0.1));
    opacity: 0;
   transition: var(--transition);
}

.card:hover .card-img-container::after {
    opacity: 1;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
   /* transition: var(--transition);*/
}

.card:hover .card-img-container img {
    transform: scale(1.15);
    filter: brightness(1.1) contrast(1.1);
}

.card-body {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
}

.card-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.card-text {
    color: #666;
    margin-bottom: 25px;
    flex-grow: 1;
    font-size: 1.05rem;
    line-height: 1.7;
}

.card-btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    background: var(--gradient-primary);
    color: var(--text-color-light);
    text-align: center;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.card-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.card-btn:hover::before {
    left: 100%;
}

.card-btn:hover {
    background: var(--gradient-accent);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* --- قسم حول المديرية محسن --- */
.about-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
}

.about-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.about-content p {
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: 25px;
    color: #555;
}

/* --- التذييل محسن --- */
footer {
    background: var(--gradient-primary);
    color: var(--text-color-light);
    position: relative;
    overflow: hidden;
}

.painting img {
    width: 100%;
    display: block;
    filter: brightness(0.9);
}

.footer-bottom {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    padding: 50px 0 15px;
    position: relative;
}

.footer-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-accent);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-section {
    margin-bottom: 40px;
}

.footer-title {
    font-size: 1.6rem;
    margin-bottom: 25px;
    position: relative;
    font-weight: 700;
    color: var(--accent-color);
}
/*
.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}
*/
.footer-content p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.footer-content p:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-content i {
    margin-left: 15px;
    font-size: 1.4rem;
    color: var(--accent-color);
    width: 25px;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 25px;
}

.social-links a {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    color: var(--text-color-light);
    font-size: 1.4rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 50%;
    transform: scale(0);
    transition: var(--transition);
}

.social-links a:hover::before {
    transform: scale(1);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-8px) scale(1.15);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

.social-links a i {
    position: relative;
    z-index: 1;
}

.copyright {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    background: var(--primary-color);
    font-weight: 500;
}

/* --- التجاوب (Media Queries) محسن --- */
@media (max-width: 992px) {
    .header-row {
        flex-direction: column;
        padding: 25px 20px;
    }

    .logo {
        height: 120px;
        margin-bottom: 20px;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .navbar-nav {
        flex-direction: column;
        display: none;
    }

    .navbar-nav.active {
        display: flex;
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
        text-align: center;
    }

    .nav-item::after {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .carousel {
        height: 300px;
    }

    .title {
        font-size: 2.2rem;
    }

    .card-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }

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

    .footer-section {
        width: 100%;
    }

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

@media (max-width: 768px) {
    .header-title {
        font-size: 1.3rem;
    }

    .logo {
        height: 100px;
    }

    .carousel {
        height: 250px;
    }

    .title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 25px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .about-content {
        padding: 30px;
    }

    .about-content p {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .header-title {
        font-size: 1.1rem;
    }

    .logo {
        height: 80px;
    }

    .carousel {
        height: 200px;
    }

    .title {
        font-size: 1.8rem;
    }

    .card-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .prev, .next {
        width: 45px;
        height: 45px;
        font-size: 20px;
        padding: 12px;
    }

    .prev {
        left: 15px;
    }

    .next {
        right: 15px;
    }
}

/* --- تحسينات إضافية للأداء والجمالية --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسين الخطوط للشاشات عالية الدقة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* تحسين التباين للوضع الداكن */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1a1a1a;
        --text-color-dark: #e0e0e0;
    }
}

