/**
 * استایل‌های سفارشی سیستم مدیریت مطب
 * Custom Styles for Clinic Management System
 */

/* فونت‌های فارسی */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* تنظیمات کلی */
* {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

body {
    background-color: #f8f9fa;
    direction: rtl;
    text-align: right;
}

/* ناوبری */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin: 0 0.2rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* کارت‌ها */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-title {
    color: #495057;
    font-weight: 600;
}

/* دکمه‌ها */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* فرم‌ها */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* جدول‌ها */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

/* آلرت‌ها */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0a3622;
}

.alert-danger {
    background-color: #f8d7da;
    color: #58151c;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* بج‌ها */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
}

/* لیست گروه */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

/* کارت‌های آماری */
.card.text-white .card-footer {
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card.text-white .card-footer a {
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.card.text-white .card-footer a:hover {
    opacity: 0.8;
}

/* عملیات سریع */
.btn.h-100 {
    min-height: 120px;
    text-align: center;
}

.btn.h-100 i {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.btn.h-100:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* فرم‌های جستجو */
.search-form {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* تصاویر */
.patient-photo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
}

.patient-photo-large {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 3px solid #e9ecef;
}

/* مودال‌ها */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0;
    background-color: #f8f9fa;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.75rem 0.75rem;
    background-color: #f8f9fa;
}

/* پیجینیشن */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    font-weight: 500;
    color: #0d6efd;
    border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn.h-100 {
        min-height: 80px;
    }
    
    .btn.h-100 i {
        font-size: 1.5rem;
    }
    
    .patient-photo-large {
        width: 150px;
        height: 150px;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn.h-100 {
        min-height: 60px;
    }
    
    .btn.h-100 i {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
}

/* چاپ */
@media print {
    .navbar,
    .btn,
    .card-footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        background-color: #fff;
    }
}

/* تم تیره (اختیاری) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #fff;
    }
    
    .card {
        background-color: #343a40;
        color: #fff;
    }
    
    .card-header {
        background-color: #495057;
        border-bottom-color: #6c757d;
    }
    
    .table {
        color: #fff;
    }
    
    .table thead th {
        background-color: #495057;
        border-bottom-color: #6c757d;
    }
    
    .form-control,
    .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #495057;
        border-color: #0d6efd;
        color: #fff;
    }
}

/* کلاس‌های کمکی */
.text-persian {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

.fw-medium {
    font-weight: 500;
}

.border-radius-lg {
    border-radius: 0.75rem;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.transition-all {
    transition: all 0.3s ease;
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* لودینگ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* نمایش خطا */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* فیلدهای اجباری */
.required::after {
    content: " *";
    color: #dc3545;
}

/* نمایش تصاویر */
.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* دراپ زون برای آپلود فایل */
.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.drop-zone.dragover {
    transform: scale(1.02);
}