/* ================================================================
   ZIMLINK — driver-widget.css
   Notification Bell + Dropdown Panel styles for the Driver Portal.
   Pairs with driver-widget.js. Self-contained on purpose (doesn't
   depend on driver.css's --green vars being present, just like
   driver.js works standalone) — every color has a hard fallback.
   ================================================================ */

/* ---------------------------------------------------------------
   Bell icon — sits inside #driverTopbarActions, on the solid green
   topbar, styled to match .driver-logout-btn right next to it.
   --------------------------------------------------------------- */
.nav-bell-wrap {
    position: relative;
    flex-shrink: 0;
}

.nav-bell-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: normal;
    transition: background 0.15s, border-color 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.nav-bell-icon svg { display: block; pointer-events: none; }
.nav-bell-icon:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.55);
}
.nav-bell-icon:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.nav-bell-icon.ringing { animation: driver-bell-ring 0.7s ease-in-out; }

@keyframes driver-bell-ring {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(18deg); }
    30%      { transform: rotate(-16deg); }
    45%      { transform: rotate(12deg); }
    60%      { transform: rotate(-8deg); }
    75%      { transform: rotate(4deg); }
}

.nav-bell-count {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid rgb(37, 189, 37);
}

/* ---------------------------------------------------------------
   Dropdown panel
   --------------------------------------------------------------- */
.notif-panel {
    position: absolute;
    top: 44px;
    right: 0;
    width: 340px;
    max-height: 440px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #eee;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    transform-origin: top right;
}
.notif-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.notif-panel-title {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
}
.notif-panel-mark-read {
    font-size: 12px;
    color: rgb(37, 189, 37);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
}
.notif-panel-mark-read:hover { text-decoration: underline; }
.notif-panel-list {
    overflow-y: auto;
    flex: 1;
}
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
.notif-row {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f6f6f6;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.notif-row:hover { background: #fafafa; }
.notif-row.unread { background: #f3fdf3; }
.notif-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8f9e8;
    color: rgb(37, 189, 37);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}
.notif-row-icon[data-type="new_message"] { background: #eef2ff; color: #6366f1; }
.notif-row-icon[data-type="chat_added"]  { background: #e8f9e8; color: rgb(37, 189, 37); }

.notif-row-body { flex: 1; min-width: 0; }
.notif-row-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}
.notif-row-text {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notif-row-time {
    font-size: 11px;
    color: #aab1bb;
    margin-top: 3px;
}
.notif-row-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(37, 189, 37);
    position: absolute;
    top: 16px;
    right: 14px;
    flex-shrink: 0;
    animation: driver-notif-dot-pulse 1.8s ease-in-out infinite;
}
@keyframes driver-notif-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 189, 37, 0.45); }
    50%      { box-shadow: 0 0 0 4px rgba(37, 189, 37, 0); }
}

/* ---------------------------------------------------------------
   Install / enable-notifications banner — injected at the top of
   the dropdown panel for iOS (manual Add to Home Screen steps) or
   Android/desktop (one-tap install via beforeinstallprompt).
   --------------------------------------------------------------- */
.notif-install-banner {
    background: #f0fdf0;
    border-bottom: 1px solid #dff3df;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.notif-install-text {
    flex: 1 1 100%;
    font-size: 12.5px;
    line-height: 1.4;
    color: #1f6b1f;
}
.notif-install-text strong { color: #145214; }
.notif-install-btn,
.notif-install-dismiss {
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    border: none;
}
.notif-install-btn {
    background: rgb(37, 189, 37);
    color: white;
}
.notif-install-btn:hover { background: rgb(30, 160, 30); }
.notif-install-dismiss {
    background: transparent;
    color: #6b7280;
}
.notif-install-dismiss:hover { text-decoration: underline; }

.notif-panel-list::-webkit-scrollbar { width: 6px; }
.notif-panel-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.notif-panel-list::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
    .notif-panel {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 100px);
        z-index: 99999;
        transform: translateY(-10px);
        transform-origin: top center;
    }
    .notif-panel.open { transform: translateY(0); }
    .nav-bell-icon { width: 30px; height: 30px; }
    .notif-panel-header { padding: 13px 14px; }
    .notif-panel-title { font-size: 13px; }
    .notif-panel-mark-read { font-size: 11px; }
    .notif-row { padding: 12px 14px; gap: 10px; }
    .notif-row-icon { width: 30px; height: 30px; font-size: 12px; }
    .notif-row-title { font-size: 12px; }
    .notif-row-text { font-size: 11.5px; }
    .notif-row-time { font-size: 10px; }
    .notif-install-text { font-size: 11.5px; }
    .notif-install-btn, .notif-install-dismiss { font-size: 11px; padding: 5px 10px; }
}
