/* Common Styles */
:root {
    --primary: #3D52A0;
    --secondary: #7091E6;
    --tertiary: #8697C4;
    --quaternary: #ADBBDA;
    --light-bg: #EDE8F5;
    
    --dark-primary: #3D52A0;
    --dark-secondary: #5873C8;
    --dark-tertiary: #7091E6;
    --dark-quaternary: #8697C4;
    --dark-bg: #121212;
    --dark-text: #EDE8F5;
}

[data-bs-theme="light"] {
    --bs-body-bg: var(--light-bg);
    --bs-body-color: #212529;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--dark-bg);
    --bs-body-color: var(--dark-text);
}

/* RTL Support */
html {
    direction: rtl;
    text-align: right;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-bg);
    font-family: 'Rabar', sans-serif;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container-fluid {
    flex: 1;
}

/* RTL specific adjustments */
.input-group > :not(:first-child) {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > :not(:last-child) {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

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

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

.form-control:focus {
    border-color: var(--tertiary);
    box-shadow: 0 0 0 0.25rem rgba(126, 144, 230, 0.25);
}

/* Font Face Declaration */
@font-face {
    font-family: 'Rabar';
    src: url('../fonts/Rabar_021.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
} 

/* Pagination Styles */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background-color: #f8f9fa;
    color: #0d6efd;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #0a58ca;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    color: white;
}

.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--bs-body-bg);
    border-radius: 0.5rem;
}

.table-controls .records-info {
    color: #6c757d;
}

.table-controls .records-per-page {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bs-body-bg);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-controls .records-per-page label {
    margin: 0;
    color: var(--bs-body-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.table-controls select {
    padding: 0.4rem 2.5rem 0.4rem 1rem;
    border: 1px solid var(--tertiary);
    border-radius: 0.375rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%233D52A0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 0.75rem) center;
    background-size: 1rem;
}

.table-controls select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(61, 82, 160, 0.1);
}

.table-controls select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(61, 82, 160, 0.15);
    outline: none;
}

.table-controls select option {
    padding: 0.5rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .table-controls select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23EDE8F5' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

[data-bs-theme="dark"] .table-controls select:hover {
    border-color: var(--dark-tertiary);
}

[data-bs-theme="dark"] .table-controls select:focus {
    border-color: var(--dark-tertiary);
    box-shadow: 0 0 0 0.2rem rgba(112, 145, 230, 0.15);
}

[data-bs-theme="dark"] .table-controls select option {
    padding: 0.5rem;
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* Column Search Styles */
.column-search {
    position: relative;
    margin-bottom: 0.5rem;
}

.column-search input {
    width: 100%;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border: 1px solid var(--tertiary);
    border-radius: 0.375rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.column-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(61, 82, 160, 0.15);
    outline: none;
}

.column-search::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%233D52A0' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.5;
}

[data-bs-theme="dark"] .column-search::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23EDE8F5' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
}

.column-search input::placeholder {
    color: var(--tertiary);
    opacity: 0.7;
}

[data-bs-theme="dark"] .column-search input::placeholder {
    color: var(--dark-tertiary);
}

/* Table Header with Search */
.table-header-with-search {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-header-with-search .header-text {
    margin: 0;
    font-weight: 500;
    color: var(--bs-body-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .column-search input {
        font-size: 0.85rem;
        padding: 0.35rem 1.75rem 0.35rem 0.6rem;
    }
}

/* Circular action buttons */
.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-size: 1.3rem;
    margin: 0 2px;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.08);
    vertical-align: middle;
}
.action-btn.edit {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.12);
}
.action-btn.view {
    color: #0dcaf0;
    background: rgba(13, 202, 240, 0.12);
}
.action-btn.edit:hover, .action-btn.edit:focus {
    background: #ffc107;
    color: #212529;
}
.action-btn.view:hover, .action-btn.view:focus {
    background: #0dcaf0;
    color: #212529;
}
.action-btn.delete {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
}
.action-btn.delete:hover, .action-btn.delete:focus {
    background: #dc3545;
    color: #fff;
}
.action-btn.person {
    color: #3D52A0;
    background: rgba(61, 82, 160, 0.12);
}
.action-btn.person:hover, .action-btn.person:focus {
    background: #3D52A0;
    color: #fff;
}
.action-btn.pdf {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}
.action-btn.pdf:hover {
    background-color: #dc3545;
    color: white;
}

/* Beautiful icon circle styles for page headers */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f8f9fa;
    margin-left: 10px;
    box-shadow: 0 0 8px #0002;
    transition: background 0.2s;
}
.icon-circle i {
    font-size: 2rem;
    color: #ffc107;
    transition: color 0.2s;
}
.icon-customers {
    background: #fff3cd; /* light yellow */
}
.icon-customers i {
    color: #ffc107;
}
.icon-suppliers {
    background: #cff4fc; /* light blue */
}
.icon-suppliers i {
    color: #0dcaf0;
}
.icon-mixed {
    background: #d1f5e0; /* light green */
}
.icon-mixed i {
    color: #28a745;
}

[data-bs-theme="dark"] .icon-circle {
    background: #333 !important;
} 

/* Custom scrollbar styling for light/dark mode */

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--dark-primary);
    border-radius: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #23272b;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--dark-primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--dark-primary) #f1f1f1;
}
[data-bs-theme="dark"] * {
    scrollbar-color: var(--dark-primary) #23272b;
}

/* Access Denied page styles */
.card.border-danger {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.1);
    border-width: 2px;
    transition: all 0.3s ease;
}

.card.border-danger:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(220, 53, 69, 0.2);
}

.card-header.bg-danger {
    background-color: var(--bs-danger) !important;
    border-bottom: none;
    padding: 1.25rem;
}

.bi-lock-fill.text-danger {
    animation: pulse 2s infinite;
    text-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

.access-denied-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Unauthorized Access Card Modern Style */
.unauthorized-card {
    max-width: 350px;
    margin: 60px auto;
    padding: 32px 20px;
    background: #23242a;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    text-align: center;
    color: #fff;
    border: 1.5px solid #e74c3c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.unauthorized-card .icon {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 18px;
}
.unauthorized-card .title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}
.unauthorized-card .desc {
    font-size: 15px;
    margin-bottom: 18px;
    color: #ccc;
}
.unauthorized-card .btn {
    background: #4666ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.unauthorized-card .btn:hover {
    background: #2d4dcc;
}
@media (max-width: 500px) {
    .unauthorized-card {
        max-width: 95vw;
        padding: 18px 5px;
    }
    .unauthorized-card .title {
        font-size: 18px;
    }
    .unauthorized-card .desc {
        font-size: 13px;
    }
}

.unauthorized-outer {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

