/**
 * استایل‌های اصلی سامانه پزشکیار هوشمند آرکا
 * Main Styles for Arka Smart Medical Assistant
 */

/* متغیرهای CSS */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --warning-color: #fbbc04;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s ease;
}

/* ریست و پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

/* لینک‌ها */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* تصاویر */
img {
    max-width: 100%;
    height: auto;
}

/* کانتینر اصلی */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* سایدبار */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-white);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-category {
    padding: 10px 20px;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    transition: var(--transition);
    cursor: pointer;
}

.menu-item:hover, .menu-item.active {
    background: var(--sidebar-hover);
    color: var(--text-white);
}

.menu-item i {
    margin-left: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-item span {
    flex: 1;
}

/* محتوای اصلی */
.main-content {
    flex: 1;
    margin-right: 260px;
    padding: 20px;
    min-height: 100vh;
}

/* هدر */
.header {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* کارت‌ها */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* آمار کارت‌ها */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

.stat-icon.green {
    background: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
}

.stat-icon.orange {
    background: rgba(251, 188, 4, 0.1);
    color: var(--warning-color);
}

.stat-icon.red {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-color);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #2d9147;
}

.btn-danger {
    background: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background: #c5372b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* فرم‌ها */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-error {
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* جدول */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

/* بج‌ها */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
}

.badge-warning {
    background: rgba(251, 188, 4, 0.1);
    color: #b08800;
}

.badge-danger {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-color);
}

.badge-info {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

/* مودال */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

/* پیام‌ها */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(52, 168, 83, 0.2);
}

.alert-error {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(234, 67, 53, 0.2);
}

.alert-warning {
    background: rgba(251, 188, 4, 0.1);
    color: #b08800;
    border: 1px solid rgba(251, 188, 4, 0.2);
}

.alert-info {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(26, 115, 232, 0.2);
}

/* پیجینیشن */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover, .pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* صفحه لاگین */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #1a73e8 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-secondary);
}

/* آپلود فایل */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.02);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.file-upload-text {
    color: var(--text-secondary);
}

.file-upload input {
    display: none;
}

/* تصاویر آپلود شده */
.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-color);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* گزارش */
.report-container {
    background: white;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.report-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
}

.report-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.report-section {
    margin-bottom: 25px;
}

.report-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.report-item {
    display: flex;
    gap: 10px;
}

.report-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.report-value {
    color: var(--text-primary);
}

.report-warning {
    background: rgba(234, 67, 53, 0.05);
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 20px;
}

/* چاپ */
@media print {
    .sidebar, .header, .btn, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .report-container {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        background: white;
    }
}

/* لودینگ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .report-grid {
        grid-template-columns: 1fr;
    }
}

/* انیمیشن */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* چک‌باکس */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* تب‌ها */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover, .tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* خالی */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* تولتیپ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
