/* General Styles */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc05;
    --light-gray: #f5f5f5;
    --dark-gray: #444444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

/* Sidebar Styles */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    background-color: #343a40;
    transition: all 0.3s;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Main Content */
.content-wrapper {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    transition: all 0.3s;
}

.content-wrapper.expanded {
    margin-left: 0;
    width: 100%;
}

.main-content {
    padding: 20px;
}

/* Navbar */
.navbar {
    padding: 15px 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.navbar-toggler {
    border: none;
    outline: none !important;
    box-shadow: none !important;
}

/* Card Styles */
.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
    padding: 15px 20px;
}

.card-footer {
    border-radius: 0 0 10px 10px !important;
    border-top: none;
    background-color: #fff;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 5px;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(26, 115, 232, 0.25);
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 8px 16px;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0e63d0;
    border-color: #0e63d0;
}

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

/* Table Styles */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Dashboard Cards */
.dashboard-card {
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dashboard-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.dashboard-card-count {
    font-size: 2rem;
    font-weight: 600;
}

.dashboard-card-title {
    font-size: 1rem;
    color: #6c757d;
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }

    .sidebar.collapsed {
        margin-left: 0;
    }

    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper.expanded {
        margin-left: 0;
        width: 100%;
    }

    .navbar-brand {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .no-print {
        display: none !important;
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Custom styles for patient registration form */
.patient-form {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
}

/* Invoice/Receipt styles */
.invoice-container {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #fff;
}

.invoice-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.invoice-company {
    font-weight: bold;
    font-size: 1.5rem;
}

.invoice-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.invoice-details {
    margin-bottom: 20px;
}

.invoice-details-table {
    width: 100%;
}

.invoice-details-table td {
    padding: 8px 0;
}

.invoice-items-table th {
    background-color: #f8f9fa;
}

.invoice-total {
    font-weight: bold;
    font-size: 1.2rem;
}

.invoice-notes {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.invoice-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Pagination */
.pagination .page-item .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Alert styling */
.alert {
    border-radius: 10px;
}

/* Statistics charts */
.chart-container {
    height: 300px;
    margin-bottom: 20px;
}

/* Language Switcher */
.lang-switcher .btn {
    padding: 4px 12px;
    font-size: 0.85rem;
    border-radius: 20px;
}

.lang-switcher .btn.active {
    font-weight: 700;
}

/* ===== RTL Support ===== */
[dir="rtl"] body {
    font-family: 'Segoe UI', Tahoma, 'NRT', 'Noto Sans Arabic', 'Noto Kufi Arabic', sans-serif;
}

[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .sidebar.collapsed {
    margin-left: 0;
    margin-right: -250px;
}

[dir="rtl"] .sidebar .nav-link i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .content-wrapper {
    margin-left: 0;
    margin-right: 250px;
}

[dir="rtl"] .content-wrapper.expanded {
    margin-right: 0;
    width: 100%;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
[dir="rtl"] .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }

[dir="rtl"] .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

[dir="rtl"] .float-end {
    float: left !important;
}

[dir="rtl"] .float-start {
    float: right !important;
}

[dir="rtl"] .fa-arrow-right::before {
    content: "\f060";
}

[dir="rtl"] .input-group > :not(:first-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
}

[dir="rtl"] .input-group > :not(:last-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

[dir="rtl"] .sidebar-footer {
    text-align: center;
}

@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        margin-right: -250px;
        margin-left: 0;
    }

    [dir="rtl"] .sidebar.collapsed {
        margin-right: 0;
    }

    [dir="rtl"] .content-wrapper {
        margin-right: 0;
        width: 100%;
    }

    [dir="rtl"] .content-wrapper.expanded {
        margin-right: 0;
        width: 100%;
    }
}

@media print {
    [dir="rtl"] .content-wrapper {
        margin-right: 0;
        width: 100%;
    }
}