/* General Styles */
:root {
    --bg-dark: #111827;
    --bg-medium: #1F2937;
    --bg-light: #374151;
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --accent-primary: #38BDF8;
    --accent-secondary: #6366F1;
    --font-family: 'Vazirmatn', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
}

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

a:hover {
    color: #7dd3fc;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-top: 2.5rem; border-bottom: 2px solid var(--bg-light); padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; margin-top: 2rem; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-right: 20px; }
li { margin-bottom: 0.5rem; }
code {
    background-color: var(--bg-medium);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}
pre {
    background-color: #0d1117;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--bg-light);
}

/* Header & Navigation */
header {
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.logo svg {
    margin-left: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 1rem;
}

.nav-links a {
    font-weight: 700;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

.btn, .nav-button {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-button {
    background-color: var(--accent-secondary);
    color: white;
}
.nav-button:hover {
    background-color: #4f46e5;
    color: white;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-main {
    padding-top: 1rem;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: 4rem 0;
}
.hero-content {
    flex: 1;
}
.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 90%;
}
.hero-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}
.btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-dark);
}
.btn-primary:hover {
    background-color: #7dd3fc;
    color: var(--bg-dark);
}
.btn-secondary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}
.btn-secondary:hover {
    background-color: var(--accent-primary);
    color: var(--bg-dark);
}
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}
.hero-image img {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Features Section */
.features {
    text-align: center;
    padding: 4rem 0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: right;
}
.feature-card {
    background-color: var(--bg-medium);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--bg-light);
}
.feature-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.feature-card h3 {
    color: var(--accent-primary);
}

/* Open Source Section */
.open-source {
    text-align: center;
    background-color: var(--bg-medium);
    padding: 4rem 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}
.open-source p {
    max-width: 700px;
    margin: 1rem auto 2rem;
    color: var(--text-secondary);
}

/* Documentation Pages */
.page-title {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--bg-light);
}
.page-title p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}
.content-wrapper {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}
.sidebar {
    flex: 0 0 220px;
    position: sticky;
    top: 100px; /* Header height + margin */
    align-self: flex-start;
}
.sidebar ul {
    list-style: none;
    padding: 0;
}
.sidebar a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-secondary);
}
.sidebar a:hover {
    background-color: var(--bg-medium);
    color: var(--text-primary);
}
.page-content {
    flex: 1;
}
.content-image {
    margin: 1.5rem 0;
    border: 1px solid var(--bg-light);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}
th, td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--bg-light);
    text-align: right;
}
thead {
    background-color: var(--bg-medium);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--bg-light);
    color: var(--text-secondary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .nav-links, .nav-button {
        display: none;
    }
    .hamburger {
        display: block;
    }
    .nav-links {
        position: absolute;
        right: 0;
        top: 70px;
        background-color: var(--bg-dark);
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        border-bottom: 1px solid var(--bg-light);
        transform: translateY(-120%);
        transition: transform 0.3s ease-in-out;
    }
    .nav-links.active {
        display: flex;
        transform: translateY(0);
    }
    .nav-links li {
        margin: 1rem 0;
    }
    .hero {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-content .subtitle {
        max-width: 100%;
    }
    .hero-buttons {
        justify-content: center;
    }
    .content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        position: static;
        width: 100%;
        border-bottom: 1px solid var(--bg-light);
        padding-bottom: 1rem;
    }
}
