:root {
    --primary-accent: #6366f1;
    --dark-surface: #0f172a;
    --text-main: #1e293b;
    --bg-light: #f8fafc;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 70px;
    /* Space for fixed navbar */
}

/* --- UI Component: Reading Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-accent), #a855f7);
    z-index: 1051;
}

/* --- UI Component: Modern Navbar --- */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--dark-surface) !important;
}

/* --- Transitions --- */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    background: var(--dark-surface);
    color: white;
    padding: 4rem 0;
    margin-top: 5rem;
}

.article-header {
    max-width: 900px;
    margin: 0 auto 3rem auto;
}

.post-content {
    max-width: 740px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: #334155;
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
}

.post-content h2,
.post-content h3 {
    color: #0f172a;
    margin-top: 2.5rem;
    font-weight: 700;
}

.comment-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.comment-card:hover {
    border-color: var(--primary-accent);
}

.reply-thread {
    border-left: 2px solid #e2e8f0;
    padding-left: 1.5rem;
    margin-left: 1rem;
}

.sticky-toolbar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.profile-header-card {
    border: none;
    border-radius: 20px;
    background: white;
    padding: 2rem;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.avatar-wrapper img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Minimalist Action Buttons */
.btn-action {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem;
    transition: all 0.2s;
}

/* Content List Styling */
.user-post-item {
    border: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    background: white;
    border-radius: 12px;
}

.user-post-item:hover {
    border-left: 3px solid var(--primary-accent);
    background: #fdfdff;
    transform: translateX(5px);
}

.stats-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.settings-card {
    border: none;
    border-radius: 20px;
    background: #ffffff;
}

/* Styling the Django Form Fields */


/* Avatar Preview UI */
.edit-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem auto;
}

#imagePreview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--primary-accent);
    font-weight: 600;
    cursor: pointer;
    display: block;
    margin-top: 0.5rem;
}


.login-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border: none;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.form-control {
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    font-weight: 800;
    letter-spacing: -1px;
    font-size: 2rem;
    color: var(--dark-surface);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
}


/* Comment Container */
.comment-item {
    position: relative;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.comment-item:hover {
    border-color: var(--primary-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Avatar Circle */
.comment-avatar {
    width: 40px;
    height: 40px;
    background: #6366f1;
    /* Fallback color */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Threading Lines */
.reply-thread {
    margin-left: 2.5rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 1.5rem;
    position: relative;
}

/* Horizontal connector for replies */
.reply-thread .comment-item::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 2rem;
    width: 1rem;
    height: 2px;
    background: #e2e8f0;
}

.comment-meta {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.comment-body {
    color: #475569;
    line-height: 1.5;
    font-size: 0.95rem;
}

.btn-reply {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-accent);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-reply:hover {
    background: #eff6ff;
}

.comment-item img {
    display: block;
    max-width: 100%;
}

/* Threading line adjustment for larger avatars */
.reply-thread {
    margin-left: 2.8rem;
    /* Increased slightly to align with the text start */
    border-left: 2px solid #f1f5f9;
    padding-left: 1.5rem;
}

/* Style for the initial-based fallback */
.comment-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}