/* ===========================
   Base Reset & Fonts
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: samim, 'Segoe UI', Tahoma, sans-serif;
}

@font-face {
    font-family: samim;
    src: url("./fonts/Samim.woff") format("woff");
    font-weight: normal;
}
@font-face {
    font-family: samim;
    src: url("./fonts/Samim-Bold.woff") format("woff");
    font-weight: bold;
}

/* ===========================
   Global Styles
=========================== */
body {
    background: #eef2f7;
    direction: rtl;
    color: #1e2a3a;
    line-height: 1.5;
    padding: 16px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px 24px;
    margin-bottom: 28px;
    text-align: center;
    border: 1px solid #e2e8f0;
}
h1 {
    font-size: 1.8rem;
    color: #0f3b5f;
    margin-bottom: 6px;
}
.subtitle {
    color: #4a6a85;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.card h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #2c7da0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e4663;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1e3a5f;
}
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #2c7da0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}
.btn-success { background: #2a9d8f; }
.btn-danger { background: #e76f51; }
.btn-info { background: #4a8fe7; }
.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Grid Layout */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
@media (min-width: 1000px) {
    .dashboard {
        grid-template-columns: 1fr 1.2fr;
    }
}

/* Appointment Items */
.appointments-list {
    max-height: 550px;
    overflow-y: auto;
}
.appointment-item {
    background: #f8fafc;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    border-right: 5px solid #2c7da0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.appointment-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.patient-name {
    font-weight: 700;
    font-size: 1.1rem;
}
.appointment-time {
    background: #2c7da0;
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
}
.status-badge {
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
}
.status-confirmed { background: #2a9d8f; color: white; }
.status-pending { background: #e9c46a; color: #3a2c1f; }
.status-cancelled { background: #e76f51; color: white; }

/* Calendar */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 8px;
}
.calendar-day {
    background: #f1f5f9;
    border-radius: 14px;
    padding: 12px 4px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    font-weight: 500;
}
.calendar-day.today {
    background: #2c7da0;
    color: white;
}
.calendar-day.has-appointment {
    background: #2a9d8f;
    color: white;
}
.appointment-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #e76f51;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Patient Table */
.patient-table {
    width: 100%;
    border-collapse: collapse;
}
.patient-table th, .patient-table td {
    padding: 12px 8px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}
.patient-table tr:hover {
    background: #f1f9fe;
}
.search-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 40px;
    border: 1px solid #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 12px; }
    .card { padding: 16px; }
    .btn { width: 100%; margin-bottom: 6px; }
    .appointment-header { flex-direction: column; gap: 6px; }
    .calendar-day { padding: 8px 2px; font-size: 0.8rem; }
}


/* ===========================
   Dark Mode Styles (add at end of file)
=========================== */
body.dark-mode {
    background: #121826;
    color: #e2e8f0;
}

body.dark-mode .card,
body.dark-mode header {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode .card h2,
body.dark-mode .patient-name {
    color: #f1f5f9;
}

body.dark-mode .subtitle,
body.dark-mode label {
    color: #cbd5e1;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-mode .appointment-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .calendar-day {
    background: #1e293b;
    color: #cbd5e1;
}

body.dark-mode .calendar-day.today {
    background: #2c7da0;
    color: white;
}

body.dark-mode .calendar-day.has-appointment {
    background: #2a9d8f;
    color: white;
}

body.dark-mode .btn {
    background: #3b82f6;
}
body.dark-mode .btn:hover {
    background: #2563eb;
}
body.dark-mode .btn-danger {
    background: #ef4444;
}
body.dark-mode .btn-success {
    background: #10b981;
}
body.dark-mode .stat-card {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}