/* فونت ایران‌سنس — فایل‌های فونت را داخل wwwroot/fonts قرار دهید
   (نام فایل‌ها را با src های زیر یکی کنید، یا مسیر/نام را مطابق فایل‌های
   خودتان اصلاح کنید) */
@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb.woff2') format('woff2'),
         url('/fonts/IRANSansWeb.woff') format('woff'),
         url('/fonts/IRANSansWeb.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Medium.woff2') format('woff2'),
         url('/fonts/IRANSansWeb_Medium.woff') format('woff'),
         url('/fonts/IRANSansWeb_Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Bold.woff2') format('woff2'),
         url('/fonts/IRANSansWeb_Bold.woff') format('woff'),
         url('/fonts/IRANSansWeb_Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
    direction: rtl;
}

a { color: inherit; }

/* ---------- Header ---------- */
.app-header {
    height: 56px;
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.app-title {
    font-size: 17px;
    font-weight: bold;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-user {
    font-size: 14px;
    opacity: .9;
}

.btn-logout {
    font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-logout:hover { background: #dc2626; }

/* ---------- Layout ---------- */
main {
    height: calc(100% - 56px);
}

.app-layout {
    display: flex;
    height: calc(100vh - 56px);
    width: 100%;
}

.sidebar {
    width: 340px;
    min-width: 340px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

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

.sidebar-header h2 {
    font-size: 17px;
    margin: 0;
}

.map-wrapper {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* ---------- Buttons ---------- */
.btn-primary {
    font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-sm { padding: 6px 10px; font-size: 13px; }

.btn-block { width: 100%; }

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-danger:hover { background: #fecaca; }

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
    padding: 0;
    margin-right: 6px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    color: #64748b;
}

/* ---------- Hint / empty state ---------- */
.hint {
    background: #eff6ff;
    color: #1e40af;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin: 10px 0;
}

.hint-small {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 0;
}

.empty-state {
    color: #94a3b8;
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
}

.hidden { display: none !important; }

/* ---------- Search ---------- */
.search-box {
    margin-bottom: 12px;
}
    .search-box input {
        font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
        width: 100%;
        padding: 9px 12px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        font-size: 14px;
    }

/* ---------- Reporters list ---------- */
.reporters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.reporter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
}
.reporter-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.reporter-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
}

.reporter-item-info {
    flex: 1;
    min-width: 0;
}

.reporter-item-name {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reporter-item-desc {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Login page ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e293b, #334155);
}

.login-box {
    background: #fff;
    padding: 36px 32px;
    border-radius: 12px;
    width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.login-title {
    font-size: 20px;
    margin: 0 0 4px;
    text-align: center;
}

.login-subtitle {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin: 0 0 20px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: #334155;
    font-weight: bold;
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.form-input:focus {
    outline: none;
    border-color: #2563eb;
}

.field-error {
    color: #dc2626;
    font-size: 12px;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}

/* ---------- Color picker ---------- */
.color-picker {
    display: flex;
    gap: 8px;
}
.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}
.color-swatch.selected {
    border-color: #1e293b;
}

.coords-row {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #334155;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    width: 420px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 20px;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
}

.modal-actions-left {
    display: flex;
    gap: 8px;
}

/* ---------- Leaflet marker popup RTL tweak ---------- */
.leaflet-popup-content {
    direction: rtl;
    text-align: right;
    font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
}

.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
    .popup-actions button {
        font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 4px;
        border: none;
        cursor: pointer;
    }
.popup-edit { background: #dbeafe; color: #1e40af; }
.popup-delete { background: #fee2e2; color: #b91c1c; }

.reporter-label {
    direction: rtl;
    text-align: right;
    font-family: 'IRANSans', Tahoma, "Segoe UI", Arial, sans-serif;
    background: rgba(255,255,255,.92);
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    padding: 1px 7px;
    font-size: 11px;
    font-weight: bold;
    color: #1e293b;
    border-radius: 4px;
}
.leaflet-tooltip-bottom.reporter-label::before {
    display: none;
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; min-width: 0; max-height: 230px; border-left: none; border-bottom: 1px solid #e2e8f0; padding-bottom:0px; }
    .reporter-item{padding:5px; margin-bottom:0px;}
}


.leaflet-container {
    direction: ltr;
}
