/* General Styling & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700&display=swap');

:root {
    --primary-green: #4CAF50;
    --dark-green: #388E3C;
    --light-green: #DCEDC8;
    --accent-yellow: #FFD700;
    --dark-yellow: #e6c200;
    --text-dark: #2c3e50;
    --text-light: #555;
    --bg-light: #f8f9fa;
    --bg-alt: #e8f5e9;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --shadow-strong: rgba(0,0,0,0.25);
}

body {
    font-family: 'Vazirmatn', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-light);
    direction: rtl; /* Right-to-left for Persian */
    text-align: right; /* Align text to the right for RTL */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

h1, h2, h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    font-size: 3.2em;
    text-align: center;
    font-weight: 700;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.6em;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent-yellow);
    margin: 15px auto 0;
    border-radius: 2px;
}

p {
    margin-bottom: 15px;
    font-size: 1.05em;
    color: var(--text-light);
}

strong {
    color: var(--primary-green);
    font-weight: 600;
}

/* Header */
header {
    background: linear-gradient(to right, var(--primary-green), var(--dark-green));
    color: white;
    padding: 30px 0;
    box-shadow: 0 4px 10px var(--shadow-medium);
    position: relative;
    z-index: 100;
    overflow: hidden; /* For pseudo-elements/sparkles */
    padding-bottom: 70px; /* Space for nav */
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="10" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    background-size: 40px;
    opacity: 0.8;
}

.main-title {
    font-size: 3.8em; /* Even larger font for the first line */
    font-weight: 700;
    color: white;
    margin-bottom: 25px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Darker overlay for text contrast */
    z-index: 1;
}

.container > .main-title,
.container > nav {
    position: relative; /* Bring content above overlay */
    z-index: 2;
}

/* Sparkles for Header */
.sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.sparkles span {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    opacity: 0;
    animation: sparkle-anim 10s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.sparkles span:nth-child(1) { width: 3px; height: 3px; top: 10%; left: 20%; animation-delay: 0.5s; }
.sparkles span:nth-child(2) { width: 4px; height: 4px; top: 30%; left: 70%; animation-delay: 1.2s; }
.sparkles span:nth-child(3) { width: 2px; height: 2px; top: 60%; left: 40%; animation-delay: 2s; }
.sparkles span:nth-child(4) { width: 5px; height: 5px; top: 80%; left: 90%; animation-delay: 0.8s; }
.sparkles span:nth-child(5) { width: 3px; height: 3px; top: 20%; left: 50%; animation-delay: 2.5s; }
.sparkles span:nth-child(6) { width: 4px; height: 4px; top: 5%; left: 80%; animation-delay: 1.5s; }
.sparkles span:nth-child(7) { width: 2px; height: 2px; top: 45%; left: 10%; animation-delay: 3s; }
.sparkles span:nth-child(8) { width: 5px; height: 5px; top: 70%; left: 60%; animation-delay: 0.3s; }
.sparkles span:nth-child(9) { width: 3px; height: 3px; top: 90%; left: 30%; animation-delay: 1.8s; }
.sparkles span:nth-child(10) { width: 4px; height: 4px; top: 25%; left: 5%; animation-delay: 2.2s; }

@keyframes sparkle-anim {
    0% { transform: scale(0) translateY(0); opacity: 0; }
    20% { transform: scale(1) translateY(-10px); opacity: 1; }
    80% { transform: scale(1) translateY(10px); opacity: 0.5; }
    100% { transform: scale(0) translateY(20px); opacity: 0; }
}

/* Main Navigation */
nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background for nav */
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 3; /* Above header overlay */
}

.main-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.main-nav li a {
    color: white;
    text-decoration: none;
    font-size: 1.15em;
    font-weight: 400;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
}

.main-nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* Changed from left to right for RTL */
    width: 0;
    height: 3px;
    background-color: var(--accent-yellow);
    transition: width 0.3s ease-out;
}

.main-nav li a:hover::after {
    width: 100%;
    left: 0;
}

.main-nav li a:hover {
    color: var(--accent-yellow);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}


/* Hero Section */
.hero {
    background: linear-gradient(to bottom, #e0f2f1, #c8e6c9); /* Softer green gradient */
    color: var(--text-dark);
    padding: 100px 0;
    text-align: center;
    border-bottom: 8px solid var(--accent-yellow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: rotate(-30deg);
}


.hero h2 {
    font-size: 3em;
    color: var(--dark-green);
    margin-bottom: 25px;
}

.hero p {
    font-size: 1.2em;
    max-width: 900px;
    margin: 20px auto;
    line-height: 1.9;
}

.btn-scroll-down {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 30px;
    background-color: var(--accent-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-light);
}

.btn-scroll-down:hover {
    background-color: var(--dark-yellow);
    transform: translateY(-5px);
    box-shadow: 0 6px 15px var(--shadow-medium);
}

.btn-scroll-down i {
    margin-left: 10px;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Section Styling */
.section-padded {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.section-alt {
    padding: 80px 0;
    background-color: var(--bg-alt);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-item {
    background-color: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow-light);
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-green), var(--accent-yellow));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

.service-item:hover::before {
    transform: scaleX(1);
}

.service-item:hover {
    transform: translateY(-15px);
    box-shadow: 0 12px 30px var(--shadow-medium);
}

.service-icon {
    font-size: 3.5em;
    color: var(--primary-green);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.1);
}

.service-item h3 {
    color: var(--dark-green);
    margin-bottom: 12px;
    font-size: 1.8em;
}

.service-item p {
    font-size: 0.95em;
    color: var(--text-light);
}

/* Mission & Vision */
.mv-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.mv-item {
    flex: 1;
    min-width: 320px;
    max-width: 550px;
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow-light);
    text-align: center;
    border-right: 5px solid var(--accent-yellow); /* Changed from left to right for RTL */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mv-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px var(--shadow-medium);
}

.mv-item h3 {
    color: var(--dark-green);
    margin-bottom: 15px;
    font-size: 2em;
}

.mv-item p {
    font-size: 1.1em;
    line-height: 2;
}

/* Contact Section */
#contact {
    text-align: center;
}

.contact-number {
    font-size: 2.5em;
    color: var(--primary-green);
    margin-top: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--light-green);
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-light);
    transition: all 0.3s ease;
}

.contact-number:hover {
    background-color: var(--accent-yellow);
    color: var(--text-dark);
    transform: scale(1.05);
}

.contact-number i {
    margin-left: 15px;
    color: var(--accent-yellow);
}

.contact-number:hover i {
    color: var(--text-dark);
}

/* Chat & FAQ Section */
.chat-faq-section {
    padding-bottom: 100px; /* More space at the bottom as chat widget is fixed */
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    padding: 25px 0;
    margin-top: 60px;
    font-size: 0.9em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -4px 10px var(--shadow-strong);
}

.footer-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.footer-lights span {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0;
    animation: footer-sparkle-anim 8s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.footer-lights span:nth-child(1) { width: 4px; height: 4px; top: 20%; left: 10%; animation-delay: 0.2s; }
.footer-lights span:nth-child(2) { width: 3px; height: 3px; top: 70%; left: 80%; animation-delay: 1s; }
.footer-lights span:nth-child(3) { width: 5px; height: 5px; top: 40%; left: 50%; animation-delay: 0.6s; }
.footer-lights span:nth-child(4) { width: 2px; height: 2px; top: 10%; left: 90%; animation-delay: 1.5s; }
.footer-lights span:nth-child(5) { width: 4px; height: 4px; top: 60%; left: 25%; animation-delay: 0.8s; }
.footer-lights span:nth-child(6) { width: 3px; height: 3px; top: 85%; left: 5%; animation-delay: 1.2s; }

@keyframes footer-sparkle-anim {
    0% { transform: scale(0) translateX(0); opacity: 0; }
    20% { transform: scale(1) translateX(-5px); opacity: 0.8; }
    80% { transform: scale(1) translateX(5px); opacity: 0.3; }
    100% { transform: scale(0) translateX(10px); opacity: 0; }
}

.footer-text {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.9);
}


/* Chat Widget */
#open-chat-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: var(--accent-yellow);
    color: var(--text-dark);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 15px var(--shadow-medium);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

#open-chat-btn:hover {
    background-color: var(--dark-yellow);
    transform: scale(1.1);
    box-shadow: 0 8px 20px var(--shadow-strong);
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#chat-widget {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 380px;
    height: 550px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-strong);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    font-size: 0.95em;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease-out;
}

#chat-widget.active {
    display: flex;
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(to right, var(--primary-green), var(--dark-green));
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25em;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-header h3 {
    margin: 0;
    color: white;
    font-weight: 600;
}

.chat-header i {
    margin-left: 10px;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.6em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

#close-chat:hover {
    opacity: 1;
}

.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.message.bot {
    background-color: #e3f2fd; /* Light blue for bot */
    align-self: flex-start;
    border-bottom-right-radius: 8px;
    color: #1a237e;
}

.message.user {
    background-color: var(--light-green); /* Light green for user */
    align-self: flex-end;
    border-bottom-left-radius: 8px;
    color: var(--text-dark);
}

.faq-options {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end; /* Align options to the right */
}

.faq-option {
    background-color: #fff;
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.faq-option:hover {
    background-color: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chat-footer {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

#chat-input {
    flex-grow: 1;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    margin-left: 10px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#chat-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

#send-btn {
    background-color: var(--accent-yellow);
    color: var(--text-dark);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    background-color: var(--dark-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#send-btn i {
    margin-left: 8px;
}

/* Animations */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Delay for sequential animations */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }


/* Responsive Design */
@media (max-width: 992px) {
    .main-title {
        font-size: 3em;
    }
    h2 {
        font-size: 2.2em;
    }
    .hero {
        padding: 80px 0;
    }
    .hero p {
        font-size: 1.1em;
    }
    .main-nav {
        gap: 20px;
    }
    .main-nav li a {
        font-size: 1.05em;
    }
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .service-item h3 {
        font-size: 1.6em;
    }
    .mv-item {
        max-width: 100%;
    }
    .contact-number {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.6em;
    }
    h2 {
        font-size: 2em;
        margin-bottom: 40px;
    }
    .hero {
        padding: 60px 0;
    }
    .hero p {
        font-size: 1em;
    }
    .main-nav {
        flex-direction: column; /* Stack navigation items vertically */
        gap: 10px;
        align-items: center;
    }
    nav {
        padding: 15px 0;
    }
    header {
        padding-bottom: 120px; /* More space for stacked nav */
    }
    .section-padded, .section-alt {
        padding: 60px 0;
    }
    .mv-grid {
        flex-direction: column;
        gap: 30px;
    }
    .mv-item {
        border-right: none; /* Changed from left to right for RTL */
        border-top: 5px solid var(--accent-yellow);
    }
    #chat-widget {
        width: 90%;
        left: 5%;
        right: 5%;
        bottom: 90px;
        height: 450px;
    }
    #open-chat-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2.2em;
    }
    h2 {
        font-size: 1.8em;
    }
    .hero {
        padding: 40px 0;
    }
    .hero p {
        font-size: 0.95em;
    }
    .btn-scroll-down {
        padding: 10px 20px;
        font-size: 1em;
    }
    .main-nav li a {
        font-size: 1em;
    }
    .service-item {
        padding: 25px;
    }
    .service-icon {
        font-size: 3em;
    }
    .service-item h3 {
        font-size: 1.4em;
    }
    .contact-number {
        font-size: 1.6em;
        padding: 8px 15px;
    }
    .chat-header {
        font-size: 1.1em;
        padding: 12px;
    }
    #close-chat {
        font-size: 1.4em;
    }
    .chat-body {
        padding: 15px;
    }
    .message {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .faq-option {
        padding: 7px 10px;
        font-size: 0.8em;
    }
    #chat-input {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    #send-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }
}