/* ==========================================================
   main.css — Trishal Helpline (Updated FB-Style)
   ========================================================== */
:root {
    --brand-color: #1877f2;
    --brand-dark: #145dbf;
    --bg-color: #f0f2f5;
    --card-bg: #fff;
    --text-color: #050505;
    --muted-text: #65676b;
    --border-color: #ced0d4;
    --danger: #e41e3f;
    --success: #31a24c;
    --govt-badge: #0a58ca;
    --bottom-nav-height: 56px;
    --topbar-height: 56px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-color); 
    color: var(--text-color);
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------------- Forms & Buttons ---------------- */
.form-control {
    width: 100%; padding: 10px 14px; font-size: 15px; border: 1px solid var(--border-color); border-radius: 8px;
    background: #ffffff; font-family: inherit; outline: none; transition: border 0.2s;
}
.form-control:focus { border-color: var(--brand-color); }
textarea.form-control { resize: none; }

.btn {
    display: inline-block; padding: 8px 16px; font-size: 15px; font-weight: 600; border-radius: 6px; 
    border: none; cursor: pointer; text-decoration: none; text-align: center; transition: background 0.2s;
}
.btn-primary { background: var(--brand-color); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { background: var(--bg-color); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ---------------- Top bar ---------------- */
.site-topbar {
    position: sticky; top: 0; z-index: 300; height: var(--topbar-height);
    background: #fff; border-bottom: 1px solid #dddfe2; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 10px;
}
.site-topbar .logo-text { font-weight: 800; font-size: 20px; color: var(--brand-color); text-decoration: none; white-space: nowrap; }

.topbar-search-form {
    flex: 1; display: flex; position: relative; max-width: 280px; margin-left: 10px;
}
.topbar-search {
    background: #f0f2f5; border-radius: 50px; padding: 10px 40px 10px 16px; font-size: 15px; color: var(--text-color); border: none; width: 100%; outline: none;
}
.search-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted-text);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; background: #e4e6eb; color: #050505;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    text-decoration: none; position: relative; border: none; cursor: pointer; transition: background 0.2s;
}
.icon-btn:hover { background: #d8dadf; }
.icon-btn .dot {
    position: absolute; top: 2px; right: 2px; width: 10px; height: 10px;
    background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.btn-auth { padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-login { color: var(--brand-color); border: 1px solid var(--brand-color); }
.btn-register { background: var(--brand-color); color: #fff; }

/* ---------------- Mobile Menu & Adjustments ---------------- */
.hamburger-mobile { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-color); margin-right: 12px; padding: 0; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 350; }
.mobile-overlay.show { display: block; }

@media (max-width: 999px) {
    .hamburger-mobile { display: block; }
    .col-left {
        display: block !important; position: fixed; top: 0; left: -280px; width: 260px; height: 100vh; background: #fff; z-index: 400; transition: left 0.3s ease; overflow-y: auto; padding: 16px 12px; box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    .col-left.open { left: 0; }
    
    .site-topbar { padding: 0 10px; }
    /* মোবাইলে সার্চবার ডানে ফুল-স্ক্রিন করে দেওয়া হলো */
    .topbar-search-form { max-width: 100%; margin-left: 10px; margin-right: 0; }
    /* মোবাইলে হেডারের নোটিফিকেশন, প্রোফাইল বাটন হাইড করা হলো */
    .topbar-actions { display: none !important; }
}
@media (max-width: 400px) {
    /* একদম ছোট স্ক্রিনে সার্চবারকে জায়গা দেওয়ার জন্য ওয়েবসাইটের নাম হাইড করা হলো */
    .hide-on-small-mobile { display: none; }
}

/* ---------------- 3-column layout (Home page default) ---------------- */
.layout-grid {
    width: 100%; 
    max-width: 100%; /* 100% করে স্ক্রিনের পুরো জায়গা নেওয়া হলো */
    margin: 0; display: grid; grid-template-columns: 1fr;
    gap: 16px; padding: 16px 12px calc(var(--bottom-nav-height) + 16px);
}
@media (min-width: 1000px) {
    .layout-grid {
        /* সাইডবার একটু বড় করে দুইপাশে একদম চাপিয়ে দেওয়া হলো */
        grid-template-columns: 320px minmax(400px, 680px) 340px; 
        justify-content: space-between; 
        gap: 20px; 
        padding: 16px 8px; /* ডানে-বামে প্যাডিং একদম কমিয়ে স্ক্রিনের সাথে লাগানো হয়েছে */
    }
}
.col-left, .col-right { display: none; }
@media (min-width: 1000px) {
    .col-left, .col-right { display: block; }
    .col-left { position: sticky; top: calc(var(--topbar-height) + 16px); align-self: start; }
    .col-right { position: sticky; top: calc(var(--topbar-height) + 16px); align-self: start; }
}



/* ---------------- Cards & Left Menu ---------------- */
.card { background: var(--card-bg); border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 16px; }
.card h3 { font-size: 16px; margin: 0 0 14px; color: var(--text-color); }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--text-color); transition: background 0.2s; }
.menu-list a:hover { background: rgba(0,0,0,0.05); }

/* ---------------- Feed / post card ---------------- */
.post-card { padding: 12px 16px; }
.post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.post-author { font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text-color); }
.post-author:hover { text-decoration: underline; }
.post-meta { font-size: 13px; color: var(--muted-text); }
.badge-govt { background: var(--govt-badge); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 6px; }
.badge-sos { background: var(--danger); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 6px; }

/* See More / Text Truncate Logic */
.post-body { font-size: 15px; line-height: 1.5; margin-bottom: 8px; white-space: pre-line; }
.post-body-truncate { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: all 0.3s ease; }
.post-body-truncate.expanded { -webkit-line-clamp: unset; }
.see-more-btn { background: none; border: none; color: var(--muted-text); font-weight: 600; padding: 0; cursor: pointer; display: none; margin-bottom: 12px; }
.see-more-btn:hover { text-decoration: underline; }

/* Post Image sizing */
.post-image { border-radius: 8px; margin: 0 -16px 12px -16px; width: calc(100% + 32px); max-height: 500px; object-fit: contain; background: #242526; cursor: zoom-in; }

.post-actions { display: flex; border-top: 1px solid var(--border-color); padding-top: 4px; margin-top: 10px; }
.post-actions button, .post-actions a { flex: 1; background: none; border: none; padding: 8px; font-size: 14px; font-weight: 600; color: var(--muted-text); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; border-radius: 6px; transition: background 0.2s; }
.post-actions button:hover, .post-actions a:hover { background: #f0f2f5; }
.post-actions .liked { color: var(--brand-color); }

/* Edit/Delete Dropdown */
.post-options { position: relative; }
.post-options-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted-text); padding: 4px 8px; border-radius: 50%; font-weight: bold; }
.post-options-btn:hover { background: #f0f2f5; }
.post-options-menu { position: absolute; right: 0; top: 100%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); border-radius: 8px; overflow: hidden; display: none; z-index: 10; min-width: 140px; border: 1px solid var(--border-color); }
.post-options-menu.show { display: block; }
.post-options-menu button { width: 100%; text-align: left; padding: 10px 16px; background: none; border: none; font-size: 14px; cursor: pointer; }
.post-options-menu button:hover { background: #f0f2f5; }

/* Emergency Button & Empty State */
.emergency-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; background: var(--danger); color: #fff; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 16px; cursor: pointer; box-shadow: 0 2px 4px rgba(228, 30, 63, 0.3); }
.empty-state { text-align: center; padding: 30px 10px; color: var(--muted-text); font-size: 15px; }

/* Image Lightbox Modal */
.lightbox-overlay { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); text-align: center; cursor: zoom-out; backdrop-filter: blur(5px); }
.lightbox-content { margin: auto; display: block; max-width: 95%; max-height: 90vh; top: 50%; position: relative; transform: translateY(-50%); border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 15px; right: 25px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; }

/* Notification dropdown */
.dropdown-panel { position: absolute; right: 0; top: 50px; width: 320px; max-height: 400px; overflow-y: auto; background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.15); display: none; z-index: 400; border: 1px solid var(--border-color); }
.dropdown-panel.show { display: block; }
.dropdown-item { padding: 12px 16px; border-bottom: 1px solid #f0f2f5; font-size: 14px; transition: background 0.2s; cursor: pointer; }
.dropdown-item:hover { background: #f0f2f5; }

/* ---------------- Bottom nav (Mobile only) ---------------- */
.bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 300; background: #fff; border-top: 1px solid var(--border-color); height: var(--bottom-nav-height); }
@media (min-width: 1000px) { .bottom-nav { display: none; } }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--muted-text); font-size: 11px; gap: 4px; position: relative; font-weight: 500; }
.bottom-nav a .nav-icon { font-size: 22px; }
.bottom-nav a.active { color: var(--brand-color); }
.bottom-nav a .dot { position: absolute; top: 2px; right: 26%; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid #fff; }

/* ---------------- Blood Donor Slider ---------------- */
.donor-slider { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.donor-chip { flex: 0 0 auto; width: 84px; text-align: center; font-size: 12px; }
.donor-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin: 0 auto 6px; }
.donor-chip .blood-group { color: var(--danger); font-weight: 700; }