:root {
    --primary-dark: #1a1a1a;
    --secondary-dark: #2d2d2d;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    direction: rtl;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
}

.clinic-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

/* Dashboard */
.sidebar {
    background: var(--primary-dark);
    min-height: 100vh;
    padding: 20px 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 250px;
    z-index: 1000;
}

.sidebar-brand {
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.sidebar-brand img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    display: block;
    margin: 0 auto 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.main-content {
    margin-right: 250px;
    padding: 30px;
}

.top-bar {
    background: var(--white);
    padding: 20px 30px;
    margin: -30px -30px 30px -30px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-dark);
}

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

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

/* Cards */
.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border-gray);
    transition: transform 0.3s;
}

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

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* Tables */
.data-table {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--light-gray);
}

.table th {
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border-gray);
    padding: 15px;
}

.table td {
    padding: 15px;
    vertical-align: middle;
}

/* Buttons */
.btn-dark {
    background: var(--primary-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-dark:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-outline-dark {
    border: 1px solid var(--primary-dark);
    color: var(--primary-dark);
    background: transparent;
}

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

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    padding: 10px 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.2rem rgba(26, 26, 26, 0.1);
}

/* Calendar */
.calendar-container {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    background: var(--light-gray);
}

.calendar-day.has-appointment {
    background: var(--primary-dark);
    color: var(--white);
}

/* Body Map Canvas */
.body-map-container {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#bodyMapCanvas {
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    cursor: crosshair;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.drawing-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    cursor: pointer;
}

/* Document Upload */
.upload-area {
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-dark);
    background: var(--light-gray);
}

.document-list {
    list-style: none;
    padding: 0;
}

.document-item {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Questionnaire */
.questionnaire-section {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.question-group {
    margin-bottom: 25px;
}

.question-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: block;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-scheduled {
    background: var(--light-gray);
    color: var(--text-dark);
}

.badge-completed {
    background: var(--primary-dark);
    color: var(--white);
}

.badge-cancelled {
    background: var(--border-gray);
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-gray);
    background: var(--light-gray);
}

.modal-footer {
    border-top: 1px solid var(--border-gray);
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    position: relative;
    padding-right: 40px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-dark);
}

.timeline-item::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 18px);
    background: var(--border-gray);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-content {
    background: var(--white);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
}

.timeline-date {
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 5px;
}
