/* CSS Variables */
:root {
    --bg-primary: #f9f7f4;
    --bg-secondary: #fff;
    --bg-accent: #f5f1ea;
    --text-primary: #333;
    --text-secondary: #444;
    --text-muted: #888;
    --border-color: #e8e1d3;
    --accent-color: #25D366;
    --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-accent: #333;
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8b8;
    --text-muted: #888;
    --border-color: #444;
    --accent-color: #25D366;
    --shadow: rgba(0,0,0,0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Arabic Typography */
[dir="rtl"],
[lang="ar"] {
    font-family: 'Cairo', 'Tajawal', 'Amiri', 'Noto Sans Arabic', sans-serif;
}

/* Header & Navigation */
.main-nav {
    background: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-link {
    display: inline-flex;
    align-items: center;
    margin-right: 2rem;
    text-decoration: none;
}

.site-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: opacity 0.2s;
}

.site-logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.lang-switch a {
    padding: 0.4rem 0.8rem;
    background: var(--bg-accent);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.lang-switch a:hover {
    background: var(--accent-color);
    color: #fff !important;
}

/* Shared Section Styles */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Page Content */
.page-content {
    min-height: 60vh;
    padding: 4rem 2rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.content-article {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
}

/* Article Header */
.article-header {
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--border-color) 100%);
    padding: 3rem 3rem 2rem;
    border-bottom: 3px solid var(--accent-color);
}

.article-header h1 {
    font-size: 2.8rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Article Body */
.article-body {
    padding: 3rem;
}

.article-body h1 {
    font-size: 2.2rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.article-body h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--accent-color);
    border-radius: 2px;
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--accent-color);
    font-weight: 600;
}

.article-body p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.article-body p:first-of-type {
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.article-body strong {
    color: var(--accent-color);
    font-weight: 700;
}

.article-body ul, .article-body ol {
    margin: 1.5rem 0 1.5rem 1.5rem;
    padding-left: 1rem;
}

.article-body li {
    margin-bottom: 0.8rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body li::marker {
    color: var(--accent-color);
    font-weight: bold;
}

.article-body a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(37, 211, 102, 0.3);
    transition: all 0.2s;
}

.article-body a:hover {
    border-bottom-color: var(--accent-color);
    background: rgba(37, 211, 102, 0.05);
}

/* Blog Post Meta */
.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Blog Post Previews */
.blog-posts {
    margin-top: 2rem;
}

.blog-post-preview {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-post-preview:last-child {
    border-bottom: none;
}

.blog-post-preview h2 {
    font-size: 1.6rem;
    margin: 0 0 0.5rem 0;
    padding-left: 0;
}

.blog-post-preview h2::before {
    display: none;
}

.blog-post-preview h2 a {
    color: var(--text-primary);
    border: none;
    font-weight: 600;
    transition: color 0.2s;
}

.blog-post-preview h2 a:hover {
    color: var(--accent-color);
    background: none;
}

.blog-post-preview p {
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(37, 211, 102, 0.3);
    transition: all 0.2s;
}

.read-more:hover {
    border-bottom-color: var(--accent-color);
    background: rgba(37, 211, 102, 0.05);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section p, .footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 32px;
    height: 32px;
    transition: opacity 0.2s;
}

.social-icon:hover {
    opacity: 0.7;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-logo {
        height: 45px;
        max-width: 150px;
    }
    
    .logo-link {
        margin-right: 0;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .lang-switch {
        padding-left: 0;
        border-left: none;
        padding-top: 0.5rem;
        border-top: 2px solid var(--border-color);
        width: 100%;
        justify-content: center;
    }
    
    .page-content {
        padding: 2rem 1rem;
    }
    
    .article-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-body {
        padding: 2rem 1.5rem;
    }
    
    .article-body h1 {
        font-size: 1.8rem;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
[dir="rtl"] .logo-link {
    margin-right: 0;
    margin-left: 2rem;
}

[dir="rtl"] .nav-container {
    direction: rtl;
}

[dir="rtl"] .article-body h2 {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .article-body h2::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .lang-switch {
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 2px solid var(--border-color);
}

[dir="rtl"] .article-body ul,
[dir="rtl"] .article-body ol {
    margin-right: 1.5rem;
    margin-left: 0;
    padding-right: 1rem;
    padding-left: 0;
}

@media (max-width: 768px) {
    [dir="rtl"] .logo-link {
        margin-left: 0;
    }
    
    [dir="rtl"] .lang-switch {
        padding-right: 0;
        border-right: none;
    }
}
