/* Estedad Font Face Definitions */
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

body {
    position: relative;
    background-color: #f5f7fc;
    font-family: 'Estedad', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-color: #ffffff;
    background-image: repeating-linear-gradient(45deg, #000000 0, #000000 1px, #ffffff 0, #ffffff 50%);
    background-size: 10px 10px;
    opacity: 0.08;
}
.dropdown-item-text{
    text-align: center;
}
/* Smooth transitions */
a, .btn, .card, .nav-link, .dropdown-menu, .form-control, .modal-content {
    transition: all 0.2s ease !important;
}

/* Cards & containers */
.card {
    border: none;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(0px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    border-radius: 0.75rem;
}
.card.shadow {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.card-header {
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.dashboard-card{
    box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
}

/* Navbar (dark with subtle gradient) */
.navbar-dark.bg-dark {
    background: linear-gradient(128deg, #162647 0%, #1a4fac 45%) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Sidebar */
.bg-light.border-end {
    border-right: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 1px 0 4px rgba(0,0,0,0.02);
    background-color: linear-gradient(100deg, #e3e3e3, #dddddd) !important;
    background-size: 16px 16px;
}
.nav-link {
    color: #3c3f4488;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}
.nav-link:hover {
    background: #f0f4f9;
    color: #1e40af;
}
.nav-link.active {
    background: linear-gradient(95deg, #2563eb, #3b82f6);
    color: white;
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(95deg, #2563eb, #3b82f6);
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 500;
}
.btn-primary:hover {
    background: linear-gradient(95deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}
.btn-outline-primary {
    border: 1px solid #3b82f6;
    color: #2563eb;
}
.btn-outline-primary:hover {
    background: linear-gradient(95deg, #2563eb, #3b82f6);
    border-color: transparent;
    transform: translateY(-1px);
}
.btn-green {
    background: linear-gradient(95deg, #25eb28, #44f63b);
    color: #ffffff;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 500;
}
.btn-green:hover {
    background: linear-gradient(95deg, #1dd833, #28eb25);
    transform: translateY(-1px);
    color: #f5f7fc;
    box-shadow: 0 4px 10px rgba(40, 235, 37, 0.3);
}
.btn-outline-green {
    border: 1px solid #54f63b;
    color: #32eb25;
}
.btn-outline-green:hover {
    background: linear-gradient(95deg, #25eb25, #64f63b);
    border-color: transparent;
    transform: translateY(-1px);
}
.btn-outline-secondary {
    border: 1px solid #cbd5e1;
    color: #475569;
}
.btn-outline-secondary:hover {
    background: #2a2a2a;
    border-color: #94a3b8;
    transform: translateY(-1px);

}

/* Table */
.table {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
}
.table thead th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.9rem 0.75rem;
}
.table tbody tr:hover {
    background: #fefce8;
}
.table-sm-inv th, .table-sm-inv td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
}

/* Form controls */
.form-control, .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: white;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
    outline: none;
}
label.form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
}
.bg-success {
    background: linear-gradient(95deg, #059669, #10b981) !important;
}
.bg-danger {
    background: linear-gradient(95deg, #dc2626, #ef4444) !important;
}
.bg-warning {
    background: linear-gradient(95deg, #d97706, #f59e0b) !important;
    color: #1e293b !important;
}
.bg-secondary {
    background: #64748b !important;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border-radius: 0.75rem;
    padding: 0.5rem 0;
}
.dropdown-item {
    padding: 0.5rem 1.2rem;
    font-size: 1.0rem;
    text-align: center;
}
.dropdown-item:hover {
    background: #f1f5f9;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.2);
}
.modal-header {
    background: #f9fafb;
    border-bottom: 1px solid #eef2f6;
    border-radius: 1rem 1rem 0 0;
    padding: 1rem 1.5rem;
}
.modal-footer {
    background: #f9fafb;
    border-top: 1px solid #eef2f6;
    border-radius: 0 0 1rem 1rem;
}

/* Alert modal */
#alertModal .modal-content {
    border-right: 5px solid #3b82f6;
}

/* Login page */
.bg-light.d-flex.align-items-center {
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
}
.card.border-0.shadow {
    background: rgba(67, 76, 255, 0.426);
    backdrop-filter: blur(2px);
    border-radius: 1rem;
}

/* Footer */
footer.bg-light {
    background: #ffffff00 !important;
    border-top: 1px solid #e2e8f0;
    font-weight: 700;
    color: #475569;
}

/* Print – keep clean */
@media print {
    body {
        background: white;
        font-family: 'Estedad', 'Tahoma', sans-serif;
    }
    .card, .table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .btn, .modal, .no-print, .navbar, .offcanvas, .d-lg-block.bg-light.border-end, footer, .card-header form {
        display: none !important;
    }
    table {
        table-layout: fixed;
    }
    th, td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* RTL overrides */
.dropdown-menu {
    text-align: right;
}
.me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}
.ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Compact inventory extras */
.price-cell {
    white-space: nowrap;
    font-size: 0.85rem;
}
.table-sm-inv .price-col {
    max-width: 90px;
}
/* Modal size adjustment – fit content naturally */
.modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}
.modal-xl {
    max-width: 900px;
}
.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Blurred background when modal is open */
.modal.show .modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.3);
}
.modal-backdrop {
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.2s ease;
}
/* Subtle gradient inside form fields */
.form-control, .form-select, textarea.form-control {
    background: linear-gradient(135deg, #fafafa 0%, #f1f1f1 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    background: linear-gradient(135deg, #f1f1f1 0%, #fafafa 100%);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

@keyframes move {
    100% {
        transform: translate3d(0, 0, 1px) rotate(360deg);
    }
}

/* Hide scrollbar globally but keep scrolling */
html {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
html::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

body {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar {
    display: none;
}

/* Show scrollbar inside modals and other important containers */
.modal-body,
.modal-content,
.modal-dialog-scrollable .modal-body,
div[class*="modal"]::-webkit-scrollbar,
div[class*="modal"] {
    scrollbar-width: auto;
    -ms-overflow-style: auto;
}
.modal-body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar {
    display: block !important;
}

/* Also ensure any element that needs native scrollbar (like tables) can be adjusted if needed */
.table-responsive::-webkit-scrollbar {
    display: block; /* keep table scrollbars visible */
}
.table-responsive {
    scrollbar-width: auto;
}