:root {
    --primary-color: #1D7E20;
    --primary-dark: #145a16;
    --secondary-color: #f7f7f7;
    --text-color: #333;
    --light-text: #666;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --max-width: 1200px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: #222;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 4rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
    cursor: pointer;
    border: none;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    color: var(--white);
    text-decoration: none;
}

/* Accessibility */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Header */
header {
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.logo img {
    height: 40px;
    filter: brightness(0) invert(1); /* Make logo white */
}

/* Navigation Actions Container */
.nav-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Base Button Style */
.nav-btn {
    color: var(--white);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Subtle border for visibility */
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: #145b14; /* Darker green on hover */
    border-color: #145b14;
    color: var(--white);
    text-decoration: none;
}

/* Download Button - Prominent */
.download-action {
    background-color: var(--white);
    color: var(--primary-color) !important; /* Green text */
    font-weight: 800; /* Bold text */
    font-size: 1.1rem; /* Larger font */
    padding: 12px 28px; /* Larger button */
    border: 2px solid var(--white);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.download-action:hover {
    background-color: #f0f0f0;
    color: #145b14 !important; /* Darker green text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
}

.lang-btn {
    padding: 10px 15px; /* Adjust padding for dropdown trigger */
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1100;
}

.lang-menu.active {
    display: block;
}

/* Bridge the gap between button and menu to prevent closing on hover */
.lang-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    width: 100%;
    height: 0.5rem;
    background: transparent;
}

.lang-dropdown:hover .lang-menu {
    display: block;
}

.lang-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.lang-menu a:hover {
    background-color: #f0fdf4; /* Light green tint */
    color: var(--primary-color);
}

.lang-menu .divider {
    height: 1px;
    background-color: #eee;
    margin: 0.5rem 0;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .nav-actions {
        position: absolute;
        top: var(--header-height);
        right: 0;
        height: auto;
        min-height: calc(100vh - var(--header-height));
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 2rem 0;
        gap: 2rem;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }

    .nav-actions.active {
        transform: translateX(0);
    }
    
    .nav-btn {
        width: 85%;
        justify-content: center;
        padding: 15px;
        font-size: 1.1rem;
    }

    .lang-dropdown {
        width: 85%;
    }
    
    .lang-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .lang-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.2);
        background-color: rgba(0,0,0,0.05);
        color: var(--white);
        margin-top: 0;
    }

    .lang-menu a {
        color: rgba(255,255,255,0.9);
        padding-left: 2rem;
    }

    .lang-menu a:hover {
        background-color: rgba(255,255,255,0.1);
        color: var(--white);
    }
}

.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--white);
}

/* Hero Section */
.hero {
    background-color: var(--primary-color);
    padding-top: 1rem;
    padding-bottom: 0;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero-text p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.hero .btn {
    background-color: var(--white);
    color: var(--primary-color);
}

.hero .btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-dark);
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
}

/* Breadcrumbs */
.breadcrumbs-container {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    background-color: var(--primary-color);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding: 0 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    content: ">";
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item a:hover {
    color: var(--white);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--white);
    font-weight: bold;
}

/* Features Section */
.features-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.features-list .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-image img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Download Section */
.download-section {
    background-color: var(--secondary-color);
    text-align: center;
}

.download-box {
    margin: 3rem 0;
}

.btn-large {
    font-size: 1.2rem;
    padding: 16px 32px;
}

.note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

/* Languages Section */
.languages-section {
    background-color: var(--white);
}

.languages-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.language-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.3s;
}

.language-item:hover {
    border-color: var(--primary-color);
    background-color: #f0fdf4;
}

.lang-name {
    font-weight: bold;
    color: var(--text-color);
}

.lang-text {
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* How to Use / Speed Up */
.how-to-section, .speed-up-section {
    background-color: var(--secondary-color);
}

.how-to-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.step-image img {
    height: 60px;
    margin-bottom: 1rem;
}

.speed-up-list ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.speed-up-list li {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Technical Section (New) */
.technical-section {
    padding: 4rem 0;
    background-color: var(--white);
    border-top: 1px solid #eee;
}

.code-wrapper {
    position: relative;
    margin-top: 1rem;
}

.code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1.5rem;
}

.code-block pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* FAQ Section */
.faq-section {
    background-color: var(--white);
}

.faq-list {
    max-width: 800px;
    margin: 2rem auto 0;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.faq-item summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    background-color: #fafafa;
}

.faq-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Reviews Marquee */
.reviews-section {
    background-color: var(--secondary-color);
    overflow: hidden; /* For marquee */
}

.reviews-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.reviews-marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    width: max-content;
    gap: 2rem;
    animation: scroll 40s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.review-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 350px;
    flex-shrink: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.review-author {
    font-weight: bold;
    color: var(--primary-color);
}

.review-date {
    color: var(--light-text);
}

/* About Section (New) */
.about-section {
    background-color: var(--white);
    text-align: center;
}

.author-bio {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #f0fdf4; /* Light green tint */
    border: 1px solid #dcfce7;
    border-radius: 8px;
    text-align: left;
}

.author-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.author-title {
    font-weight: bold;
    color: #555;
    margin-bottom: 1rem;
    font-style: italic;
    font-size: 0.9rem;
}

/* Support Section */
.support-content {
    padding: 4rem 0;
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.support-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.support-card ul li {
    margin-bottom: 0.5rem;
}

.contact-section {
    text-align: center;
    margin-top: 4rem;
}

/* Footer */
footer {
    background-color: #333;
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.footer-logo {
    height: 30px;
    margin-bottom: 1rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: #ccc;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    color: var(--white);
}

.last-updated {
    font-size: 0.8rem;
    color: #888;
    margin: 0.5rem 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
}

/* --- RTL Support for Arabic --- */
html[dir="rtl"] {
    --direction: rtl;
}

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

/* Flip breadcrumb separator */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    transform: rotate(180deg);
}

/* Flip border on speed-up list */
html[dir="rtl"] .speed-up-list li {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

/* Flip code block copy button */
html[dir="rtl"] .copy-btn {
    right: auto;
    left: 10px;
}

/* Flip mobile menu for RTL */
@media (max-width: 768px) {
    html[dir="rtl"] .nav-actions {
        right: auto;
        left: 0;
        transform: translateX(-100%); /* Start off-screen to the left */
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    html[dir="rtl"] .nav-actions.active {
        transform: translateX(0);
    }
    
    html[dir="rtl"] .lang-menu a {
        padding-left: 0;
        padding-right: 2rem; /* Flip padding */
    }
}

/* Author bio text alignment */
html[dir="rtl"] .author-bio {
    text-align: right;
}

/* Review Marquee RTL */
html[dir="rtl"] .reviews-marquee {
    mask-image: linear-gradient(to left, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to left, transparent, black 10%, black 90%, transparent);
}

html[dir="rtl"] .marquee-content {
    animation: scroll-rtl 40s linear infinite;
}

@keyframes scroll-rtl {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}
