:root {
    --bg-color: #0d0d0d;
    --text-color: #ffffff;
    --primary-color: #ff3366;
    --primary-hover: #ff1a53;
    --secondary-bg: #18181c;
    --card-bg: #121215;
    --border-color: #2a2a30;
    --text-muted: #a0a0ab;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    padding: 16px 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
    display: none;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    align-items: center;
    gap: 6px;
}

.mobile-sidebar-toggle:hover {
    border-color: var(--primary-color);
}

select {
    background-color: var(--secondary-bg);
    color: white;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, select:hover {
    border-color: var(--primary-color);
}

/* Page Layout (Sidebar + Main Content) */
.layout-wrapper {
    display: flex;
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 60px;
    align-items: flex-start;
}

/* Sidebar (Left) */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-item a {
    display: block;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.93rem;
    transition: all 0.2s ease;
    line-height: 1.4;
    border: 1px solid transparent;
}

.article-item a:hover {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.article-item.active a {
    background-color: rgba(255, 51, 102, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0; /* Prevents overflow in flex child */
}

/* Hero Section */
.hero {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 51, 102, 0.08) 0%, rgba(13, 13, 13, 0) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.25;
    font-weight: 800;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 30px auto;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 14px 36px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 51, 102, 0.35);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    background-color: var(--primary-hover);
    box-shadow: 0 6px 24px rgba(255, 51, 102, 0.5);
}

/* Features Section */
.features {
    padding: 40px 0;
    margin-bottom: 40px;
}

.features h2 {
    text-align: center;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 35px;
    margin-top: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background-color: var(--secondary-bg);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Articles Preview Section */
.articles-section {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.articles-section-header {
    margin-bottom: 24px;
}

.articles-section-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
}

.articles-section-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.article-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s, transform 0.2s;
}

.article-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.article-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.article-card p {
    margin: 0 0 16px 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.article-card .read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    align-self: flex-start;
}

/* SEO Article Box */
.seo-content {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.seo-content h2 {
    font-size: 1.1rem;
    color: #d0d0d8;
    margin-top: 0;
    margin-bottom: 12px;
}

.seo-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 35px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .hero,
[dir="rtl"] .features h2,
[dir="rtl"] footer,
[dir="rtl"] .header-left {
    text-align: right;
}

[dir="rtl"] .layout-wrapper {
    flex-direction: row-reverse;
}

/* Responsive Mobile Layout (<= 868px) */
@media (max-width: 868px) {
    .mobile-sidebar-toggle {
        display: inline-flex;
    }

    .layout-wrapper {
        flex-direction: column;
        padding-top: 15px;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        display: none; /* Toggled on mobile via class .open */
    }

    .sidebar.open {
        display: block;
        animation: fadeIn 0.25s ease-in-out;
    }

    .hero {
        padding: 40px 16px;
    }

    .features {
        padding: 20px 0;
    }

    .feature-grid, .article-cards-grid {
        grid-template-columns: 1fr;
    }
}

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