/* 
   DzCommunity Modern UI - Mobile First Approach
   Covers: Typography, Colors, Cards, Buttons, and Layout adjustments
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;700&display=swap');

:root {
    /* --- Modern One Dark / Primary Palette --- */
    --dz-primary: #2563eb;
    /* Brand Blue */
    --dz-primary-dark: #1d4ed8;
    --dz-primary-soft: #dbeafe;
    /* Light Blue bg */

    --dz-bg-body: #f8f9fa;
    /* Very light gray */
    --dz-bg-card: #ffffff;

    --dz-text-main: #1e293b;
    /* Slate 800 */
    --dz-text-muted: #64748b;
    /* Slate 500 */

    /* --- Effects --- */
    --dz-radius-lg: 16px;
    --dz-radius-xl: 24px;
    --dz-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --dz-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --dz-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);

    --dz-glass: rgba(255, 255, 255, 0.7);
    --dz-glass-border: rgba(255, 255, 255, 0.5);
}

/* --- Global Modernization --- */

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--dz-bg-body);
    color: var(--dz-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-font {
    font-family: 'Outfit', sans-serif;
    /* More geometric/modern for headings */
    letter-spacing: -0.02em;
}

/* --- Mobile First Container Tweaks --- */
.container-fluid.community-layout {
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 768px) {
    .container-fluid.community-layout {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* --- Components: CARD --- */
.card {
    border: none;
    background: var(--dz-bg-card);
    border-radius: var(--dz-radius-lg);
    box-shadow: var(--dz-shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

/* Hover effect only for interactive cards */
.card.post-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--dz-shadow-hover);
}

.card-title {
    color: var(--dz-text-main);
}

.text-muted {
    color: var(--dz-text-muted) !important;
}

/* --- Components: BUTTONS (Pills) --- */
.btn {
    border-radius: 50rem;
    /* Full Pill */
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--dz-primary);
    border-color: var(--dz-primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--dz-primary-dark);
    transform: translateY(-1px);
}

/* Ghost Buttons / Icon actions */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--dz-text-muted);
    transition: background-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--dz-primary);
}

/* --- Components: AVATARS --- */
.rounded-circle.border {
    border-color: #f1f5f9 !important;
    /* Slate 100 */
}

/* --- Mobile Navigation & Sticky Header --- */
.community-sub-header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Hide scrollbar for horizontal scrolling elements on mobile */
.horizontal-scroll-snap {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
}

.horizontal-scroll-snap>* {
    scroll-snap-align: start;
    flex: 0 0 85%;
    /* Shows part of next item to encourage scroll */
}

@media (min-width: 768px) {
    .horizontal-scroll-snap>* {
        flex: 0 0 45%;
    }
}

/* --- Glassmorphism Utilities --- */
.glass-panel {
    background: var(--dz-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--dz-glass-border);
}

/* --- Badges & Flairs --- */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
}

/* --- Form Inputs --- */
.form-control {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--dz-radius-lg);
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--dz-primary);
    box-shadow: 0 0 0 4px var(--dz-primary-soft);
}

/* --- Specific Fixes --- */
/* Fix search bar on mobile to be full width */
.community-main-content form[role="search"] {
    border-radius: 50rem !important;
    /* Force pill */
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.z-1020 {
    z-index: 1020;
}

.community-sub-header.sticky-top {
    top: 65px;
    /* Default offset */
}

@media (max-width: 768px) {
    .community-sub-header.sticky-top {
        top: 106px;
        /* Mobile offset to account for main header + search */
    }
}

/* --- Layout Adjustments --- */
/* User Request Update: Sidebar stays on LEFT. */
/* Text Alignment: Ensure sidebar content is left-aligned */

.sidebar-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100% !important;
}

/* Apply to both Desktop (.community-sidebar) and Mobile (.sidebar-inner) */
.community-sidebar h5,
.community-sidebar h6,
.community-sidebar span,
.sidebar-inner h5,
.sidebar-inner h6,
.sidebar-inner span,
.offcanvas-body h5,
.offcanvas-body h6,
.offcanvas-body span {
    text-align: left !important;
}

/* Ensure Offcanvas menu items are also left aligned */
.offcanvas-body {
    text-align: left !important;
}



/* --- Dark Mode Overrides (Premium Look) --- */
[data-bs-theme="dark"] {
    --dz-bg-body: #0f172a; /* Slate 900 (Deep Blue/Black) */
    --dz-bg-card: #1e293b; /* Slate 800 */
    --dz-text-main: #f1f5f9;
    --dz-text-muted: #94a3b8;
    --dz-glass: rgba(30, 41, 59, 0.7);
    --dz-glass-border: rgba(255, 255, 255, 0.1);

    /* Fix 1: Sticky Header Opacity */
    .community-sub-header {
        background: rgba(15, 23, 42, 0.95) !important; /* Almost opaque dark blue */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: blur(15px);
    }

    /* Fix 2: Search Bar (Override bg-white) */
    .community-main-content form[role="search"] {
        background-color: #1e293b !important; /* Matches card bg */
        border-color: #334155 !important;
    }
    
    .community-main-content form[role="search"] input {
        color: #f1f5f9;
    }
    .community-main-content form[role="search"] input::placeholder {
        color: #64748b;
    }

    /* Fix 3: Sidebar Active Link (Softer Blue) */
    .btn-ghost.active, 
    .btn-ghost:active,
    .nav-link.active {
        background-color: rgba(59, 130, 246, 0.15) !important; /* Soft blue tint */
        color: #60a5fa !important; /* Light Blue text */
        border: 1px solid rgba(59, 130, 246, 0.2);
    }

    /* --- Audit Fixes (Premium Pack) --- */

    /* 1. Global Navbar Search */
    .navbar .form-control {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #f1f5f9 !important;
    }
    .navbar .form-control::placeholder {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    /* 2. Filter Buttons Visibility */
    .btn-outline-light.text-dark {
        color: #e4e6eb !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
    }

    /* 3. Active Tab (Navy Blue instead of White) */
    .nav-pills .nav-link.active, 
    .btn-check:checked + .btn-outline-primary {
        background-color: var(--dz-primary) !important;
        color: #fff !important;
        border: none;
    }

    /* 4. General Form Inputs (Contact/Create) */
    .form-control, .form-select {
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }
    .form-control:focus {
        background-color: #0f172a !important;
        border-color: var(--dz-primary) !important;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
    }
}