﻿body {
    font-family: 'Cairo', sans-serif;
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

@@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMj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{
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* ============================================= */
/* ==      MODERN DASHBOARD STYLES            == */
/* ============================================= */

/* Main dashboard container */
.dashboard-page-container {
    padding: 1.5rem;
    background-color: #f4f7f6; /* A very light, neutral background */
    min-height: 100vh;
}

/* Base card styling */
.dashboard-card-modern {
    background: rgba(255, 255, 255, 0.6); /* Semi-transparent background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    padding: 1.5rem;
    width: 100%;
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

/* Animation for cards loading */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header style within a card */
.dashboard-header {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.dashboard-subheader {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Statistic cards */
.stat-card-animated {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid transparent;
}

    .stat-card-animated:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 123, 255, 0.5);
    }

    .stat-card-animated .stat-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
        display: inline-block;
    }

    .stat-card-animated .stat-title {
        font-size: 0.9rem;
        color: #555;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stat-card-animated .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: #222;
    }

    /* Assigning colors to icons */
    .stat-card-animated.stat-total .stat-icon {
        color: #0d6efd;
    }

    .stat-card-animated.stat-available .stat-icon {
        color: #198754;
    }

    .stat-card-animated.stat-busy .stat-icon {
        color: #ffc107;
    }

    .stat-card-animated.stat-service .stat-icon {
        color: #dc3545;
    }


/* Profile Block */
.profile-block-modern {
    text-align: center;
    padding: 2rem 1rem;
    animation-delay: 0.2s; /* Delay animation to appear after main content */
}

    .profile-block-modern .profile-img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        border: 4px solid #fff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        margin-bottom: 1rem;
    }

    .profile-block-modern .company-logo {
        max-width: 100px;
        max-height: 40px;
        margin-top: 1rem;
    }

    .profile-block-modern .username {
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 1rem;
        color: #333;
    }

    .profile-block-modern .user-email {
        font-size: 0.9rem;
        color: #777;
    }

/* Info List */
.info-list-modern {
    margin-top: 2rem;
    text-align: left;
}

    .info-list-modern h4 {
        font-size: 1.1rem;
        font-weight: 600;
        border-bottom: 2px solid #eee;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    .info-list-modern div {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        font-size: 0.95rem;
    }

        .info-list-modern div span {
            font-weight: 500;
            color: #555;
        }

/* Chart container styling */
.chart-container-modern {
    padding: 1rem;
    margin-top: 2rem;
}

    .chart-container-modern h4 {
        text-align: center;
        font-weight: 600;
        color: #444;
        margin-bottom: 1.5rem;
    }

.table-responsive {
    overflow: visible !important; /* علشان يظهر الـ dropdown بره */
    position: relative;
    z-index: 1;
}

.table {
    position: relative;
    z-index: 1;
}

.table-responsive {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.table td {
    position: relative;
    overflow: visible !important;
    z-index: 1;
}

/* خاص بالمكونات اللي بتفتح dropdown (زي Selects مخصصة أو مكتبات) */
.dropdown-menu,
.blazor-dropdown-panel,
.custom-select-panel,
.autocomplete-panel {
    position: absolute !important;
    z-index: 9999 !important;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tree-dropdown {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.account-tree-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.account-tree-node {
    margin: 2px 0;
}

    .account-tree-node > div {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.tree-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #007bff;
}

.selectable {
    cursor: pointer;
    color: #212529;
    transition: background 0.2s, color 0.2s;
}

    .selectable:hover {
        background: #007bff;
        color: white;
        padding: 2px 5px;
        border-radius: 5px;
    }

.journal-lines-container {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.journal-lines-table {
    height: 100vh;
    overflow-y: auto;
    display: block;
}

    .journal-lines-table table {
        width: 100%;
        border-collapse: collapse;
    }

.tree-dropdown {
    position: absolute !important;
    z-index: 2000 !important; /* فوق المودال */
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0px 6px 15px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .row.g-3 label {
        font-weight: bold;
        font-size: 0.9rem;
    }
}

#containersMap {
    width: 100%;
    height: 520px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.leaflet-popup-content {
    direction: rtl;
}



/* شكل الدبوس الأساسي */
.marker-pin {
    position: relative;
    width: 20px;
    height: 20px;
    background: #2e86de; /* أزرق افتراضي */
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: -1px 1px 2px rgba(0,0,0,0.3);
}

    /* النقطة في وسط الدبوس */
    .marker-pin::after {
        content: "";
        width: 10px;
        height: 10px;
        background: white;
        border-radius: 50%;
        position: absolute;
        top: 5px;
        left: 5px;
    }

/* أحمر مع موجات */
.marker-alert {
    background: red;
}

    .marker-alert::before, .marker-alert::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        border: 2px solid red;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: wave 1.5s infinite;
    }

    .marker-alert::after {
        animation-delay: 0.75s;
    }

/* برتقالي مع موجات */
.marker-warning {
    background: orange;
}

    .marker-warning::before, .marker-warning::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        border: 2px solid orange;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: wave 1.5s infinite;
    }

    .marker-warning::after {
        animation-delay: 0.75s;
    }

/* أنيميشن الموجات */
@keyframes wave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}
/* حاوية بدبوس */
.bin-pin {
    position: relative;
    width: 36px;
    height: 48px;
}

/* سن الدبوس */
.pin-tail {
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid currentColor; /* لون حسب الحالة */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* جسم الدبوس + SVG */
.pin-body {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 14px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* SVG أيقونة الحاوية */
.bin-svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* الألوان الافتراضية (عادي) */
.pin-normal {
    color: #2e86de;
}
    /* tail color */
    .pin-normal .bin-lid,
    .pin-normal .bin-handle,
    .pin-normal .bin-body,
    .pin-normal .bin-line {
        fill: #2e86de;
    }

/* حالة اقتراب من الصفر (تحذير) */
.pin-warning {
    color: #ff9800;
}
    /* tail */
    .pin-warning .bin-lid,
    .pin-warning .bin-handle,
    .pin-warning .bin-body,
    .pin-warning .bin-line {
        fill: #ff9800;
    }

/* حالة صفر أو أقل (تنبيه قوي) */
.pin-alert {
    color: #e53935;
}
    /* tail */
    .pin-alert .bin-lid,
    .pin-alert .bin-handle,
    .pin-alert .bin-body,
    .pin-alert .bin-line {
        fill: #e53935;
    }

/* موجات */
.pin-wave {
    position: absolute;
    left: 50%;
    bottom: 24px; /* مركز الدائرة عند منتصف جسم الدبوس */
    transform: translate(-50%, 50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: .85;
    pointer-events: none;
    animation: pin-wave 1.8s infinite ease-out;
    filter: drop-shadow(0 0 2px rgba(0,0,0,.12));
}

/* موجتين بتأخير بسيط */
.wave-2 {
    animation-delay: .9s;
}

/* إظهار الموجات فقط في التحذير/التنبيه */
.pin-normal .pin-wave {
    display: none;
}

.pin-warning .pin-wave,
.pin-alert .pin-wave {
    display: block;
}

@keyframes pin-wave {
    0% {
        transform: translate(-50%, 50%) scale(1);
        opacity: .7;
    }

    100% {
        transform: translate(-50%, 50%) scale(3.2);
        opacity: 0;
    }
}

/* تحسين البوب‑أب RTL */
.leaflet-popup-content {
    direction: rtl;
}
