/* Design System & Variables */
:root {
    /* Primary Colors */
    --primary: #5E9C42;
    --primary-hover: #4d8236;
    --secondary: #003E70;
    --secondary-hover: #002d52;
    
    /* Neutral Colors - Light Mode */
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.9);
    --card-bg: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Brand Colors */
    --facebook: #1877F2;
    --twitter: #1DA1F2;
    --linkedin: #0077B5;
    --instagram: #E4405F;
    --whatsapp: #25D366;
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-alt: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --header-bg: rgba(15, 23, 42, 0.9);
    --card-bg: #1e293b;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

[lang="ar"] body {
    font-family: 'Tajawal', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 100px 0;
}

.alternate-bg {
    background-color: var(--bg-alt);
}

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

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.primary-text {
    color: var(--primary);
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-list a {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(94, 156, 66, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(94, 156, 66, 0.3);
}

.btn-block {
    display: block;
    width: 100%;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Slider */
.hero-slider {
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin-top: calc(var(--header-height) * -1);
}

.slider-container {
    height: 100%;
    width: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s;
    display: flex;
    align-items: center;
    color: white;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.slide-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 62, 112, 0.85), rgba(0, 0, 0, 0.3));
}

[lang="ar"] .slide-bg::after {
    background: linear-gradient(to left, rgba(0, 62, 112, 0.85), rgba(0, 0, 0, 0.3));
}

.slide-content {
    position: relative;
    z-index: 20;
    max-width: 850px;
}

.slide h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease 0.3s;
}

.slide p {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease 0.5s;
}

.slide .btn {
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease 0.7s;
}

.slide.active h1, 
.slide.active p, 
.slide.active .btn {
    transform: translateY(0);
    opacity: 1;
}

.slider-controls button {
    position: absolute;
    top: 65%; /* Moved lower to avoid text overlap */
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 30;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-controls button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

#prev-slide { left: 3rem; }
#next-slide { right: 3rem; }

[dir="rtl"] #prev-slide { left: auto; right: 3rem; }
[dir="rtl"] #next-slide { right: auto; left: 3rem; }

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

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

.dot.active {
    background: var(--primary);
    width: 35px;
    border-radius: 8px;
}

/* Section Headers */
.section-header {
    margin-bottom: 5rem;
    max-width: 700px;
}

.text-center.section-header {
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    color: var(--secondary);
    font-weight: 700;
}

[data-theme="dark"] .section-header h2 {
    color: var(--primary);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background-color: var(--card-bg);
    padding: 3.5rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.service-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(94, 156, 66, 0.1);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.service-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

[data-theme="dark"] .service-card h3 {
    color: var(--primary);
}

.service-list li {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    color: var(--text-muted);
}

.service-list li::before {
    content: "✓";
    color: var(--primary);
    font-weight: 900;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.about-image {
    position: relative;
}

.rounded-img {
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.experience-badge {
    position: absolute;
    bottom: -30px;
    right: -30px;
    background-color: var(--primary);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(94, 156, 66, 0.3);
}

[dir="rtl"] .experience-badge { right: auto; left: -30px; }

.badge-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.badge-text {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-row {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
}

.stat-number {
    font-size: 2.5rem;
    color: var(--secondary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .stat-number {
    color: var(--primary);
}

.stat-label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 280px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(94, 156, 66, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
    font-size: 2rem;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* News Gallery - Premium Redesign */
.news-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
}

.news-item {
    background-color: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.news-item:hover {
    transform: translateY(-15px);
    border-color: var(--primary);
    box-shadow: 0 30px 40px -10px rgba(0, 0, 0, 0.15);
}

.news-img-container {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.news-img-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: var(--transition);
}

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

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

.news-info {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-info h4 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
}

[data-theme="dark"] .news-info h4 {
    color: #fff;
}

.news-info p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.read-more {
    margin-top: auto;
    color: var(--primary);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

/* Contact Section - Premium Redesign */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 6rem;
    align-items: start;
}

.contact-info h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    font-weight: 700;
}

[data-theme="dark"] .contact-info h2 {
    color: var(--primary);
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.method-item {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.method-item i {
    width: 60px;
    height: 60px;
    background: rgba(94, 156, 66, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.method-item h5 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--secondary);
}

[data-theme="dark"] .method-item h5 { color: #fff; }

.method-item p {
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.social-widget {
    margin-top: 4rem;
}

.social-widget h5 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

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

.social-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.social-fb { background-color: var(--facebook); }
.social-tw { background-color: var(--twitter); }
.social-ln { background-color: var(--linkedin); }
.social-ig { background-color: var(--instagram); }

.social-links a:hover {
    transform: translateY(-5px) rotate(8deg);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* Contact Form - Refined */
.contact-form-container {
    background-color: var(--card-bg);
    padding: 4.5rem;
    border-radius: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(94, 156, 66, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

[dir="rtl"] .form-group select {
    background-position: left 1rem center;
}

/* Lightbox - Refined */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
}

.lightbox-container {
    position: relative;
    z-index: 3010;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    background: var(--secondary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow);
    letter-spacing: 0.5px;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
}

.lightbox-close { top: -60px; right: 0; width: 45px; height: 45px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 70px; height: 70px; }
.lightbox-prev { left: -100px; }
.lightbox-next { right: -100px; }

/* Modals - Restored */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    background: var(--bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    overflow-y: auto;
    z-index: 2010;
    padding: 3.5rem;
    box-shadow: var(--shadow);
}

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

[dir="rtl"] .modal-close { right: auto; left: 1.5rem; }

.modal-body img {
    border-radius: 12px;
    margin-bottom: 2rem;
    width: 100%;
}

.modal-body h2 { margin-bottom: 1.5rem; color: var(--secondary); }
[data-theme="dark"] .modal-body h2 { color: var(--primary); }

/* WhatsApp Float - Refined */
.whatsapp-float {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    background-color: var(--whatsapp);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    font-size: 2rem;
    animation: pulse-wa 2s infinite;
}

@keyframes pulse-wa {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Footer - Refined */
.footer {
    padding: 5rem 0 3rem;
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 3rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustments */
@media (max-width: 992px) {
    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    
    .slide h1 { font-size: 3rem; }
    .contact-form-container { padding: 3rem; }
    .lightbox-prev { left: 20px; }
    .lightbox-next { right: 20px; }
    .lightbox-prev, .lightbox-next { width: 50px; height: 50px; }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--header-bg);
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(15px);
        z-index: 900;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .mobile-nav-toggle { display: block; }

    .nav-cta {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .header-left { gap: 0.5rem; }
    .header-right { gap: 0.5rem; }
    .logo { font-size: 1.1rem; }
    .logo-text { display: flex; gap: 2px; }
    
    /* Hide Global text on very small screens to save space */
    @media (max-width: 480px) {
        .logo-text span:first-child { display: none; }
        .lang-text { display: none; }
    }

    .slider-controls button { width: 40px; height: 40px; top: 80%; }
    #prev-slide { left: 0.5rem; }
    #next-slide { right: 0.5rem; }

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

[dir="rtl"] {
    text-align: right;
}
