@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --bg-color: #0b1120;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #3b82f6;
    --secondary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(11, 17, 32, 0.75);
    --glass-border: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

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

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
}

/* Header & Nav */
header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--text-main);
}

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

.nav-links a {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links .cta-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.nav-links .cta-btn::after { display: none; }
.nav-links .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Hero Section & Tool */
.hero {
    margin-top: 70px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.15), transparent 40%),
                linear-gradient(rgba(11, 17, 32, 0.8), rgba(11, 17, 32, 0.95)), 
                url('../images/hero_bg.png') center/cover;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    z-index: 2;
    animation: slideUp 0.8s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    color: #e2e8f0;
}

.trust-badges {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.trust-badges span {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    backdrop-filter: blur(5px);
}

.tool-container {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    padding: 1rem 1.5rem;
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 4px 4px 0 0;
}

.search-box {
    display: flex;
    gap: 1rem;
}

.search-box input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    background-color: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.search-box button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 2.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Loading & Results */
#loading-spinner {
    display: none;
    margin: 2rem auto;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(16, 185, 129, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#search-results {
    margin-top: 2.5rem;
    display: none;
    text-align: right;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: linear-gradient(145deg, var(--surface-color), var(--surface-hover));
    padding: 2rem;
    border-radius: 16px;
    border-right: 5px solid var(--primary-color);
    box-shadow: var(--shadow-md);
}

.result-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1.5rem;
}

.result-card p {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* Article Container & SEO Layout */
.breadcrumb {
    padding: 1rem 0;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: var(--text-muted);
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.breadcrumb li {
    display: flex;
    align-items: center;
}
.breadcrumb a {
    color: var(--text-muted);
    font-weight: 600;
}
.breadcrumb a:hover {
    color: var(--primary-color);
}
.breadcrumb span {
    margin: 0 0.5rem;
}

.layout-wrapper {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
.main-content {
    flex: 3;
    min-width: 0; /* Prevents flex blowout */
}
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

/* Typography in Content */
article section {
    margin-bottom: 3.5rem;
}

article h2 {
    font-size: 2.2rem;
    color: var(--text-main);
    position: relative;
    padding-bottom: 1rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

article h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

article h3 {
    font-size: 1.6rem;
    margin-top: 2rem;
    color: #e2e8f0;
}

article ul, article ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
    color: var(--text-muted);
}

article li {
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
}

article p strong {
    color: var(--text-main);
}

.article-image {
    margin: 2.5rem 0;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.article-image img {
    display: block;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-image:hover img {
    transform: scale(1.05);
}

/* FAQ Styles */
.faq-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.faq-item h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.faq-item p {
    margin-bottom: 0;
}

/* Table of Contents */
.toc {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.4));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
}
.toc h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.toc ul {
    list-style: none;
    padding-right: 0;
    margin-bottom: 0;
    column-count: 2;
    column-gap: 2rem;
}
@media (max-width: 768px) {
    .toc ul { column-count: 1; }
}
.toc li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-right: 1.5rem;
}
.toc li::before {
    content: '←';
    position: absolute;
    right: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}
.toc a {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}
.toc a:hover {
    color: var(--text-main);
}

/* Sidebar Widgets */
.widget {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.cta-widget {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
    text-align: center;
}

.cta-widget h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    border: none;
}

.secondary-btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 1rem;
}
.secondary-btn:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.widget h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.widget-list {
    list-style: none;
    padding: 0;
}
.widget-list li {
    margin-bottom: 1rem;
}
.widget-list a {
    color: var(--text-muted);
    display: block;
    transition: var(--transition);
    font-weight: 500;
}
.widget-list a:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 2rem;
    background: linear-gradient(145deg, var(--surface-color), rgba(30, 41, 59, 0.5));
    padding: 2.5rem;
    border-radius: 16px;
    margin-top: 4rem;
    border: 1px solid var(--border-color);
    align-items: center;
}
.author-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface-hover);
}
.author-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1.4rem;
}
.author-info p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.author-link {
    font-weight: 700;
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--surface-color);
    padding: 5rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
}

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

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 1rem;
}

.footer-col a {
    color: var(--text-muted);
    font-weight: 500;
}

.footer-col a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.trust-signals {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.trust-signals .badge {
    background: var(--surface-hover);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
}

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

/* Page Headers (About, Contact etc) */
.page-header {
    margin-top: 70px;
    padding: 6rem 2rem;
    text-align: center;
    background: linear-gradient(rgba(11, 17, 32, 0.9), rgba(11, 17, 32, 0.9)), url('../images/hero_bg.png') center/cover;
    border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
    font-size: 3rem;
    color: var(--primary-color);
}
.page-header p {
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 992px) {
    .layout-wrapper {
        flex-direction: column;
    }
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        padding: 1.2rem;
        justify-content: center;
    }
    
    article h2 {
        font-size: 1.8rem;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
}
