/* =========================================================
   MicroWork Platform — Professional UI Theme
   Bootstrap 5 compatible
   ========================================================= */

:root {
    --mw-primary: #4f46e5;
    --mw-primary-dark: #3730a3;
    --mw-primary-soft: #eef2ff;
    --mw-secondary: #64748b;
    --mw-success: #10b981;
    --mw-warning: #f59e0b;
    --mw-danger: #ef4444;
    --mw-info: #0ea5e9;
    --mw-dark: #0f172a;
    --mw-dark-2: #1e293b;
    --mw-surface: #ffffff;
    --mw-bg: #f6f8fc;
    --mw-border: #e7eaf0;
    --mw-text: #172033;
    --mw-muted: #64748b;
    --mw-radius: 16px;
    --mw-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    --mw-shadow-lg: 0 18px 45px rgba(15, 23, 42, .10);
}

html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(circle at 10% -10%, rgba(79,70,229,.07), transparent 28rem),
        radial-gradient(circle at 100% 0%, rgba(14,165,233,.06), transparent 25rem),
        var(--mw-bg);
    color: var(--mw-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5,h6 { color: var(--mw-text); font-weight: 700; letter-spacing: -.02em; }
.text-muted { color: var(--mw-muted) !important; }
.form-text { color: #7b8799; }

/* ---------- Navbar ---------- */
.navbar {
    min-height: 72px;
    background: rgba(255,255,255,.94) !important;
    backdrop-filter: blur(14px);
    border-color: var(--mw-border) !important;
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
}

.navbar-brand {
    color: var(--mw-dark) !important;
    letter-spacing: -.03em;
}

.navbar-brand img { object-fit: contain; }

.navbar .btn-light {
    border: 1px solid var(--mw-border);
    background: #fff;
}

.navbar .dropdown-menu {
    margin-top: 10px;
    border: 1px solid var(--mw-border);
    border-radius: 14px;
    box-shadow: var(--mw-shadow-lg);
    padding: 8px;
}

.dropdown-item {
    border-radius: 10px;
    padding: 9px 12px;
}

.dropdown-item:hover { background: var(--mw-primary-soft); color: var(--mw-primary-dark); }

/* ---------- Sidebar ---------- */
.sidebar {
    min-height: calc(100vh - 72px);
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    box-shadow: 8px 0 30px rgba(15,23,42,.08);
    position: relative;
    z-index: 10;
}

.sidebar .brand {
    color: #fff;
    padding: 8px 10px 18px;
    letter-spacing: -.03em;
}

.sidebar .nav-link {
    color: #aeb9ca;
    border-radius: 11px;
    padding: 11px 13px;
    margin: 2px 0;
    font-weight: 500;
    transition: all .18s ease;
}

.sidebar .nav-link i {
    width: 21px;
    display: inline-block;
    text-align: center;
    opacity: .9;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(79,70,229,.82));
    box-shadow: 0 8px 18px rgba(79,70,229,.25);
}

.sidebar .nav-link.text-danger:hover {
    color: #fecaca !important;
    background: rgba(239,68,68,.12);
}

/* ---------- Main content ---------- */
main {
    min-height: calc(100vh - 72px);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    margin-bottom: 4px;
}

.page-header p { margin-bottom: 0; }

/* ---------- Cards ---------- */
.card,
.stat-card {
    border: 1px solid var(--mw-border) !important;
    border-radius: var(--mw-radius) !important;
    background: rgba(255,255,255,.96);
    box-shadow: var(--mw-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover.stat-card,
.stat-card:hover {
    box-shadow: var(--mw-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mw-border);
    padding: 18px 20px;
    font-weight: 700;
}

.card-body { padding: 20px; }

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    right: -45px;
    top: -45px;
    background: rgba(79,70,229,.06);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--mw-primary-soft);
    color: var(--mw-primary);
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-label {
    color: var(--mw-muted);
    font-size: .82rem;
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: .58rem .95rem;
    transition: all .18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    --bs-btn-bg: var(--mw-primary);
    --bs-btn-border-color: var(--mw-primary);
    --bs-btn-hover-bg: var(--mw-primary-dark);
    --bs-btn-hover-border-color: var(--mw-primary-dark);
    box-shadow: 0 7px 16px rgba(79,70,229,.18);
}

.btn-outline-primary {
    --bs-btn-color: var(--mw-primary);
    --bs-btn-border-color: #c7c9f7;
    --bs-btn-hover-bg: var(--mw-primary);
    --bs-btn-hover-border-color: var(--mw-primary);
}

.btn-success { box-shadow: 0 6px 14px rgba(16,185,129,.15); }
.btn-danger { box-shadow: 0 6px 14px rgba(239,68,68,.12); }

/* ---------- Forms ---------- */
.form-label {
    color: #334155;
    font-size: .86rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    min-height: 44px;
    color: var(--mw-text);
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.form-control { min-height: 110px; }

.form-control:focus,
.form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 .22rem rgba(79,70,229,.11);
}

.input-group-text {
    border-color: #dfe4ec;
    background: #f8fafc;
    color: #64748b;
}

/* ---------- Tables ---------- */
.table-responsive {
    border-radius: 14px;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 13px 14px;
    border-bottom-color: #edf0f5;
}

.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .045em;
    white-space: nowrap;
}

.table tbody tr {
    transition: background .15s ease;
}

.table tbody tr:hover { background: #fafbff; }

/* ---------- Badges ---------- */
.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: .48em .75em;
}

.bg-primary-subtle { background: #eef2ff !important; }
.text-primary { color: var(--mw-primary) !important; }
.bg-success-subtle { background: #ecfdf5 !important; }
.bg-warning-subtle { background: #fffbeb !important; }
.bg-danger-subtle { background: #fef2f2 !important; }
.bg-info-subtle { background: #eff6ff !important; }

/* ---------- Alerts ---------- */
.alert {
    border: 0;
    border-radius: 13px;
    padding: 13px 16px;
}

.alert-success { background: #ecfdf5; color: #047857; }
.alert-danger { background: #fef2f2; color: #b91c1c; }
.alert-warning { background: #fffbeb; color: #b45309; }
.alert-info { background: #eff6ff; color: #0369a1; }

/* ---------- Task cards ---------- */
.task-card {
    height: 100%;
    position: relative;
}

.task-card .task-title {
    font-size: 1.02rem;
    font-weight: 750;
    line-height: 1.35;
}

.task-card .task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--mw-muted);
    font-size: .78rem;
}

.task-card .task-pay {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--mw-success);
}

.task-card .task-footer {
    border-top: 1px solid #edf0f5;
    margin-top: 15px;
    padding-top: 14px;
}

/* ---------- Wallet ---------- */
.wallet-hero {
    color: #fff;
    border: 0 !important;
    background:
        radial-gradient(circle at 90% 15%, rgba(255,255,255,.20), transparent 18%),
        linear-gradient(135deg, #4f46e5, #312e81);
    box-shadow: 0 18px 38px rgba(49,46,129,.22);
}

.wallet-hero .wallet-balance {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 850;
    letter-spacing: -.04em;
}

/* ---------- Empty states ---------- */
.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--mw-muted);
}

.empty-state .empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 28px;
}

/* ---------- Pagination ---------- */
.pagination .page-link {
    border: 0;
    margin: 0 3px;
    border-radius: 9px !important;
    color: #475569;
}

.pagination .page-item.active .page-link {
    background: var(--mw-primary);
    color: #fff;
}

/* ---------- Modal ---------- */
.modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(15,23,42,.18);
}

.modal-header { border-bottom-color: #edf0f5; }
.modal-footer { border-top-color: #edf0f5; }

/* ---------- Progress ---------- */
.progress {
    height: 8px;
    border-radius: 999px;
    background: #edf0f5;
}

.progress-bar { border-radius: 999px; }

/* ---------- Login/Register pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at 15% 20%, rgba(79,70,229,.13), transparent 24rem),
        radial-gradient(circle at 85% 80%, rgba(14,165,233,.10), transparent 24rem),
        #f8fafc;
}

.auth-shell {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--mw-border);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(15,23,42,.10);
}

.auth-brand {
    padding: 50px;
    color: #fff;
    background: linear-gradient(145deg, #312e81, #4f46e5 55%, #0ea5e9);
}

.auth-form { padding: 45px; }

@media (max-width: 767.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: 32px; }
    .auth-form { padding: 30px 22px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { min-height: 100%; }
    main { min-height: calc(100vh - 72px); }
}

@media (max-width: 575.98px) {
    body { font-size: 13px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .card-body { padding: 16px; }
    .stat-value { font-size: 1.45rem; }
    .navbar { min-height: 64px; }
}

/* ---------- Utility ---------- */
.hover-lift { transition: transform .18s ease, box-shadow .18s ease; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--mw-shadow-lg); }

.copy-referral {
    cursor: pointer;
    user-select: all;
}

.sticky-action {
    position: sticky;
    bottom: 16px;
    z-index: 20;
}

.loading {
    opacity: .65;
    pointer-events: none;
}

.fade-in {
    animation: mwFadeIn .35s ease both;
}

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

/* =========================================================
   UNREAD NOTIFICATION INDICATOR
   ========================================================= */

.notification-nav-link {
    position: relative;
    display: flex;
    align-items: center;
}


/* Bell + red dot container */
.notification-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    min-width: 21px;
}


/* Small blinking red light */
.notification-pulse-dot {
    position: absolute;

    top: -3px;
    right: 0px;

    width: 8px;
    height: 8px;

    background: #ef4444;

    border-radius: 50%;

    border: 2px solid #111827;

    box-sizing: content-box;

    animation: notificationPulse 1.3s infinite;
}


/* Number badge */
.notification-count-badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 6px;

    margin-left: auto;

    border-radius: 999px;

    background: #ef4444;

    color: #fff;

    font-size: 11px;

    font-weight: 700;

    line-height: 1;

    box-shadow: 0 3px 8px rgba(239, 68, 68, .25);
}


/* Blinking / pulsing animation */
@keyframes notificationPulse {

    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, .65);
    }

    50% {
        transform: scale(1.25);
        opacity: .65;
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

}


/* Mobile sidebar */
@media (max-width: 991.98px) {

    .notification-pulse-dot {
        top: -3px;
        right: 0;
    }

    .notification-count-badge {
        margin-left: auto;
    }

}
