/* 
 * متتبع زيارات الأطباء - ملف التنسيق الرئيسي
 * Doctor Visit Tracker - Main Stylesheet
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}

/* الوضع الليلي / Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .dashboard-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

body.dark-mode .stat-card,
body.dark-mode .upcoming-section,
body.dark-mode .filter-section,
body.dark-mode .visits-section,
body.dark-mode .add-visit-card,
body.dark-mode .edit-visit-card {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .visits-table thead {
    background-color: #1a1a1a;
}

body.dark-mode .visits-table th {
    color: #e0e0e0;
}

body.dark-mode .visits-table td {
    color: #b0b0b0;
}

body.dark-mode .visits-table tr:hover {
    background-color: #3d3d3d;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .back-button {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

body.dark-mode .back-button:hover {
    background-color: #667eea;
}

body.dark-mode .filter-form {
    background-color: #2d2d2d;
}

/* الأزرار / Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #999;
    color: white;
}

.btn-secondary:hover {
    background-color: #888;
}

.btn-danger {
    background-color: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background-color: #ff5252;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-large {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-edit {
    background-color: #667eea;
}

.btn-edit:hover {
    background-color: #5568d3;
}

.btn-delete {
    background-color: #ff6b6b;
}

.btn-delete:hover {
    background-color: #ff5252;
}

/* الرسائل / Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-info {
    background-color: #eef;
    color: #33c;
    border: 1px solid #ccf;
}

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

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

.visits-table thead {
    background-color: #f5f5f5;
}

.visits-table th {
    padding: 12px;
    text-align: right;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.visits-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.visits-table tr:hover {
    background-color: #f9f9f9;
}

/* البطاقات / Cards */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 32px;
}

.stat-content h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.stat-content p {
    margin: 5px 0 0 0;
    color: #999;
    font-size: 14px;
}

/* النماذج / Forms */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* الشارات / Badges */
.specialty-badge {
    background-color: #e8f0ff;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

body.dark-mode .specialty-badge {
    background-color: #3d4d7d;
    color: #a0b0ff;
}

/* الحالات الفارغة / Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state p {
    margin-bottom: 20px;
}

/* الاستجابة / Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .statistics-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }

    .visits-table {
        font-size: 12px;
    }

    .visits-table th,
    .visits-table td {
        padding: 8px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .dashboard-header {
        padding: 15px;
    }

    .dashboard-main {
        padding: 15px;
    }

    .statistics-section {
        grid-template-columns: 1fr;
    }

    .add-visit-card,
    .edit-visit-card {
        padding: 15px;
    }

    .header h1 {
        font-size: 20px;
    }

    .stat-content h3 {
        font-size: 20px;
    }
}

/* الرسوم المتحركة / Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert,
.stat-card,
.upcoming-card {
    animation: fadeIn 0.3s ease;
}

/* الحالات المتقدمة / Advanced States */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    cursor: pointer;
}

/* الطباعة / Print Styles */
@media print {
    .dashboard-header,
    .action-buttons,
    .filter-section,
    .form-buttons {
        display: none;
    }

    .visits-table {
        font-size: 12px;
    }
}
