/* =========================
   GLOBAL
========================= */
body {
    font-family: 'Inter', sans-serif;
    background: #f4f6f9;
    color: #212529;
    font-size: 16px;
}

/* =========================
   NAVBAR
========================= */
.navbar {
    background: linear-gradient(90deg, #0d6efd, #6610f2);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =========================
   HERO
========================= */
.hero {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: white;
    padding: 90px 20px;
}

.hero h1 {
    font-weight: 700;
}

.hero p {
    opacity: 0.95;
    font-size: 18px;
}

/* =========================
   HIGHLIGHT
========================= */
.highlight {
    font-weight: 600;
    color: #ffd43b;
}

/* =========================
   SEARCH
========================= */
.search-box {
    max-width: 520px;
    margin: 25px auto 0;
}

.search-box input {
    border-radius: 50px;
    padding: 12px 18px;
}

/* =========================
   CARDS
========================= */
.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
}


.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

/* =========================
   CATEGORY CARD (FIXED)
========================= */

.category-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 14px;

    padding: 12px;
    transition: all 0.25s ease;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 80px; /* compact but consistent */
}

/* Hover */
.category-card:hover {
    border-color: #0d6efd;
    background: linear-gradient(135deg, #f0f4ff, #ffffff);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.12);
}

/* Title */
.category-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Subtext */
.category-card .text-muted {
    font-size: 13px;
}

/* Body spacing fix */
.category-card .card-body {
    padding: 4px;
}

a.text-dark:hover {
    color: inherit;
}

/* =========================
   BADGE
========================= */
.badge-custom {
    background: #eef2ff;
    color: #4c6ef5;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 20px;
}

/* =========================
   BUTTONS
========================= */
.btn-primary {
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
}

/* =========================
   FORMS
========================= */
.form-control {
    border-radius: 10px;
    padding: 12px;
}

/* =========================
   TYPOGRAPHY
========================= */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 0.6em;
}

h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 32px; font-weight: 700; }
h3 { font-size: 26px; font-weight: 600; }
h4 { font-size: 22px; font-weight: 600; }
h5 { font-size: 18px; font-weight: 600; }
h6 { font-size: 14px; color: #6c757d; }

.section-title {
    font-size: 30px;
    font-weight: 700;
}

.small-text {
    font-size: 14px;
}

/* =========================
   ARTICLE SYSTEM
========================= */
.article-title {
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 700;
}

.article-meta {
    color: #6c757d;
    font-size: 13px;
}

.article-content {
    margin-top: 25px;
    line-height: 1.8;
    font-size: 16px;
}

.article-content h2,
.article-content h3 {
    margin-top: 30px;
    font-weight: 600;
}

.article-content h4 {
    margin-top: 25px;
    font-weight: 600;
}

.article-content h5 {
    margin-top: 20px;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content ul {
    margin-left: 20px;
}

code {
    font-family: 'Fira Code', monospace;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 6px;
}

/* =========================
   AUTH (LOGIN / REGISTER)
========================= */

/* Shared wrapper */
.login-wrapper,
.register-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shared card */
.login-card,
.register-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

pre {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

/* =========================
   FOOTER
========================= */
footer {
    background: #0f172a;
}
.footer-enhanced {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

/* Links styling */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .footer-links {
        justify-content: flex-end;
    }
}

.footer-link {
    color: #cbd5f5;
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
}

/* Hover effect */
.footer-link:hover {
    color: #ffc107;
}

/* Underline animation */
.footer-link::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #ffc107;
    left: 0;
    bottom: -3px;
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}
/* Social icons container */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 18px;
}

/* Icon styling */
.social-icon {
    font-size: 1.4rem;
    color: #cbd5f5;
    transition: all 0.3s ease;
}

/* Hover effect */
.social-icon:hover {
    color: #ffc107;
    transform: translateY(-2px);
}
/* =========================
   MOBILE
========================= */
@media (max-width: 576px) {

    .hero {
        padding: 60px 15px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .card-title {
        font-size: 16px;
    }

    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }

    .article-content {
        font-size: 15px;
    }
}
/* =========================== Blockquotes & Images =========================== */
 .blockquote {
     margin: 25px 0;
     background: #f8f9fa;
     padding: 25px 30px;
     font-size: 1rem;
     border-left: 4px solid #1b1642;
     border-radius: 6px;
}
 .img-responsive {
     max-width: 100%;
     height: auto;
     display: block;
     border-radius: 8px;
}
/* =========================
   ARTICLE SIDEBAR INDEX
========================= */
.toc-wrapper {
    position: sticky;
    top: 90px;
}

.toc-wrapper a:hover {
    color: #0d6efd;
}

@media (max-width: 991px) {
    .toc-wrapper {
        position: relative;
        top: auto;
    }
}
/* Fix oversized avatar */
.author-avatar {
    flex-shrink: 0; /* prevents stretching */
}

.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eef2ff;
    display: block;
}

/* =========================
   SIDEBAR (PRO UI)
========================= */

.sidebar-card {
    border-radius: 16px;
    border: 1px solid #eef2ff;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* List container */
.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Each item */
.sidebar-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.2s ease;
}

/* Hover */
.sidebar-item:hover {
    background: #f1f5ff;
    color: #0d6efd;
}

/* Active item */
.sidebar-item.active {
    background: #eef2ff;
    color: #0d6efd;
    font-weight: 600;
}

/* Sticky behavior */
.toc-wrapper {
    position: sticky;
    top: 90px;
}

/* Mobile fix */
@media (max-width: 991px) {
    .toc-wrapper {
        position: relative;
        top: auto;
    }
}
 .share-btn {
     width: 45px;
     height: 45px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     transition: transform 0.2s ease;
}
 .share-btn:hover {
     transform: scale(1.1);
}
/* =========================
   SIDEBAR VISIBILITY BOOST
========================= */

/* Highlight container */
.sidebar-highlight {
    border: 2px solid #e0e7ff;
    background: linear-gradient(135deg, #ffffff, #f8faff);
    box-shadow: 0 15px 40px rgba(13, 110, 253, 0.08);
    transition: all 0.3s ease;
}

/* Hover effect (subtle glow) */
.sidebar-highlight:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(13, 110, 253, 0.15);
}

/* Header emphasis */
.sidebar-header {
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
}

/* Sidebar items (bigger + clickable feel) */
.sidebar-item {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.25s ease;
}

/* Hover effect stronger */
.sidebar-item:hover {
    background: #e9f0ff;
    color: #0d6efd;
    transform: translateX(4px);
}

/* Active item = strong highlight */
.sidebar-item.active {
    background: linear-gradient(90deg, #e7f1ff, #f1f5ff);
    border-left: 3px solid #0d6efd;
    font-weight: 600;
    color: #0d6efd;
}

/* Add subtle scroll indicator */
.sidebar-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar */
.sidebar-list::-webkit-scrollbar {
    width: 4px;
}
.sidebar-list::-webkit-scrollbar-thumb {
    background: #d0d7ff;
    border-radius: 10px;
}
/* =========================
   ARTICLE CARD (MAIN CONTENT)
========================= */

.article-card {
    border-radius: 18px;
    border: 1px solid #eef2ff;
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

/* Subtle hover lift */
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.10);
}

/* Better spacing inside */
.article-card .article-content {
    margin-top: 20px;
}

/* Improve readability inside card */
.article-card p {
    font-size: 16px;
    line-height: 1.85;
}

/* Section spacing */
.article-card h2,
.article-card h3 {
    margin-top: 35px;
}

/* Optional: divider between sections */
.article-card hr {
    margin: 30px 0;
    opacity: 0.1;
}
/* =========================
   HERO ENHANCEMENT
========================= */

.hero-enhanced {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    position: relative;
    overflow: hidden;
}

.hero-enhanced::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

/* =========================
   SECTION HEADER
========================= */

.section-header {
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
}

/* =========================
   CATEGORY CARD UPGRADE
========================= */

.category-enhanced {
    border-radius: 18px;
    border: 1px solid #eef2ff;
    background: linear-gradient(135deg, #ffffff, #f8faff);
    transition: all 0.3s ease;
}

.category-enhanced:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(13,110,253,0.15);
}

/* =========================
   ARTICLE PREVIEW CARD
========================= */

.article-preview {
    border-radius: 14px;
    border: 1px solid #eef2ff;
    background: #ffffff;

    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}

/* Hover (more controlled & premium) */
.article-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.08);
}

/* Body spacing control */
.article-preview .card-body {
    padding: 14px;
}

/* Title */
.article-preview .card-title {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 6px;
}

/* Meta */
.article-preview .text-muted {
    font-size: 13px;
    opacity: 0.85;
}

/* CTA */
.article-preview .text-primary {
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* CTA hover feels clickable */
.article-preview:hover .text-primary {
    transform: translateX(4px);
    opacity: 0.9;
}

/* =========================
   TEXT CLAMP
========================= */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* =========================
   CATEGORY HEADER CARD
========================= */

.category-header {
    border-radius: 20px;
    border: 1px solid #eef2ff;
    background: linear-gradient(135deg, #ffffff, #f8faff);
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
}

/* =========================
   SUBCATEGORY FILTER
========================= */

.subcategory-filter {
    border-radius: 16px;
    border: 1px solid #eef2ff;
    background: #ffffff;
}

/* =========================
   EMPTY STATE
========================= */

.empty-state {
    border-radius: 16px;
    border: 1px dashed #dee2ff;
    background: #fbfcff;
}

/* =========================
   PAGINATION MODERN
========================= */

.pagination-modern .page-link {
    border-radius: 8px;
    margin: 0 4px;
    border: none;
    background: #f1f5ff;
    color: #0d6efd;
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(90deg, #0d6efd, #6f42c1);
    color: #fff;
}

.pagination-modern .page-link:hover {
    background: #e0e7ff;
}
/* =========================
   NAVBAR ENHANCED
========================= */

.navbar-enhanced {
    background: linear-gradient(90deg, #0d6efd, #6f42c1);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Brand */
.navbar-brand {
    font-size: 20px;
    letter-spacing: 0.5px;
}

/* Nav links */
.nav-link-custom {
    position: relative;
    padding: 6px 10px;
    transition: all 0.2s ease;
}

/* Hover underline animation */
.nav-link-custom::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.nav-link-custom:hover::after {
    width: 70%;
}

/* Hover color */
.nav-link-custom:hover {
    opacity: 0.9;
}

/* Logout button */
.logout-btn {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #f1f5ff;
    transform: translateY(-1px);
}

/* Fix dropdown going under content */
/* =========================
   NAVBAR FIX
========================= */
.navbar {
    position: relative;
    z-index: 1050;
}

/* =========================
   BASE DROPDOWN STYLE
========================= */
.category-dropdown {
    position: relative;
}

.category-dropdown .dropdown-menu {
    border: none;
    min-width: 280px;
    max-width: min(360px, 90vw);

    background: linear-gradient(135deg, #ffffff, #f8faff);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);

    white-space: normal;
}

/* =========================
   DESKTOP (HOVER)
========================= */
@media (min-width: 992px) {

    .category-dropdown .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.25s ease;

        left: auto;
        right: 0;
    }

    .category-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        margin-top: 8px;
    }
}

/* =========================
   MOBILE (CRITICAL FIX)
========================= */
@media (max-width: 991px) {

    .category-dropdown .dropdown-menu {
        position: static;     /* stack inside navbar */
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        margin-top: 5px;
    }
}

/* =========================
   DROPDOWN PREMIUM STYLE
========================= */
.category-dropdown .dropdown-menu {
    border: 1px solid #eef2ff;
    border-radius: 14px;
    padding: 10px;

    background: linear-gradient(135deg, #ffffff, #f5f8ff);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

/* =========================
   DROPDOWN ITEMS
========================= */
.dropdown-item {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;

    transition: all 0.25s ease;
}

/* Hover effect (main upgrade) */
.dropdown-item:hover {
    background: linear-gradient(90deg, #eef2ff, #f5f8ff);
    color: #0d6efd;
    transform: translateX(6px);
}

/* Optional: active click feel */
.dropdown-item:active {
    background: #e7f1ff;
}

/* =========================
   SUBTLE DIVIDER (optional)
========================= */
.dropdown-menu li:not(:last-child) {
    margin-bottom: 4px;
}

/* Mobile spacing */
@media (max-width: 991px) {
    .navbar-nav {
        margin-top: 10px;
    }

    .nav-link {
        padding: 10px 0;
    }
}

/* =========================
   COMMENT SYSTEM
========================= */
.comment-form-card {
    border-radius: 14px;
    border: 1px solid #eee;
    background: #fafafa;
}

.comment-form-card input,
.comment-form-card textarea {
    border-radius: 10px;
    border: 1px solid #ddd;
}

.comment-form-card input:focus,
.comment-form-card textarea:focus {
    border-color: #3b82f6;
    box-shadow: none;
}

.comment-card {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease;
}

.comment-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.comment-name {
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: #888;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* ❤️ POST LIKE (FINAL CLEAN) */
.heart-btn-post {
    cursor: pointer;
    font-size: 18px; /* balanced size */
    transition: transform 0.15s ease;
}

.heart-btn-post:hover {
    transform: scale(1.2);
}

.heart-btn-post.liked {
    color: #ef4444;
    animation: popHeart 0.25s ease;
}

.like-count-post {
    font-size: 13px;
    color: #666;
}

.like-wrapper {
    line-height: 1;
}

.like-count-post {
    font-size: 13px;
    color: #666;
    display: inline-flex;
    align-items: center;
}

.heart-btn-post {
    position: relative;
    top: 1px; /* tweak: 1px or 2px if needed */
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popHeart {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}