:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #d1fae5;
    --female-color: #db2777;
    --female-bg: #fdf2f8;
    --dark: #0f172a;
    --gray-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background-color: var(--gray-bg);
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* =========================================
   Login Screen Styles
   ========================================= */
.login-wrapper {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    text-align: left;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 1.4rem;
    color: var(--text);
    font-weight: 700;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

.login-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    text-align: center;
}

/* User pill in header */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.logout-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #b91c1c;
}

/* =========================================
   App Layout
   ========================================= */
.app-header {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.brand span.subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-body {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 380px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transition: transform 0.3s ease;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.search-box i.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.radius-control {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.radius-control select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    outline: none;
}

.filter-toggle {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    gap: 8px;
}

.switch-label input {
    accent-color: var(--female-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Results List */
.results-header {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.mosque-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mosque-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.mosque-card.active {
    border-color: var(--primary);
    background: #f0fdf4;
}

.mosque-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.mosque-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.distance-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.female-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.female-tag.available {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.female-tag.unavailable {
    background: #f1f5f9;
    color: #64748b;
}

/* Map */
#map {
    flex: 1;
    height: 100%;
    z-index: 10;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.btn-danger:hover {
    background: #fca5a5;
    color: #7f1d1d;
}

/* Tabs */
.tab-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
    gap: 6px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.user-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e2e8f0;
    color: var(--text);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    width: 500px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.15rem;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.dropzone i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.progress-container {
    margin-top: 16px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.import-result {
    margin-top: 14px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.import-result.success {
    display: block !important;
    background: #dcfce7;
    color: #15803d;
}

.import-result.error {
    display: block !important;
    background: #fee2e2;
    color: #b91c1c;
}

/* Zoom Hint Pill */
.zoom-hint-pill {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 500;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(6px);
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.zoom-hint-pill.show {
    display: inline-flex;
}

/* Clear Search Button */
.clear-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    color: var(--text);
    background: #e2e8f0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* Pending Review Badges & Cards */
.pending-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: 4px;
    display: inline-block;
}

.pending-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.pending-card h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 4px;
}

.pending-note {
    font-size: 0.78rem;
    color: #b45309;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 6px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 45%;
        border-right: none;
        border-top: 2px solid var(--border);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    }
}

/* Modern Floating Toast Notification (Zero JS Alerts) */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-msg {
    min-width: 260px;
    max-width: 380px;
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.25s ease;
}
.toast-msg.success {
    background: #065f46;
    border-left: 5px solid #10b981;
}
.toast-msg.error {
    background: #991b1b;
    border-left: 5px solid #ef4444;
}
.toast-msg.info {
    background: #1e40af;
    border-left: 5px solid #3b82f6;
}
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
