* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb; /* Blue */
    --primary-dark: #1e40af; /* Darker Blue */
    --secondary-color: #10b981; /* Green */
    --text-dark: #1f2937; /* Dark Grey */
    --text-light: #6b7280; /* Light Grey */
    --bg-light: #f9fafb; /* Very Light Grey */
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Custom gradient variables for consistency */
    --hero-gradient-start: #667eea; /* A vibrant blue-purple */
    --hero-gradient-end: #764ba2;   /* A darker purple */
    --footer-gradient-start: #1e40af; /* Using primary-dark for start */
    --footer-gradient-end: #3b0764; /* A deeper, richer purple for end */
}

body {
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--primary-dark);
    padding: 15px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: var(--bg-white);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-list a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    transition: all 0.3s ease;
}

.nav-list a:hover {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: white;
    padding: 80px 20px 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    opacity: 0.95;
}

.hero .subtitle {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--bg-white);
    color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

/* Section Styles */
section {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.bg-light {
    background-color: var(--bg-light);
}

/* Problem Section */
.problem-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.problem-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.problem-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.problem-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* Why Us Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background: var(--bg-white);
    padding: 35px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-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 20px;
    font-size: 2rem;
    color: white; /* Added for FA icons */
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Services Section */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.service-item {
    background: var(--bg-white);
    padding: 30px;
    border-right: 4px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.service-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(-5px);
    background-color: var(--bg-light); /* Added hover effect */
}

.service-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.service-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Workflow Section */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
    margin: 50px auto 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.step:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px); /* Added hover effect */
}

.step-number {
    min-width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.step-content p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Educational Section */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.article-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.article-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.article-content {
    padding: 25px;
}

.article-content h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.article-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 50px auto 0;
}

.faq-item {
    background: var(--bg-white);
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-question {
    padding: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: var(--bg-light);
}

.faq-answer {
    padding: 0 25px 25px;
    color: var(--text-light);
    line-height: 1.8;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* About Section */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 50px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.about-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-light);
    margin-bottom: 20px;
}

.about-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.about-content ul li {
    padding: 10px 0;
    padding-right: 30px; /* Adjusted for RTL */
    position: relative;
    color: var(--text-light);
}

.about-content ul li:before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 50px auto 0;
}

.contact-info {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-details {
    flex: 1;
}

.contact-details strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.contact-details a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.contact-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--footer-gradient-start) 0%, var(--footer-gradient-end) 100%);
    color: white;
    padding: 50px 20px 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.footer-section a:hover {
    color: white;
}

.disclaimer {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.disclaimer strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Scroll To Top Button */
#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    bottom: 30px; /* Place at the bottom */
    left: 30px; /* Place at the left (for RTL) */
    z-index: 99; /* Make sure it's above other elements */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: var(--primary-color); /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px 20px; /* Some padding */
    border-radius: 50%; /* Rounded shape */
    font-size: 1.2rem; /* Increase font size */
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s, opacity 0.3s;
}

#scrollToTopBtn:hover {
    background-color: var(--primary-dark); /* Darker background on hover */
}


/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .nav-list {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .about-content {
        padding: 30px 20px;
    }

    .contact-form,
    .contact-info {
        padding: 25px;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin: 0 auto 20px;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}
/* Add this to the end of style.css */
.article-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Ensures the link takes up the full space of the card */
}

.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-link:hover .article-card {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 48, 87, 0.15);
}
/* File: style.css */

/* === Styling for Article Cards === */

/* 1. Controlling the Main Container (.article-card) */
.article-card {
    display: flex;         /* Children (image, content) are now laid out horizontally */
    align-items: center;   /* Vertically align children to the center */
    gap: 20px;             /* Creates a 20px space between the image and the content */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;      /* Ensures nothing spills out of the rounded corners */
    margin-bottom: 20px;   /* Space below each card */
}

/* 2. Controlling the Image Itself (.article-image) */
.article-image {
    width: 200px;          /* Fixed width for the image */
    height: 150px;         /* Fixed height for the image */
    object-fit: cover;     /* CRITICAL: Resizes the image to fill the box, cropping if necessary, without distorting. */
}

/* 3. Controlling the Content Container (.article-content) */
.article-content {
    padding: 15px;         /* Adds some internal spacing */
}
/* =============================================
   Image Layout Styles for Problem & About Sections
   ============================================= */

/* --- Main Container for Two-Column Layout --- */
/* This rule applies to both sections */
.problem-container,
.about-container {
    display: flex; /* Activates Flexbox layout */
    align-items: center; /* Vertically centers the content in both columns */
    gap: 3rem; /* Creates a healthy space between the text and the image */
    margin-top: 2rem; /* Adds some space from the section subtitle */
}

/* --- Content Sizing --- */
/* Defines how the text and image columns share the space */
.problem-text-content,
.about-content {
    flex: 1; /* Allows the text content to take up 50% of the available space */
}

.problem-image,
.about-image {
    flex: 1; /* Allows the image container to take up the other 50% of the space */
    text-align: center; /* Centers the image within its container */
}

/* --- Image Styling --- */
/* Ensures images are responsive and have a clean look */
.problem-image img,
.about-image img {
    max-width: 100%; /* Prevents the image from overflowing its container */
    height: auto; /* Maintains the image's aspect ratio */
    border-radius: 8px; /* Adds slightly rounded corners for a modern look */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Adds a subtle shadow for depth */
}

/* =============================================
   Responsive Design for Mobile Devices
   ============================================= */
@media (max-width: 768px) {
    .problem-container,
    .about-container {
        flex-direction: column; /* Stacks the text and image vertically */
        gap: 2rem; /* Adjusts the gap for the vertical layout */
    }

    /* On mobile, the about image can appear before the text for better flow */
    .about-container {
        flex-direction: column-reverse;
    }
}
/* =============================================
   8. FILTER & SEARCH STYLES (ARTICLES PAGE)
   ============================================= */
.filter-container {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#searchInput {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color-light);
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Class to hide articles via JavaScript */
.article-card.hidden {
    display: none;
}
/* ============== Styles for Filter and Search ============== */
/* این کدها را به انتهای فایل style.css اضافه کنید */

.filter-search-container {
    display: flex;
    flex-direction: row-reverse; /* دکمه‌ها سمت راست، جستجو سمت چپ */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap; /* برای نمایش بهتر در موبایل */
    gap: 1rem; /* فاصله بین آیتم‌ها */
}

.search-box {
    position: relative;
    flex-grow: 1; /* باعث می‌شود فیلد جستجو فضای خالی را پر کند */
    min-width: 300px; /* حداقل عرض */
}

#search-input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    padding-right: 3rem; /* فاصله برای آیکون */
    border-radius: 50px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.search-box .fa-search {
    position: absolute;
    right: 15px; /* قرارگیری آیکون در سمت راست */
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.filter-buttons {
    display: flex;
    gap: 0.7rem; /* فاصله بین دکمه‌ها */
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    border: 1px solid #007bff;
    border-radius: 50px;
    background-color: #fff;
    color: #007bff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: bold;
    white-space: nowrap; /* جلوگیری از شکستن متن دکمه */
}

.filter-btn:hover {
    background-color: #e6f2ff; /* یک رنگ آبی بسیار ملایم */
}

/* استایل دکمه فعال (دکمه‌ای که انتخاب شده) */
.filter-btn.active {
    background-color: #007bff;
    color: #fff;
}
