/**
 * ستايل موقع مؤسسة أمان التنموية
 * Aman Development Foundation Styles
 */

/* ========================================
   المتغيرات والإعدادات
   ======================================== */
:root {
    /* الألوان الأساسية */
    --primary-color: #36662E;
    --primary-dark: #24441F;
    --primary-light: #4CAF50;
    --secondary-color: #8BC34A;
    --secondary-light: #AED581;

    /* ألوان الخلفية */
    --bg-color: #F8FAF8;
    --bg-white: #FFFFFF;
    --bg-light: #F1F8E9;

    /* ألوان النص */
    --text-dark: #1A1A1A;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-white: #FFFFFF;

    /* الظلال */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);

    /* الحدود */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --border-color: #E8E8E8;

    /* الانتقالات */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;

    /* الخط */
    --font-family: 'Cairo', sans-serif;

    /* المسافات */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;
}

/* ========================================
   الإعدادات الأساسية
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input,
textarea {
    font-family: inherit;
    outline: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   الشريط العلوي (Navbar)
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo img {
    height: 45px;
    width: auto;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    max-width: 200px;
    line-height: 1.3;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

body.ltr .nav-links a::after {
    right: auto;
    left: 0;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.lang-toggle {
    display: flex;
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.lang-toggle button {
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    transition: var(--transition);
}

.lang-toggle button.active {
    background: var(--primary-color);
    color: var(--text-white);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: transparent;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ========================================
   قسم Hero
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, #0D3F14 100%); */
    background-image: url('../images/hero_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    padding-top: 70px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Dark overlay for text readability */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7));
    z-index: 0;
}

.hero::after {
    display: none;
    /* Hide the previous decorative gradient */
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    padding: var(--spacing-lg);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    margin-bottom: var(--spacing-lg);
    color: var(--secondary-light);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-badge svg {
    width: 18px;
    height: 18px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   الأزرار
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    background: var(--text-white);
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-green {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-green:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ========================================
   عناوين الأقسام
   ======================================== */
.section {
    padding: var(--spacing-xxl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-badge {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   قسم من نحن
   ======================================== */
.about-content {
    display: grid;
    gap: var(--spacing-xl);
}

.about-text {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.about-text p {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.about-card {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-light);
}

.about-card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
}

.about-card-icon svg {
    width: 32px;
    height: 32px;
    color: var(--text-white);
}

.about-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.about-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   بطاقات المحتوى (المشاريع/المقالات/الأخبار)
   ======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    position: relative;
    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.05);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-md);
}

.card:hover .card-overlay {
    opacity: 1;
}

.card-overlay span {
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: 500;
}

.card-body {
    padding: var(--spacing-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-link svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

body.ltr .card-link svg {
    transform: rotate(180deg);
}

.card:hover .card-link svg {
    transform: translateX(-4px);
}

body.ltr .card:hover .card-link svg {
    transform: translateX(4px) rotate(180deg);
}

/* ========================================
   قسم التواصل
   ======================================== */
.contact-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.contact-info {
    color: var(--text-white);
}

.contact-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.contact-info p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.contact-form-wrapper {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.form-submit:hover {
    background: var(--primary-dark);
}

.form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-message {
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    margin-top: var(--spacing-sm);
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    display: block;
    background: var(--bg-light);
    color: var(--primary-color);
}

.form-message.error {
    display: block;
    background: #FFEBEE;
    color: #C62828;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--text-dark);
    color: var(--text-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-logo img {
    height: 50px;
    filter: brightness(0) invert(1);
}

.footer-logo span {
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-text {
    font-size: 0.95rem;
    opacity: 0.8;
    max-width: 500px;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--spacing-md) 0;
}

.footer-bottom {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    transition: var(--transition);
}

body.ltr .modal-close {
    left: auto;
    right: var(--spacing-sm);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--spacing-lg);
    max-height: calc(90vh - 250px);
    overflow-y: auto;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.modal-content {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.9;
}

.modal-content p {
    margin-bottom: var(--spacing-md);
}

/* ========================================
   Placeholder للصور
   ======================================== */
.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.placeholder-image svg {
    width: 60px;
    height: 60px;
    opacity: 0.5;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-info {
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-xxl: 3rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .about-text {
        padding: var(--spacing-md);
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        height: 180px;
    }

    .modal-body {
        padding: var(--spacing-md);
    }
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    display: block;
    padding: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

/* ========================================
   Loading Animation
   ======================================== */
.loading {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}