:root {
    --primary: #2D63A3;
    --secondary: #DF3B39;
    --light: #F8F8F7;
    --dark: #212237;
    --success: #3ECF8E;
    --warning: #ffc107;
    --danger: #FF4B55;
    --info: #17a2b8;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --shadow-1: 0 4px 24px 0 rgba(45, 99, 163, 0.12);
    --shadow-2: 0 8px 32px 0 rgba(45, 99, 163, 0.20);
    --radius-card: 16px;
    --radius-btn: 8px;
    --radius-avatar: 50%;
}
.dark-mode {
    --primary: #3A7BB0;
    --secondary: #E64C4A;
    --light: #1a1a2e;
    --dark: #f0f0f0;
    --success: #4ed999;
    --warning: #ffd54f;
    --danger: #ff6b6b;
    --info: #4fc3f7;
    --gray: #a0a0a0;
    --light-gray: #2d2d44;
    --shadow-1: 0 4px 24px 0 rgba(0,0,0,0.3);
    --shadow-2: 0 8px 32px 0 rgba(0,0,0,0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}
body { background: linear-gradient(120deg, #e0e7ff 0%, #fff 100%); color: var(--dark); line-height: 1.6; overflow-x: hidden; transition: all 0.3s ease;}
.dark-mode body {
    background: linear-gradient(120deg, #0f0f23 0%, #1a1a2e 100%);
    color: var(--dark);
}
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 18px;}
header { background: rgba(255,255,255,0.98); box-shadow: var(--shadow-1); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--light-gray); transition: all 0.3s ease;}
.dark-mode header {
    background: rgba(37, 37, 64, 0.98);
    border-bottom: 1px solid #3d3d5c;
}
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 0;}
.logo-img { height: 120px; width: auto; display: block; margin-right: 10px; filter: drop-shadow(0 3px 8px #b6c2ff44);}
.logo-container { display: flex; align-items: center; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.7rem; color: var(--primary); cursor: pointer;}
.user-actions { display: flex; align-items: center; gap: 22px;}
.role-switch { display: flex; background: #f1f4fa; border-radius: 40px; padding: 5px 6px; box-shadow: 0 2px 8px #cfd8ff22;}
.dark-mode .role-switch {
    background: #2d2d44;
}
.role-btn { 
    padding: 10px 22px; border: none; border-radius: 24px; background: transparent; font-weight: 600; cursor: pointer; 
    transition: all 0.2s cubic-bezier(.68,-0.55,.27,1.55); white-space: nowrap; font-size: 1.01rem; color: var(--gray);
}
.role-btn.active {
    background: linear-gradient(90deg, var(--primary) 70%, #3A7BB0 100%);
    color: #fff; box-shadow: 0 2px 8px #7e9eff44;
    transform: scale(1.07);
}
.user-profile { display: flex; align-items: center; gap: 12px;}
.avatar {
    width: 48px; height: 48px; border-radius: var(--radius-avatar); background: linear-gradient(135deg, #2D63A3 60%, #3A7BB0 100%);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; box-shadow: 0 4px 18px #b6c2ff22;
    border: 2px solid #fff;
}
.btn {
    padding: 11px 20px; border-radius: var(--radius-btn); font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; font-size: 1rem;
    letter-spacing: .02em;
}
.btn-primary {
    background: linear-gradient(90deg, var(--primary) 70%, #3A7BB0 100%);
    color: white; box-shadow: 0 2px 12px #7e9eff22; border: 1px solid #2D63A333;
}
.btn-primary:hover { background: linear-gradient(90deg, #204d7a 80%, #2d63a3 100%);}
.btn-success { background: var(--success); color: white; border: 1px solid #30b770;}
.btn-success:hover { background: #25a86a;}
.btn-outline { background-color: transparent; border: 2px solid var(--primary); color: var(--primary);}
.btn-outline:hover { background: var(--primary); color: #fff;}
.dashboard { display: flex; margin-top: 35px; gap: 36px;}
.sidebar {
    width: 252px; background: #fff; border-radius: var(--radius-card); padding: 26px; box-shadow: var(--shadow-1);
    height: fit-content; transition: transform 0.3s cubic-bezier(.77,0,.18,1.13), box-shadow 0.2s;
    border: 1.5px solid #e7ebff;
}
.dark-mode .sidebar {
    background: #252540;
    border: 1.5px solid #3d3d5c;
}
.sidebar-section { margin-bottom: 32px;}
.sidebar-section h3 { font-size: 1.06rem; margin-bottom: 18px; color: var(--primary); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;}
.sidebar-menu { list-style: none;}
.sidebar-menu li { margin-bottom: 13px;}
.sidebar-menu a {
    display: flex; align-items: center; gap: 13px; padding: 11px 14px; text-decoration: none; color: var(--dark); border-radius: 7px;
    transition: all 0.2s cubic-bezier(.68,-0.55,.27,1.55); font-weight: 500; font-size: 1.04rem;
}
.dark-mode .sidebar-menu a {
    color: var(--dark);
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: linear-gradient(90deg, #e5eaff 60%, #f5f7ff 100%);
    color: var(--primary); font-weight: 700;
    box-shadow: 0 2px 8px #b6c2ff22;
    transform: scale(1.03);
}
.dark-mode .sidebar-menu a:hover, 
.dark-mode .sidebar-menu a.active {
    background: linear-gradient(90deg, #2d3560 60%, #252540 100%);
}
.sidebar-menu i { width: 22px; text-align: center;}
.main-content { flex: 1; width: 100%;}
.dashboard-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 18px;
    padding-bottom: 8px; border-bottom: 1px solid #e7ebff;
}
.dark-mode .dashboard-header {
    border-bottom: 1px solid #3d3d5c;
}
.dashboard-header h1 {
    font-size: 2.1rem; color: var(--primary); font-weight: 800; letter-spacing: .02em;
    background: linear-gradient(90deg, var(--primary) 70%, #3A7BB0 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 18px; margin-bottom: 36px;
}
.stat-card {
    background: linear-gradient(135deg, #e9f0ff 60%, #f8faff 100%);
    border-radius: var(--radius-card); padding: 26px 20px;
    box-shadow: 0 2px 12px #b6c2ff11;
    text-align: center; border: 1.5px solid #e7ebff;
    position: relative; overflow: hidden;
}
.dark-mode .stat-card {
    background: linear-gradient(135deg, #2d2d44 60%, #252540 100%);
    border: 1.5px solid #3d3d5c;
}
.stat-card::before {
    content: "";
    position: absolute; right: -32px; top: -32px;
    width: 80px; height: 80px;
    background: radial-gradient(circle, #2D63A311 0%, transparent 75%);
    z-index: 0;
}
.stat-card i { font-size: 2.5rem; margin-bottom: 10px; color: var(--primary); z-index: 1; position: relative;}
.stat-card h3 { font-size: 2.1rem; margin-bottom: 6px; font-weight: 700; letter-spacing: 0.01em;}
.stat-card p { color: var(--gray); font-size: 1rem;}
.filters {
    background: #fff; border-radius: var(--radius-card); padding: 22px 22px 10px 22px; margin-bottom: 28px;
    box-shadow: 0 2px 10px #a3a6ff11; border: 1.2px solid #e7ebff;
}
.dark-mode .filters {
    background: #252540;
    border: 1.2px solid #3d3d5c;
}
.filter-row { display: flex; gap: 18px; flex-wrap: wrap;}
.filter-group { flex: 1; min-width: 155px;}
.filter-group label { display: block; margin-bottom: 7px; font-weight: 600; color: var(--primary); font-size: 1.01rem;}
.filter-select {
    width: 100%; padding: 11px 10px; border: 1.5px solid #d5dbff; border-radius: 7px;
    font-size: 1rem; background: #f7faff; color: var(--dark); transition: border 0.2s;
}
.dark-mode .filter-select {
    background: #2d2d44;
    border: 1.5px solid #3d3d5c;
    color: var(--dark);
}
.filter-select:focus { border-color: var(--primary); outline: none;}
.job-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 23px;
}
.job-card {
    background: #fff; border-radius: var(--radius-card); padding: 24px 20px 18px 20px; box-shadow: var(--shadow-1); position: relative; transition: transform 0.2s, box-shadow 0.2s;
    border: 1.1px solid #e7ebff;
    overflow: hidden;
}
.dark-mode .job-card {
    background: #252540;
    border: 1.1px solid #3d3d5c;
}
.job-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-2);
    border-color: #b6c2ff;
}
.job-card.emergency {
    border-left: 7px solid var(--danger);
    background: linear-gradient(90deg, #fff 85%, #ffeaea 100%);
}
.dark-mode .job-card.emergency {
    background: linear-gradient(90deg, #252540 85%, #3d2d2d 100%);
}
.job-card h3 { margin-bottom: 12px; color: var(--dark); font-size: 1.17rem; font-weight: 700; line-height: 1.3;}
.job-meta {
    display: flex; justify-content: space-between; margin-bottom: 11px; font-size: 1rem; color: var(--gray); flex-wrap: wrap; gap: 7px;
}
.job-price {
    font-weight: 700; color: var(--success); font-size: 1.19rem; margin: 12px 0 7px 0; letter-spacing: 0.01em;
    background: linear-gradient(90deg, #eafff5 60%, #fff 100%);
    border-radius: 6px; padding: 4px 0;
}
.dark-mode .job-price {
    background: linear-gradient(90deg, #1a3d2d 60%, #252540 100%);
}
.job-description {
    margin-bottom: 16px; font-size: 1.01rem; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #324;
}
.dark-mode .job-description {
    color: var(--dark);
}
.job-tags {
    display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px;
}
.job-tag {
    background: linear-gradient(90deg, #e7eaff 60%, #f7faff 100%);
    padding: 5px 13px; border-radius: 15px; font-size: 0.93rem;
    color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px #b6c2ff12;
}
.dark-mode .job-tag {
    background: linear-gradient(90deg, #2d3560 60%, #252540 100%);
}
.emergency-badge {
    background: linear-gradient(90deg, var(--danger) 70%, #ffb8b6 100%);
    color: white; padding: 4px 10px; border-radius: 7px; font-size: 0.92rem; position: absolute; top: 15px; right: 15px;
    font-weight: 800; letter-spacing: 0.04em; box-shadow: 0 1px 8px #ff4b5533;
}
.job-actions { display: flex; gap: 12px;}
.job-actions .btn { flex: 1; text-align: center; padding: 10px 0; font-size: 0.97rem; }
.requester-view .create-job-btn { display: flex; align-items: center; gap: 12px; margin-bottom: 22px;}
.helper-view .job-card .btn { width: 100%;}
.auth-container {
    display: flex; min-height: 100vh; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2D63A3 60%, #3A7BB0 100%);
    padding: 22px;
}
.auth-card {
    background: #fff; border-radius: 18px; box-shadow: var(--shadow-2); width: 100%; max-width: 420px; padding: 36px 36px 28px 36px;
    border: 1.2px solid #e7ebff;
}
.dark-mode .auth-card {
    background: #252540;
    border: 1.2px solid #3d3d5c;
}
.auth-tabs { display: flex; margin-bottom: 30px; border-bottom: 1.5px solid var(--light-gray);}
.auth-tab {
    flex: 1; text-align: center; padding: 13px 0; cursor: pointer; font-weight: 700; border-bottom: 3px solid transparent;
    font-size: 1.1rem; color: var(--gray); letter-spacing: 0.01em;
}
.auth-tab.active { border-bottom: 3px solid var(--primary); color: var(--primary);}
.auth-form { display: none;}
.auth-form.active { display: block;}
.form-group { margin-bottom: 22px;}
.form-group label { display: block; margin-bottom: 7px; font-weight: 600; color: var(--primary);}
.form-control {
    width: 100%; padding: 14px 12px; border: 1.5px solid #d5dbff; border-radius: 7px; font-size: 1.01rem; background: #f7faff; color: var(--dark);
    transition: border 0.2s;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: #333;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}
.dark-mode .form-control {
    background: #2d2d44;
    border: 1.5px solid #3d3d5c;
    color: var(--dark);
}
.form-control:focus { border-color: var(--primary); outline: none;}
textarea.form-control { min-height: 100px; resize: vertical;}
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.97rem; color: var(--gray);}
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600;}
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,20,60,0.08);
    z-index: 1000; align-items: center; justify-content: center; overflow-y: auto; padding: 22px;
    backdrop-filter: blur(2.5px);
}
.modal-content {
    background: #fff; border-radius: var(--radius-card); width: 95%; max-width: 640px; padding: 38px 36px 24px 36px;
    position: relative; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-2);
    border: 1.2px solid #e7ebff;
}
.dark-mode .modal-content {
    background: #252540;
    border: 1.2px solid #3d3d5c;
}
.close-modal {
    position: absolute; top: 16px; right: 16px; font-size: 1.6rem; cursor: pointer; z-index: 10; color: var(--gray);
    background: #f7faff; border-radius: 50%; padding: 3px 11px; transition: background 0.2s;
}
.dark-mode .close-modal {
    background: #2d2d44;
}
.close-modal:hover { background: #eee; color: var(--danger);}
.modal-header { margin-bottom: 24px; padding-bottom: 13px; border-bottom: 1px solid var(--light-gray);}
.modal-body { margin-bottom: 22px;}
.modal-footer {
    display: flex; justify-content: flex-end; gap: 13px; padding-top: 19px; border-top: 1px solid var(--light-gray); flex-wrap: wrap;
}
.job-detail-item { margin-bottom: 18px;}
.job-detail-item label { font-weight: 700; color: var(--primary); display: block; margin-bottom: 5px;}
.job-detail-item p { font-size: 1.04rem; color: #212237;}
.dark-mode .job-detail-item p {
    color: var(--dark);
}
.loading-backdrop {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(45, 99, 163, .11);
    z-index: 2000; align-items: center; justify-content: center;
}
.loading-spinner {
    border: 7px solid #f3f3f3;
    border-top: 7px solid var(--primary);
    border-radius: 50%;
    width: 74px; height: 74px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.topup-methods {
    display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.topup-method {
    cursor: pointer; background: var(--light-gray); border-radius: 9px; padding: 13px 21px; display: flex; align-items: center; gap: 13px;
    border: 2.5px solid transparent; transition: border .2s, background .2s; min-width: 120px; font-weight: 600; color: var(--primary); font-size: 1.03rem;
    box-shadow: 0 1px 5px #b6c2ff11;
}
.topup-method.selected, .topup-method:hover { border: 2.5px solid var(--primary); background: #e4ebff;}
.topup-method img { width: 36px; height: 36px; object-fit: contain;}
.topup-va-list { margin-top: 9px; }
.topup-va-list select { padding: 9px; border-radius: 5px; border: 1.5px solid #b6c2ff;}
.page { display: none;}
.page.active { display: block;}
.empty-state {
    text-align: center; padding: 45px 24px; background: linear-gradient(120deg, #f9faff 60%, #e9f0ff 100%);
    border-radius: var(--radius-card); box-shadow: 0 2px 10px #b6c2ff11; border: 1.2px solid #e7ebff;
}
.dark-mode .empty-state {
    background: linear-gradient(120deg, #2d2d44 60%, #252540 100%);
    border: 1.2px solid #3d3d5c;
}
.empty-state i { font-size: 3.2rem; color: var(--light-gray); margin-bottom: 18px;}
.empty-state h3 { margin-bottom: 13px; color: var(--primary);}
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(40,60,99,0.13); z-index: 99;}
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff;
    box-shadow: 0 -3px 18px #b6c2ff26; z-index: 90; padding: 12px 0 10px 0; border-top: 1.2px solid #e7ebff;
}
.dark-mode .bottom-nav {
    background: #252540;
    border-top: 1.2px solid #3d3d5c;
}
.bottom-nav-items { display: flex; justify-content: space-around; align-items: center;}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--gray); font-size: 0.93rem;
    padding: 5px 11px; border-radius: 9px; transition: all 0.2s; font-weight: 600;
}
.bottom-nav-item.active { color: var(--primary); background: #f3f5ff;}
.dark-mode .bottom-nav-item.active {
    background: #2d3560;
}
.bottom-nav-item i { font-size: 1.28rem; margin-bottom: 4px;}
.tabbed-section { margin-bottom: 28px;}
.tabbed-menu {
    display: flex; background: var(--light-gray); border-radius: 10px; margin-bottom: 22px; overflow: hidden; box-shadow: 0 1px 4px #b6c2ff11;
}
.tabbed-btn {
    flex: 1; padding: 12px 0; border: none; background: none; font-weight: 700; color: var(--gray); cursor: pointer; transition: all 0.2s;
    font-size: 1.07rem; border-bottom: 2.5px solid transparent;
}
.tabbed-btn.active {
    background: linear-gradient(90deg, var(--primary) 70%, #3A7BB0 100%);
    color: #fff; border-bottom: 2.5px solid var(--primary); box-shadow: 0 2px 8px #7e9eff22;
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}
.notification-icon {
    position: relative;
    cursor: pointer;
}
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-2);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.dark-mode .notification-dropdown {
    background: #252540;
}
.notification-item {
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: background 0.2s;
}
.dark-mode .notification-item {
    border-bottom: 1px solid #3d3d5c;
}
.notification-item:hover {
    background: var(--light);
}
.dark-mode .notification-item:hover {
    background: #2d2d44;
}
.notification-item.unread {
    background: #f0f7ff;
}
.dark-mode .notification-item.unread {
    background: #1a2d3d;
}
.notification-item .time {
    font-size: 0.8rem;
    color: var(--gray);
}
.map-container {
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
}
.rating-stars {
    color: #ffc107;
    margin: 5px 0;
}
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.rating-input input {
    display: none;
}
.rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.2s;
}
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #ffc107;
}
.search-box {
    position: relative;
    margin-bottom: 20px;
}
.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #d5dbff;
    border-radius: 8px;
    font-size: 1rem;
}
.dark-mode .search-box input {
    background: #2d2d44;
    border: 1px solid #3d3d5c;
    color: var(--dark);
}
.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}
.analytics-chart {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.dark-mode .analytics-chart {
    background: #252540;
}
.verification-badge {
    display: inline-flex;
    align-items: center;
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 5px;
}
.favorite-btn {
    background: none;
    border: none;
    color: #ddd;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}
.favorite-btn.active {
    color: #ff6b6b;
}
.referral-code {
    background: linear-gradient(135deg, #e9f0ff 60%, #f8faff 100%);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
}
.dark-mode .referral-code {
    background: linear-gradient(135deg, #2d2d44 60%, #252540 100%);
}
.referral-code .code {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 10px 0;
}
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 100;
}
.schedule-reminder {
    background: linear-gradient(135deg, #fff9e6 60%, #fff 100%);
    border-left: 4px solid var(--warning);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}
.dark-mode .schedule-reminder {
    background: linear-gradient(135deg, #2d2a1a 60%, #252540 100%);
}
/* NEW: Service Categories */
.service-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin: 20px 0 30px;
}
.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    border: 1px solid #e7ebff;
}
.dark-mode .service-card {
    background: #252540;
    border: 1px solid #3d3d5c;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.service-card i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.service-card span {
    font-size: 0.95rem;
    font-weight: 600;
}
/* NEW: Chat Interface */
.chat-container {
    display: flex;
    height: 500px;
    border: 1px solid #e7ebff;
    border-radius: var(--radius-card);
    overflow: hidden;
}
.dark-mode .chat-container {
    border: 1px solid #3d3d5c;
}
.chat-sidebar {
    width: 250px;
    background: #f8f9fa;
    overflow-y: auto;
}
.dark-mode .chat-sidebar {
    background: #252540;
}
.chat-list-item {
    padding: 14px;
    border-bottom: 1px solid #e7ebff;
    cursor: pointer;
}
.dark-mode .chat-list-item {
    border-bottom: 1px solid #3d3d5c;
}
.chat-list-item.active, .chat-list-item:hover {
    background: #eef2ff;
}
.dark-mode .chat-list-item.active,
.dark-mode .chat-list-item:hover {
    background: #2d3560;
}
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.dark-mode .chat-main {
    background: #1a1a2e;
}
.chat-header {
    padding: 16px;
    border-bottom: 1px solid #e7ebff;
    font-weight: 600;
}
.dark-mode .chat-header {
    border-bottom: 1px solid #3d3d5c;
}
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.message {
    max-width: 70%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    word-wrap: break-word;
}
.message.received {
    background: #e9ecef;
    align-self: flex-start;
    border-top-left-radius: 4px;
}
.message.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 4px;
}
.chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e7ebff;
}
.dark-mode .chat-input-area {
    border-top: 1px solid #3d3d5c;
}
.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d5dbff;
    border-radius: 24px;
    margin-right: 10px;
}
.dark-mode .chat-input {
    background: #2d2d44;
    border: 1px solid #3d3d5c;
    color: var(--dark);
}
.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
/* NEW: Profile Completion */
.profile-completion {
    background: linear-gradient(135deg, #f0f9ff 60%, #e6f7ff 100%);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #cceaff;
}
.dark-mode .profile-completion {
    background: linear-gradient(135deg, #1a2d3d 60%, #1a1a2e 100%);
    border: 1px solid #3d3d5c;
}
.profile-completion-bar {
    height: 8px;
    background: #e0e7ff;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}
.profile-completion-fill {
    height: 100%;
    background: var(--success);
    width: 75%;
}
/* Responsive Design */
@media (max-width: 1160px) {
    .dashboard { gap: 22px;}
    .sidebar { padding: 16px;}
    .main-content { padding-left: 0;}
}
@media (max-width: 992px) {
    .dashboard { flex-direction: column; gap: 22px;}
    .sidebar {
        width: 100%; position: fixed; top: 76px; left: 0; height: calc(100vh - 76px); z-index: 100; overflow-y: auto; transform: translateX(-100%);
        box-shadow: var(--shadow-2); border-radius: 0 16px 16px 0;
    }
    .sidebar.mobile-visible { transform: translateX(0);}
    .main-content { margin-left: 0;}
    .mobile-menu-btn { display: block;}
    .user-profile span { display: none;}
    .notification-dropdown {
        width: 280px;
        right: -50px;
    }
}
@media (max-width: 768px) {
    .navbar { padding: 11px 0;}
    .user-actions { gap: 13px;}
    .role-switch { padding: 4px;}
    .role-btn { padding: 7px 13px; font-size: 0.92rem;}
    .dashboard { margin-top: 17px;}
    .dashboard-header { flex-direction: column; align-items: flex-start;}
    .dashboard-header h1 { font-size: 1.4rem;}
    .stats-cards { grid-template-columns: 1fr 1fr; gap: 10px;}
    .stat-card { padding: 14px;}
    .stat-card i { font-size: 1.3rem;}
    .stat-card h3 { font-size: 1.3rem;}
    .filters { padding: 13px;}
    .filter-row { gap: 8px;}
    .filter-group { min-width: 110px;}
    .job-list { grid-template-columns: 1fr; gap: 13px;}
    .job-card { padding: 13px;}
    .job-actions { flex-direction: column;}
    .bottom-nav { display: block;}
    .modal-content { padding: 18px;}
    .modal-footer { flex-direction: column;}
    .modal-footer .btn { width: 100%; margin-bottom: 11px;}
    .logo-img { height: 54px;}
    .auth-card { padding: 17px;}
    .notification-dropdown {
        width: 250px;
        right: -80px;
    }
    .chat-container {
        height: 400px;
    }
    .chat-sidebar {
        width: 100px;
    }
    .service-categories {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 520px) {
    .container { padding: 0 7px;}
    .logo-img { height: 37px;}
    .stats-cards { grid-template-columns: 1fr;}
    .role-switch { flex-direction: column; background: transparent; gap: 5px;}
    .role-btn { border-radius: 6px; background: #f3f5ff;}
    .user-actions { flex-direction: column; align-items: flex-end; gap: 7px;}
    .auth-card { padding: 10px;}
    .job-meta { flex-direction: column;}
    .sidebar { padding: 5px;}
    .dashboard-header { padding-bottom: 4px;}
    .notification-dropdown {
        width: 200px;
        right: -100px;
    }
    .service-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Chat Input Enable/Disable */
.chat-input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.dark-mode .chat-input:disabled {
    background: #1a1a2e;
    color: #666;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Unread badge di chat list */
.chat-list-item {
    position: relative;
}

.chat-list-item .notification-badge {
    position: static;
    display: inline-flex;
    margin-left: 5px;
}

/* Message time */
.message .time {
    font-size: 0.7rem;
    margin-top: 3px;
    opacity: 0.7;
}

/* Read receipt */
.message.sent .read-receipt {
    font-size: 0.7rem;
    margin-left: 5px;
}

/* New message indicator */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.new-message-indicator {
    animation: pulse 1s infinite;
}

/* Perbaikan Bubble Chat */
.chat-messages {
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    clear: both;
}

/* Pesan dari requester (diterima oleh helper) atau sebaliknya */
.message.received {
    background: #e9ecef;
    color: #212237;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    margin-right: auto;
    border: 1px solid #dee2e6;
}

/* Pesan dari helper (dikirim) atau dari requester ke helper */
.message.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    border: 1px solid #2D63A3;
}

/* Dark mode */
.dark-mode .chat-messages {
    background: #1a1a2e;
}

.dark-mode .message.received {
    background: #2d2d44;
    color: #f0f0f0;
    border-color: #3d3d5c;
}

.dark-mode .message.sent {
    background: #3A7BB0;
    border-color: #4d8cd4;
}

/* Timestamp dalam pesan */
.message .message-time {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
}

.message.sent .message-time {
    color: #eee;
    text-align: right;
}

.message.received .message-time {
    color: var(--gray);
    text-align: left;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.btn-success {
    background: #3ECF8E;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #25a86a;
    transform: scale(1.02);
}

.btn-success:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.btn-close-qris:hover {
    background: var(--light-gray);
}

/* OpenStreetMap Modal Styles */
.btn-close-osm:hover {
    background: var(--light-gray);
}

#osmMapContainer {
    z-index: 1;
}

.leaflet-container {
    z-index: 1;
}

/* Location preview */
#locationPreview {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OSM Map Modal */
.osm-map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.osm-map-modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2);
}

.dark-mode .osm-map-modal-content {
    background: #252540;
    border: 1px solid #3d3d5c;
}

.osm-map-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, white);
}

.dark-mode .osm-map-modal-header {
    background: linear-gradient(135deg, #2d2d44, #252540);
    border-bottom: 1px solid #3d3d5c;
}

.osm-map-modal-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-osm {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--gray);
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close-osm:hover {
    background: var(--light-gray);
}

.osm-map-modal-body {
    padding: 20px;
}

#osmMapContainer {
    height: 400px;
    width: 100%;
    border-radius: 16px;
    margin-bottom: 15px;
    z-index: 1;
}

.osm-coordinate-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.dark-mode .osm-coordinate-info {
    background: #2d2d44;
    color: var(--dark);
}

.osm-address-info {
    background: #e8f0fe;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.dark-mode .osm-address-info {
    background: #1a2d3d;
    color: var(--dark);
}

/* Responsive untuk modal peta */
@media (max-width: 768px) {
    #osmMapContainer {
        height: 250px;
    }
    
    #osmMapModal .modal-content {
        width: 95%;
        padding: 15px;
    }
}

/* Location status and preview */
.location-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 0.9rem;
}

.location-status i.fa-circle {
    font-size: 0.6rem;
}

.coordinate-badge {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-family: monospace;
}

.btn-google-maps {
    background: #4285F4;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-google-maps:hover {
    background: #2a75f3;
    transform: translateY(-2px);
}

#locationPreview {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support */
.dark-mode .btn-google-maps {
    background: #1a4d8c;
}

.dark-mode #locationPreview {
    background: #1a2d3d;
    color: var(--dark);
}


/* Location preview */
#locationPreview {
    animation: slideDown 0.3s ease;
    background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
    border: 1px solid var(--primary);
    font-size: 0.95rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dark-mode #locationPreview {
    background: linear-gradient(135deg, #1a2d3d, #1a1a2e);
    color: var(--dark);
}


/* Google Maps button style */
.btn-google-maps {
    background: #4285F4;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-google-maps:hover {
    background: #2a75f3;
    transform: translateY(-2px);
}

.dark-mode .btn-google-maps {
    background: #1a4d8c;
}

/* Tambahkan di file css.css */

/* Default display untuk wallet elements */
.wallet-requester,
.wallet-helper {
    display: flex; /* Default, tapi akan di-override oleh JavaScript */
}

/* Saat role requester, wallet helper disembunyikan */
body.requester-mode .wallet-helper {
    display: none !important;
}

/* Saat role helper, wallet requester disembunyikan */
body.helper-mode .wallet-requester {
    display: none !important;
}

/* Fix untuk Leaflet map */
.leaflet-container {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#openstreetmap,
#osmMapContainer {
    height: 100%;
    width: 100%;
    min-height: 300px; /* Pastikan ada tinggi minimum */
    background: #f8f9fa; /* Warna background saat loading */
}

/* Pastikan container peta visible */
.modal-content #osmMapContainer {
    height: 400px;
}

/* Loading indicator untuk peta */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
/* Responsive */
@media (max-width: 768px) {
    #openstreetmap {
        height: 250px;
    }
}
@media (max-width: 370px) {
    .dashboard-header h1 { font-size: 1.08rem;}
    .btn { padding: 7px 10px; font-size: 0.82rem;}
    .job-card h3 { font-size: 0.98rem;}
    .job-price { font-size: 0.98rem;}
    .notification-dropdown {
        width: 180px;
        right: -120px;
    }
    .service-categories {
        grid-template-columns: 1fr;
    }
}

