/* Custom Styling for Developer & Writer Platform */
:root {
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-accent: #d97706;
    --brand-code-bg: #0f172a;
    --reader-font-size: 1.15rem;
    --reader-line-height: 1.85;
}

[data-bs-theme="dark"] {
    --brand-primary: #3b82f6;
    --brand-primary-hover: #60a5fa;
    --brand-code-bg: #030712;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography styles */
.font-serif {
    font-family: 'Lora', 'Merriweather', Georgia, serif;
}

.font-mono {
    font-family: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Dual Identity Badge */
.badge-dev {
    background-color: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-weight: 600;
}
[data-bs-theme="dark"] .badge-dev {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
}

.badge-writer {
    background-color: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
    font-weight: 600;
}
[data-bs-theme="dark"] .badge-writer {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

/* Hero section */
.hero-glow {
    position: absolute;
    top: -10%;
    right: 5%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, rgba(217,119,6,0.08) 50%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

/* Cards & subtle hover */
.card-hover {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .card-hover {
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.12);
}
[data-bs-theme="dark"] .card-hover:hover {
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.4);
}

/* Railway track visual motif */
.railway-motif {
    background: repeating-linear-gradient(90deg, currentColor 0, currentColor 2px, transparent 0, transparent 16px);
    height: 3px;
    opacity: 0.18;
}

/* Reading Experience Specifics */
.reading-container {
    max-width: 740px;
    margin-left: auto;
    margin-right: auto;
}

.reading-content {
    font-family: 'Lora', 'Merriweather', Georgia, serif;
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    color: inherit;
}

.reading-content p {
    margin-bottom: 1.6rem;
    text-align: justify;
}

.reading-content p:first-of-type::first-letter {
    font-size: 3.2rem;
    float: left;
    line-height: 0.85;
    padding-right: 0.5rem;
    padding-top: 0.2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--brand-primary);
}

/* Reading Progress Bar */
#reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1050;
}

#reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #d97706);
    transition: width 0.1s ease-out;
}

/* Font size presets */
body.font-size-sm {
    --reader-font-size: 1.02rem;
    --reader-line-height: 1.75;
}

body.font-size-md {
    --reader-font-size: 1.18rem;
    --reader-line-height: 1.88;
}

body.font-size-lg {
    --reader-font-size: 1.34rem;
    --reader-line-height: 1.95;
}

/* Font Family toggle in reader */
body.reader-sans .reading-content {
    font-family: 'Inter', system-ui, sans-serif !important;
}

/* Clean comments tree */
.comment-box {
    border-left: 3px solid rgba(37, 99, 235, 0.4);
    background-color: rgba(0, 0, 0, 0.02);
}
[data-bs-theme="dark"] .comment-box {
    background-color: rgba(255, 255, 255, 0.02);
    border-left-color: rgba(59, 130, 246, 0.5);
}

.admin-reply-box {
    border-left: 3px solid #10b981;
    background-color: rgba(16, 185, 129, 0.04);
}
[data-bs-theme="dark"] .admin-reply-box {
    background-color: rgba(16, 185, 129, 0.08);
}

/* Navbar active state */
.navbar-nav .nav-link.active {
    font-weight: 600;
    color: var(--brand-primary) !important;
}

/* Nav pills active state - guarantee crisp white text on primary background */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #ffffff !important;
    background-color: var(--brand-primary) !important;
}

/* Footer subtle */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Code block highlight inside blog */
pre code {
    font-family: 'JetBrains Mono', Consolas, monospace;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Zero Horizontal Scroll & Responsive Layout Guarantee */
html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

.navbar {
    max-width: 100%;
}

.navbar .navbar-collapse {
    min-width: 0;
}

/* CKEditor 5 Superbuild Styling & Dark Mode Integration */
.ck.ck-editor {
    border-radius: 0.85rem !important;
    overflow: hidden !important;
    border-color: var(--bs-border-color) !important;
}
.ck.ck-toolbar {
    border-top-left-radius: 0.85rem !important;
    border-top-right-radius: 0.85rem !important;
    border-color: var(--bs-border-color) !important;
    background: var(--bs-tertiary-bg) !important;
    padding: 0.5rem !important;
}
.ck.ck-content {
    border-bottom-left-radius: 0.85rem !important;
    border-bottom-right-radius: 0.85rem !important;
    border-color: var(--bs-border-color) !important;
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    min-height: 380px !important;
    padding: 1.5rem !important;
}
[data-bs-theme="dark"] .ck.ck-toolbar {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .ck.ck-toolbar .ck-button {
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .ck.ck-toolbar .ck-button:hover,
[data-bs-theme="dark"] .ck.ck-toolbar .ck-button.ck-on {
    background: #334155 !important;
    color: #60a5fa !important;
}
[data-bs-theme="dark"] .ck.ck-content {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .ck.ck-dropdown__panel {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .ck.ck-list__item .ck-button {
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .ck.ck-list__item .ck-button:hover {
    background: #334155 !important;
}

