/* iNeed — app.css — Mobile-first responsive */

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #F8FAFC;
    color: #1E293B;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }

/* ── Navbar ── */
.myneed-navbar {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    padding: 10px 0;
    position: relative;
    z-index: 100;
}

/* ── MOBILE MENU FIX ── */
@media (max-width: 767.98px) {
    .myneed-navbar { position: relative; z-index: 1030; }
    /* Target Bootstrap collapse when open */
    #mainNav.show,
    #mainNav.collapsing {
        background: #ffffff !important;
        border-top: 1px solid #E2E8F0;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 12px 32px rgba(0,0,0,0.14);
        padding: 10px 14px 16px;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        z-index: 1050;
    }
    #mainNav .nav-link {
        padding: 11px 14px !important;
        border-radius: 10px;
        color: #1E293B !important;
        font-size: 15px;
    }
    #mainNav .nav-link:hover { background: #F1F5F9; }
    #mainNav .nav-link.active { background: #EFF6FF; color: #1E40AF !important; }
    #mainNav .btn { width: 100%; justify-content: center; margin-top: 6px; }
    #mainNav .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        background: #F8FAFC;
        border-radius: 10px;
        box-shadow: none;
        margin: 4px 0;
        padding: 6px;
    }
    #mainNav .dropdown-item {
        border-radius: 8px;
        padding: 10px 14px;
        font-size: 14px;
    }
    /* Fix notification dropdown on mobile */
    .notif-dropdown {
        position: fixed !important;
        left: 10px !important; right: 10px !important;
        top: 64px !important;
        transform: none !important;
        width: auto !important;
        max-height: 65vh;
        overflow-y: auto;
    }
}

/* ── Cards ── */
.mn-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
}

/* ── Need Cards ── */
.need-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1E293B;
}
.need-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
    color: #1E293B;
    text-decoration: none;
}
.need-card-img { width: 100%; height: 180px; object-fit: cover; }
@media (max-width: 576px) { .need-card-img { height: 155px; } }

.need-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: #64748B;
    background: #F1F5F9;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s;
    text-decoration: none;
}
.btn-whatsapp:hover { background: #1DB954; }

@media (max-width: 576px) {
    .btn-whatsapp { width: 100%; justify-content: center; }
}

/* ── Auth pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, #EFF6FF, #F8FAFC);
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 24px rgba(0,0,0,.09);
    padding: clamp(24px, 6vw, 40px);
    width: 100%;
    max-width: 440px;
}

/* ── Status badges ── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status-active   { background: #DCFCE7; color: #15803D; }
.status-pending  { background: #FEF3C7; color: #B45309; }
.status-rejected { background: #FEE2E2; color: #B91C1C; }
.status-expired  { background: #F3F4F6; color: #6B7280; }
.status-deleted  { background: #F3F4F6; color: #9CA3AF; }

/* ── Buttons ── */
.btn { border-radius: 9px; font-weight: 600; transition: all .15s; }
.btn-primary { background: #1E40AF; border-color: #1E40AF; }
.btn-primary:hover { background: #1E3A8A; border-color: #1E3A8A; }
.btn-xs { font-size: 12px; padding: 3px 10px; border-radius: 6px; min-height: 28px; }

/* ── Forms ── */
.form-control, .form-select {
    border-radius: 9px;
    border-color: #E2E8F0;
    font-size: 14.5px;
    padding: 10px 14px;
    min-height: 44px;
}
.form-control:focus, .form-select:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }

/* ── Dashboard stat cards ── */
.stat-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: #94A3B8; margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 576px) {
    .stat-card { padding: 12px; gap: 10px; }
    .stat-value { font-size: 1.2rem; }
    .stat-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* ── Notification dropdown ── */
.notif-dropdown {
    width: 340px;
    max-height: 480px;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    overflow: hidden;
}
.notif-list { overflow-y: auto; max-height: 360px; }
.notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background .1s;
}
.notif-item:hover { background: #F8FAFC; }
.notif-item.unread { background: #EFF6FF; }
.notif-badge {
    font-size: 10px; top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ── Admin layout ── */
.admin-topbar {
    background: #1E293B;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky; top: 0;
    z-index: 200;
}
.admin-page-header {
    padding: 20px 20px 14px;
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    border-bottom: 1px solid #E2E8F0;
    background: #fff;
}
.admin-page-header h1 { font-size: clamp(1.1rem,3vw,1.4rem); margin: 0; }
.admin-content { padding: clamp(14px,2.5vw,24px); }

/* Admin table */
.admin-table {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
}
.admin-table .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-table table { white-space: nowrap; font-size: 13.5px; }
.admin-table thead th {
    font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: #94A3B8; background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 10px 14px; white-space: nowrap;
}
.admin-table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #F8FAFC; }

/* Admin stat responsive */
@media (max-width: 576px) {
    .admin-content { padding: 12px; }
    .admin-page-header { padding: 14px 12px 10px; }
    .admin-table table { font-size: 12.5px; }
}

/* Tree items */
.tree-item {
    border-bottom: 1px solid #F1F5F9;
    padding: 8px 0;
    min-height: 44px;
}

/* ── Empty state ── */
.empty-state {
    text-align: center; padding: 48px 24px; color: #94A3B8;
}
.empty-icon { font-size: 3rem; opacity: .3; display: block; margin: 0 auto 16px; }
.empty-state h5 { color: #64748B; margin-bottom: 8px; }
.empty-state p  { font-size: 14px; margin: 0; }

/* ── Footer ── */
.myneed-footer { background: #fff; border-top: 1px solid #E2E8F0; margin-top: auto; font-size: 14px; }

/* ── Plans ── */
.plan-price { font-size: 2rem; font-weight: 800; color: #1E40AF; line-height: 1; }

/* ── Image preview ── */
.img-preview-wrap {
    position: relative; border-radius: 10px;
    overflow: hidden; border: 1.5px solid #E2E8F0;
}
.img-preview-wrap img { width: 100%; height: 160px; object-fit: cover; }
.img-remove {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,.6); color: #fff;
    border: none; border-radius: 50%;
    width: 24px; height: 24px; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── Drop zone ── */
.drop-zone {
    border: 2px dashed #E2E8F0; border-radius: 12px;
    padding: 32px 20px; text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s; background: #F8FAFC;
}
.drop-zone:hover { border-color: #3B82F6; background: #EFF6FF; }
.drop-icon { font-size: 2.5rem; color: #94A3B8; display: block; margin-bottom: 10px; }

/* ── Pagination ── */
.pagination .page-link {
    border-radius: 8px; margin: 0 2px;
    min-width: 36px; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13.5px;
    border-color: #E2E8F0; color: #1E293B;
}
.pagination .page-item.active .page-link { background: #1E40AF; border-color: #1E40AF; }

/* ── Char counter ── */
.char-counter { font-size: 12px; color: #94A3B8; }

/* ── Utilities ── */
.min-w-0 { min-width: 0; }
.font-monospace { font-family: 'Courier New', monospace; }

/* ── Responsive containers ── */
@media (max-width: 576px) {
    .container { padding-left: 14px; padding-right: 14px; }
    h1 { font-size: 1.35rem; }
    .btn { font-size: 14px; }
    .row.g-3 { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }
    .mn-card { border-radius: 10px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 10px; }
