:root {
    /* Color Palette - Refined Corporate Look */
    --primary-color: #dc2626;
    /* Deep Red */
    --primary-hover: #b91c1c;
    --primary-light: #fee2e2;
    --secondary-color: #2563eb;
    /* Royal Blue */
    --secondary-hover: #1d4ed8;
    --secondary-light: #dbeafe;

    --background-color: #f9fafb;
    --surface-color: #ffffff;
    --surface-hover: #f3f4f6;

    --text-main: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --border-hover: #d1d5db;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: #334155;
    --border-hover: #475569;

    --primary-light: rgba(220, 38, 38, 0.2);
    --secondary-light: rgba(37, 99, 235, 0.2);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    overflow-x: hidden;
    /* Prvents horizontal scroll */
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    /* Reduced slightly to fit better on small screens, ensuring gap exists */
    margin-top: 2rem;
    margin-bottom: 4rem;
    width: 100%;
}

/* Ensure vertical spacing between stacked cards usually handled by margin-bottom of .card */
.card+.card {
    margin-top: 0;
    /* Handled by margin-bottom of previous card */
}

@media (min-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr 300px;
    }
}

/* Header */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    /* Modern glass effect */
    background-color: rgba(var(--surface-color), 0.95);
    /* Needs proper RGB handling usually, simplifying fallback */
}

/* Fallback for bg transparency not using rgb vars properly here */
[data-theme="dark"] .site-header {
    background-color: rgba(30, 41, 59, 0.9);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    user-select: none;
}

.btn:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    border-color: var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text-main);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

/* Specific hover effect for interactive cards */
a.card-link {
    display: block;
    color: inherit;
}

a.card-link:hover .card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Sidebar Navigation */
.sidebar .card {
    padding: 1.25rem;
}

.cat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.cat-item:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
    transform: translateX(4px);
}

.cat-item.active {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
}

.cat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-main);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-control:hover {
    border-color: var(--border-hover);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px var(--secondary-light);
}

/* Topics List */
.topic-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.topic-item:hover {
    background-color: var(--surface-hover);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: var(--radius-md);
    border-bottom-color: transparent;
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.topic-content {
    flex: 1;
    min-width: 0;
    /* Flexbox text truncate fix */
}

.topic-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    display: block;
    color: var(--text-main);
    line-height: 1.4;
}

.topic-title:hover {
    color: var(--primary-color);
}

.topic-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.topic-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-pinned {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
}

.badge-locked {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* Footer */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--primary-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Animation Utils */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-col {
    animation: fadeIn 0.4s ease-out;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        /* Slightly less padding on mobile for optimal space */
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .btn {
        white-space: nowrap;
    }

    .main-layout {
        gap: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 1rem;
        /* Reduce card padding on mobile to give more room for content */
        margin-bottom: 1rem;
    }
}

.eeat-box {
    margin: 32px 0;
    padding: 22px 26px;
    border-left: 5px solid #b91c1c;
    /* Ana kırmızı */
    background: #fff5f5;
    border-radius: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.eeat-box h3 {
    margin: 0 0 14px 0;
    font-size: 18px;
    color: #7f1d1d;
    /* Koyu kırmızı */
    font-weight: 600;
}

.eeat-box p {
    margin: 8px 0;
    font-size: 14.5px;
    line-height: 1.65;
    color: #3f3f46;
}

.eeat-warning {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
}

/* Phase 2 SEO & Trust Additions */
.ai-disclosure {
    margin-top: 2rem;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    background: #fff5f5;
    font-size: 0.85rem;
    color: #7f1d1d;
    border-radius: 0 4px 4px 0;
}

.target-audience {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
    background: #eff6ff;
    /* very light blue */
    font-size: 0.9rem;
    color: var(--text-main);
    border-radius: 0 4px 4px 0;
}

.target-audience strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.target-audience p {
    margin: 0;
}

.related-questions {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.related-questions h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.related-questions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-questions li {
    margin-bottom: 0.5rem;
}

.related-questions li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.related-questions li a:hover {
    text-decoration: underline;
}

/* Phase 2.5 SEO - Direct Answer & Editor Note */
.direct-answer {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    color: #166534;
}

.direct-answer strong {
    color: #15803d;
}

.editor-note {
    display: block;
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 2px;
}

/* --- Topic & Comments Responsive Adjustments --- */
.topic-title-main {
    font-size: 1.5rem;
    line-height: 1.3;
}

.user-post-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.user-avatar-col {
    text-align: center;
    width: 60px;
    flex-shrink: 0;
}

.comment-avatar {
    width: 45px;
}

.avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar .avatar-img {
    width: 40px;
    height: 40px;
}

.avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
    color: #9ca3af;
}

.comment-avatar .avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.user-post-content {
    flex: 1;
    min-width: 0;
    /* Ensures word-wrap works gracefully */
}

.user-meta-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-body {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    /* Allows long links to break */
    overflow-wrap: break-word;
}

.post-body img,
.post-body iframe {
    max-width: 100%;
    height: auto;
}

.post-stats {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .topic-title-main {
        font-size: 1.25rem;
    }

    .user-post-box {
        gap: 0.75rem;
    }

    .user-avatar-col {
        width: 45px;
    }

    .avatar-img,
    .avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .comment-avatar .avatar-img,
    .comment-avatar .avatar-placeholder {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .post-stats {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .post-body {
        font-size: 0.95rem;
    }
}