:root {
    --dark: #1F2937;
    --light: #F9FAFB;
    --gray: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --dark: #111827;
    --light: #F9FAFB;
    --gray: #9CA3AF;
    --border: #374151;
}

[data-theme="dark"] body {
    background: #0F172A;
}

[data-theme="dark"] header {
    background: #1E293B;
}

[data-theme="dark"] .card {
    background: #1E293B;
}

[data-theme="dark"] .card-content h3,
[data-theme="dark"] .section-header h2,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] .slide-content h2,
[data-theme="dark"] .slide-content p {
    color: #F1F5F9;
}

[data-theme="dark"] nav a,
[data-theme="dark"] p,
[data-theme="dark"] .card-content p,
[data-theme="dark"] .section-header p {
    color: #CBD5E1;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: #334155;
    color: #F1F5F9;
    border-color: #475569;
}

[data-theme="dark"] .form-group label {
    color: #F1F5F9;
}

[data-theme="dark"] footer {
    background: #0F172A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

body {
    font-family: 'Almarai', sans-serif;
    direction: rtl;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: var(--transition);
}

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

/* Header */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 50px;
}

.logo h1 {
    color: var(--primary);
    font-size: 24px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 10px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

nav a:hover, nav a.active {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* Dropdown Menu */
nav li.has-dropdown {
    position: relative;
}

nav li.has-dropdown > a {
    display: flex;
    align-items: center;
    gap: 5px;
}

nav li.has-dropdown > a .fa-chevron-down {
    font-size: 10px;
    transition: var(--transition);
}

nav li.has-dropdown:hover > a .fa-chevron-down {
    transform: rotate(180deg);
}

nav .dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--border);
}

nav .dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

[data-theme="dark"] nav .dropdown {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

[data-theme="dark"] nav .dropdown::before {
    background: #1E293B;
    border-color: #334155;
}

nav li.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

nav .dropdown li {
    list-style: none;
    width: 100%;
}

nav .dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--dark);
    transition: all 0.3s ease;
    width: 100%;
    text-align: right;
    border-radius: 8px;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

nav .dropdown a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

[data-theme="dark"] nav .dropdown a {
    color: #CBD5E1;
}

nav .dropdown a:hover {
    background: linear-gradient(90deg, var(--light) 0%, rgba(79, 70, 229, 0.05) 100%);
    color: var(--primary);
    padding-right: 20px;
}

nav .dropdown a:hover::before {
    transform: scaleY(1);
}

[data-theme="dark"] nav .dropdown a:hover {
    background: linear-gradient(90deg, #334155 0%, rgba(99, 102, 241, 0.1) 100%);
}

nav .dropdown a::after {
    display: none;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle {
    background: var(--light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

/* Slider */
.slider {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active {
    opacity: 1;
}

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

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    max-width: 600px;
    text-align: center;
    z-index: 2;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.7), transparent);
    z-index: 1;
}

.slide-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
    animation: slideInRight 1s ease;
}

.slide-content p {
    font-size: 20px;
    margin-bottom: 30px;
    animation: slideInRight 1.2s ease;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    animation: slideInRight 1.4s ease;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

/* Section */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    color: var(--dark);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.section-header p {
    color: var(--gray);
    font-size: 18px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid var(--primary);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.card-content {
    padding: 25px;
    text-align: center;
}

.card-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark);
}

.card-content p {
    color: var(--gray);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    max-height: 3.2em;
}

.card-content i {
    display: block;
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 15px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-section p, .footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary);
    padding-right: 5px;
}

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

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

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center !important;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background: white;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        padding: 30px;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        gap: 20px;
    }
    
    nav .dropdown {
        position: static;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        margin: 0;
        transition: all 0.3s ease;
    }
    
    nav li.has-dropdown.active .dropdown {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
        padding: 10px 0 10px 20px;
        margin-top: 10px;
    }
    
    nav li.has-dropdown > a {
        justify-content: flex-start;
    }
    
    [data-theme="dark"] nav {
        background: #1E293B;
    }
    
    [data-theme="dark"] nav a {
        color: #F1F5F9;
    }
    
    .slider {
        height: 400px;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 50px 0;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    font-family: 'Almarai', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

/* Map */
.map-container {
    margin-top: 40px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border: none;
}
