@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir/Vazir-Regular.woff2') format('woff2');
    font-weight: normal;
}
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir/Vazir-Bold.woff2') format('woff2');
    font-weight: bold;
}
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir/Vazir-Medium.woff2') format('woff2');
    font-weight: 500;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    background-color: #f4f6f9;
    direction: rtl;
    display: flex;
    flex-direction: column;
}

body.has-fixed-header {
    padding-top: 70px;
}

.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-top: 0.5rem;
}

.footer {
    background-color: #003d73;
    color: #ccc;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    margin-top: auto;
    width: 100%;
}

.footer a {
    color: #f7941d;
    text-decoration: none;
}

:root {
    --primary-dark: #003d73;
    --primary-orange: #f7941d;
    --primary-light: #e8f0fe;
}

.bg-primary-dark {
    background-color: var(--primary-dark) !important;
}

.text-primary-orange {
    color: var(--primary-orange) !important;
}

.btn-primary-custom {
    background-color: var(--primary-dark);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: #002b52;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 61, 115, 0.4);
}

.btn-warning-custom {
    background-color: var(--primary-orange);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
}

.btn-warning-custom:hover {
    background-color: #d97d18;
    color: #fff;
}

.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

.card-header {
    background-color: var(--primary-dark);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
    font-weight: 500;
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-orange) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--primary-orange);
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #ced4da;
    padding: 12px 15px;
    font-family: 'Vazir', sans-serif;
}

.form-control:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.2rem rgba(0, 61, 115, 0.25);
}

label {
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.link-orange {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
}

.link-orange:hover {
    text-decoration: underline;
    color: #d97d18;
}

.select2-container--default .select2-selection--multiple {
    border-radius: 10px;
    border: 1px solid #ced4da;
    padding: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 3px 10px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-left: 5px;
}

.toast-container-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    direction: rtl;
}

.toast-custom {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: none;
    font-family: 'Vazir', sans-serif;
    opacity: 0;
    transform: translateX(30px);
    animation: slideInRight 0.4s ease forwards;
}

.toast-custom .toast-header {
    border-radius: 16px 16px 0 0;
    font-weight: 500;
    padding: 12px 18px;
    border-bottom: none;
    background: transparent;
    color: #fff;
}

.toast-custom .toast-header .toast-icon {
    margin-left: 10px;
    font-size: 1.2rem;
}

.toast-custom .toast-body {
    font-size: 0.95rem;
    padding: 14px 18px;
    color: #333;
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.toast-success .toast-header {
    background-color: #28a745;
}
.toast-success .toast-body {
    border-right: 4px solid #28a745;
}

.toast-error .toast-header {
    background-color: #dc3545;
}
.toast-error .toast-body {
    border-right: 4px solid #dc3545;
}

.toast-warning .toast-header {
    background-color: #f7941d;
}
.toast-warning .toast-body {
    border-right: 4px solid #f7941d;
}

.toast-info .toast-header {
    background-color: #17a2b8;
}
.toast-info .toast-body {
    border-right: 4px solid #17a2b8;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Notification Styles ===== */
.notification-dropdown-wrapper .dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
    width: 380px !important;
    min-width: 300px !important;
    max-width: 92vw !important;
    padding: 0 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    margin-top: 6px !important;
}

.notification-dropdown .dropdown-header {
    background: #f8fafc !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #eef2f6 !important;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #1a2332 !important;
}

.notification-dropdown .dropdown-header .btn-link {
    font-size: 12px !important;
    text-decoration: none !important;
    padding: 0 !important;
}

.notification-list-wrapper {
    max-height: 420px;
    overflow-y: auto;
    padding: 4px 0 !important;
}

.notification-item-wrapper {
    display: flex !important;
    align-items: center !important;
    padding: 8px 14px !important;
    border-bottom: 1px solid #f0f3f7 !important;
    gap: 8px !important;
}

.notification-item-wrapper:last-child {
    border-bottom: none !important;
}

.notification-item-wrapper:hover {
    background: #f7f9fc !important;
}

.notification-item {
    flex: 1 !important;
    text-decoration: none !important;
    color: #1a2332 !important;
    padding: 6px 8px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    min-width: 0 !important;
}

.notification-item.unread {
    background: #ebf3fe !important;
    border-right: 3px solid #0d6efd !important;
    border-radius: 0 4px 4px 0 !important;
    padding-right: 12px !important;
}

.notification-item.unread .notification-message {
    font-weight: 500 !important;
    color: #0a1a2e !important;
}

.notification-message {
    font-size: 14px !important;
    margin-bottom: 4px !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
    font-weight: 400 !important;
}

.notification-time {
    font-size: 11px !important;
    color: #8a9aa8 !important;
    font-weight: 300 !important;
}

.notification-item-wrapper .delete-notif-btn {
    opacity: 0.3 !important;
    padding: 4px 8px !important;
    flex-shrink: 0 !important;
    color: #dc3545 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.notification-item-wrapper .delete-notif-btn:hover {
    opacity: 1 !important;
    color: #b02a37 !important;
}

.notification-bell-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: transparent !important;
    color: #ffffff !important;
    position: relative;
}

.notification-bell-btn i {
    font-size: 1.2rem !important;
}

.notification-bell-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.user-dropdown-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: transparent !important;
    color: #ffffff !important;
}

.user-dropdown-btn i {
    font-size: 1.2rem !important;
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.notification-bell-btn .position-absolute {
    font-size: 0.55rem !important;
    padding: 0.1rem 0.35rem !important;
    min-width: 17px !important;
    height: 17px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 991px) {
    body.has-fixed-header {
        padding-top: 60px;
    }

    .navbar .container-fluid {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .navbar .navbar-toggler {
        order: 0;
        flex: 0 0 auto;
        z-index: 1061;
    }

    .navbar .navbar-brand {
        order: 1;
        flex: 1 1 auto;
        text-align: center;
        font-size: 0.9rem;
        margin-right: 0 !important;
    }

    .navbar .header-actions {
        order: 2;
        flex: 0 0 auto;
        margin-left: 0;
        position: relative;
        z-index: 1061;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .navbar .navbar-collapse {
        order: 3;
        flex-basis: 100%;
        margin-top: 0.8rem;
        padding-top: 0.8rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .navbar-nav {
        padding-top: 0.5rem;
        text-align: center;
    }

    .navbar-nav .nav-item {
        text-align: center;
        margin: 4px 0;
    }

    .navbar-nav .nav-link {
        justify-content: center;
        padding: 0.8rem 1rem !important;
        border-radius: 8px;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .notification-dropdown-wrapper .dropdown-menu {
        width: calc(100vw - 32px) !important;
        min-width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        max-height: 65vh !important;
        margin-top: 8px !important;
    }

    .notification-list-wrapper {
        max-height: 320px !important;
    }

    .notification-bell-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .notification-bell-btn i {
        font-size: 1rem !important;
    }

    .user-dropdown-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .user-dropdown-btn i {
        font-size: 1rem !important;
    }

    .notification-item-wrapper {
        padding: 6px 10px !important;
    }

    .notification-message {
        font-size: 13px !important;
    }

    .notification-time {
        font-size: 10px !important;
    }
}

@media (max-width: 576px) {
    body.has-fixed-header {
        padding-top: 56px;
    }

    .notification-dropdown-wrapper .dropdown-menu {
        width: calc(100vw - 16px) !important;
        min-width: calc(70vw - 16px) !important;
        max-width: calc(70vw - 16px) !important;
        max-height: 60vh !important;
        margin-top: 6px !important;
    }

    .notification-bell-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .notification-bell-btn i {
        font-size: 0.85rem !important;
    }

    .user-dropdown-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .user-dropdown-btn i {
        font-size: 0.85rem !important;
    }

    .navbar-brand {
        font-size: 0.8rem !important;
    }

    .navbar-brand i {
        font-size: 0.8rem !important;
    }

    .notification-item-wrapper {
        padding: 4px 8px !important;
        gap: 4px !important;
    }

    .notification-message {
        font-size: 12px !important;
    }

    .notification-time {
        font-size: 9px !important;
    }

    .toast-container-custom {
        max-width: 92%;
        top: 10px;
        right: 4%;
        left: 4%;
    }
}

@media (min-width: 992px) {
    .navbar .container-fluid {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }
    .navbar .navbar-toggler {
        display: none !important;
    }
    .navbar .navbar-brand {
        flex: 0 0 auto;
        margin-right: 1rem;
    }
    .navbar .navbar-collapse {
        flex: 1 1 auto;
        display: flex !important;
        justify-content: center;
    }
    .navbar .header-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }
    .navbar-nav {
        justify-content: center;
        width: 100%;
    }
    .navbar-nav .nav-link {
        padding: 0.5rem 1.2rem !important;
    }
}