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

/* --- premium Glassmorphism Design System --- */
:root {
    --bg-main: #0a1019;
    --bg-glass: rgba(12, 22, 30, 0.75);
    --bg-glass-hover: rgba(20, 35, 45, 0.85);
    --border-glass: rgba(16, 185, 129, 0.1);
    --border-glass-active: rgba(16, 185, 129, 0.4);
    
    --brand-primary: #10B981;
    --brand-primary-hover: #0F766E;
    --brand-glow: rgba(16, 185, 129, 0.25);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-lost: #ef4444;
    --color-lost-bg: rgba(239, 68, 68, 0.15);
    --color-lost-border: rgba(239, 68, 68, 0.3);
    
    --color-found: #10B981;
    --color-found-bg: rgba(16, 185, 129, 0.15);
    --color-found-border: rgba(16, 185, 129, 0.3);
    
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --font-arabic: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 118, 110, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-arabic);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px fill var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #6ee7b7 0%, #10B981 50%, #0F766E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-badge {
    background: var(--brand-primary);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px var(--brand-glow);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-family: var(--font-arabic);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--brand-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-found) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* --- User Panel Info --- */
.user-info-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 6px 14px;
    border-radius: 40px;
}

.avatar-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #0F766E 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}

.username-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* --- Main Layout Grid --- */
.main-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- Mobile Improvements --- */
@media (max-width: 900px) {
    header .header-content { height: 60px; }
    .logo-text { font-size: 20px; }
    .logo-badge { font-size: 10px; padding: 2px 6px; }
    .user-nav { gap: 8px; }

    /* Make primary buttons larger and easier to tap */
    .btn { padding: 12px 14px; font-size: 15px; }

    /* Sidebar becomes a bottom/overlay panel */
    aside.glass-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        z-index: 120;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 18px;
        max-height: 70vh;
        overflow-y: auto;
    }
    aside.glass-panel.open {
        transform: translateY(0%);
    }

    /* Mobile filter toggle button */
    #mobile_filter_toggle {
        display: none !important;
    }


    /* Make inputs larger on mobile */
    .filter-select, .form-input, .form-textarea, .comment-input {
        padding: 14px 18px;
        font-size: 16px;
    }

    /* Increase action button touch targets */
    .action-btn { padding: 10px 14px; font-size: 15px; }

    /* Make cards full-width with comfortable spacing */
    .post-card { border-radius: 12px; }

    /* Reduce image sizes for mobile */
    .post-image { max-height: 300px; }

    /* Comments area smaller on mobile */
    .comments-list { max-height: 220px; }
}

/* --- User Sidebar (logout hidden inside) --- */
.header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#user_sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -320px;
    width: 300px;
    z-index: 140;
    transition: left 0.28s ease;
}

#user_sidebar.open {
    left: 0;
}

#user_sidebar .user-sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#user_sidebar .user-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#user_sidebar .user-sidebar-body { 
    flex: 1; 
    display: flex;
    flex-direction: column;
}

#user_sidebar .logout-hidden {
    margin-top: auto !important;
}

/* --- Compact Filters --- */
.glass-panel.compact {
    max-height: 88px;
    padding: 10px 14px;
    overflow: hidden;
}

.filters-compact-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.filters-expand-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Glassmorphic Panels --- */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-premium);
}

/* --- Filters Sidebar --- */
.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group {
    margin-bottom: 18px;
}

.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.filter-select, .form-input, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.filter-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-glow);
    background: rgba(0, 0, 0, 0.35);
}

.filter-select option {
    background-color: #111827;
    color: var(--text-primary);
}

/* --- Feed List --- */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.feed-title {
    font-size: 20px;
    font-weight: 800;
}

.feed-count {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Card Post (Instagram-like) --- */
.post-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.post-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #0F766E 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    font-size: 14px;
}

.post-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Badges lost/found */
.post-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-lost {
    background: var(--color-lost-bg);
    color: var(--color-lost);
    border: 1px solid var(--color-lost-border);
}

.badge-found {
    background: var(--color-found-bg);
    color: var(--color-found);
    border: 1px solid var(--color-found-border);
}

.badge-location {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

/* Post Content */
.post-body {
    padding: 20px;
}

.post-text {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #e5e7eb;
}

.post-image-container {
    margin-top: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
    max-height: 450px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-image {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    display: block;
}

/* Post Actions */
.post-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.08);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-arabic);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 30px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.like-btn.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.like-btn.liked svg {
    fill: #ef4444;
    stroke: #ef4444;
}

.like-btn svg {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-btn:active svg {
    transform: scale(1.4);
}

/* Comments Drawer / Box */
.comments-section {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
}

.comments-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399 0%, #10B981 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    flex-shrink: 0;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    flex-grow: 1;
}

.comment-author-name {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 4px;
}

.comment-text-content {
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.5;
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Comment Input Area */
.comment-form {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.comment-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 10px 20px;
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 13px;
    outline: none;
}

.comment-input:focus {
    border-color: var(--brand-primary);
    background: rgba(0, 0, 0, 0.35);
}

.comment-submit-btn {
    background: var(--brand-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--brand-glow);
    flex-shrink: 0;
}

.comment-submit-btn:hover {
    background: var(--brand-primary-hover);
    transform: scale(1.05);
}

.comment-login-promo {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.comment-login-promo a {
    color: var(--brand-primary);
    text-decoration: underline;
    font-weight: 700;
}

/* Reply Button */
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-arabic);
    cursor: pointer;
    padding: 2px 8px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.comment-reply-btn:hover {
    color: var(--brand-primary);
    background: rgba(16, 185, 129, 0.08);
}

.comment-reply-btn svg {
    width: 12px;
    height: 12px;
}

/* Reply Form (inline under comment) */
.reply-form-container {
    margin-top: 8px;
    margin-right: 40px;
    animation: fadeIn 0.25s ease-out;
}

.reply-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reply-form .comment-input {
    font-size: 12px;
    padding: 8px 16px;
}

.reply-form .comment-submit-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
}

/* Nested Replies */
.comment-replies {
    margin-top: 8px;
    margin-right: 40px;
    padding-right: 12px;
    border-right: 2px solid rgba(16, 185, 129, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-replies .comment-item {
    animation: fadeIn 0.3s ease-out;
}

.comment-replies .comment-avatar {
    width: 24px;
    height: 24px;
    font-size: 9px;
    background: linear-gradient(135deg, #6ee7b7 0%, #059669 100%);
}

.comment-replies .comment-bubble {
    padding: 8px 12px;
}

.comment-replies .comment-author-name {
    font-size: 11px;
}

.comment-replies .comment-text-content {
    font-size: 12px;
}

.comment-reply-indicator {
    font-size: 10px;
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-reply-indicator svg {
    width: 10px;
    height: 10px;
}

/* --- Auth Portal Styling --- */
.auth-wrapper {
    max-width: 480px;
    margin: 60px auto;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.auth-tab {
    flex-grow: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #6ee7b7 0%, #10B981 50%, #0F766E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-alert {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid var(--color-lost-border);
    color: var(--color-lost);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.form-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--color-found-border);
    color: var(--color-found);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

/* --- Create Post Styling --- */
.create-wrapper {
    max-width: 720px;
    margin: 40px auto 60px;
}

.create-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 15px;
    text-align: center;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.type-option {
    flex-grow: 1;
}

.type-option input {
    display: none;
}

.type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    font-weight: 800;
    cursor: pointer;
    font-size: 15px;
    background: rgba(0,0,0,0.1);
}

.type-option input:checked + .type-label.lost {
    background: var(--color-lost-bg);
    border-color: var(--color-lost);
    color: var(--color-lost);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.type-option input:checked + .type-label.found {
    background: var(--color-found-bg);
    border-color: var(--color-found);
    color: var(--color-found);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* Styled Image Upload */
.image-upload-wrapper {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
}

.image-upload-wrapper:hover {
    border-color: var(--brand-primary);
    background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
    font-size: 40px;
    color: var(--brand-primary);
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.preview-container {
    margin-top: 15px;
    display: none;
    justify-content: center;
}

.preview-image {
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 50px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.empty-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
}

.empty-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* --- Call Button & Backdrop Overlay --- */
.call-btn {
    margin-right: auto; /* Push to the opposite side */
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}
.call-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.45);
}

.backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.backdrop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hide mobile elements by default */
.mobile-search-btn {
    display: none;
}

.sidebar-header-wrapper button {
    display: none;
}

.filter-actions-wrapper #mobile_filter_apply {
    display: none;
}

.filter-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.sidebar-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}
.sidebar-header-wrapper .sidebar-title {
    margin: 0;
    border: none;
    padding: 0;
}

/* --- Mobile Overrides (Cascading at the bottom to ensure they take precedence) --- */
@media (max-width: 900px) {
    .mobile-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 105 !important;
        background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%) !important;
        color: white !important;
        padding: 12px 24px !important;
        border-radius: 50px !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        font-weight: 800 !important;
        font-size: 15px !important;
        cursor: pointer !important;
        box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4) !important;
        width: calc(100% - 40px) !important;
        max-width: 320px !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-search-btn:hover {
        transform: translateX(-50%) translateY(-2px) !important;
        box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6) !important;
    }

    .sidebar-header-wrapper button {
        display: inline-flex !important;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
    }

    .filter-actions-wrapper #mobile_filter_apply {
        display: inline-flex !important;
    }
}

/* --- Categories Selection Form & Tags --- */
.category-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.category-chip {
    cursor: pointer;
}

.category-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.category-chip span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    user-select: none;
    transition: all 0.2s ease;
}

.category-chip input:checked + span {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-glow);
}

.category-chip:hover span {
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.badge-category {
    background: rgba(16, 185, 129, 0.08);
    color: var(--brand-primary);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 11px;
    padding: 4px 10px;
}

/* --- Admin & Moderation Badges --- */
.badge-status-approved {
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--brand-primary) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.badge-status-pending {
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

/* Image avatars fallback compatibility */
img.author-avatar,
img.comment-avatar,
img.user-initial-avatar,
img.avatar-letter,
img.profile-avatar-large {
    object-fit: cover;
    background: transparent !important;
}

