/* SARC Clinic - Main Stylesheet */
:root {
    --sarc-red: #c62828;
    --sarc-red-light: #ef5350;
    --sarc-blue: #1a237e;
    --sarc-blue-light: #3949ab;
    --sarc-bg: #f5f5f5;
    --sarc-white: #ffffff;
    --sarc-border: #e0e0e0;
    --sarc-text: #212121;
    --sarc-text-muted: #757575;
    --sarc-success: #2e7d32;
    --sarc-warning: #f57f17;
}

/* Base */
body {
    font-family: 'Segoe UI', 'Arial', Tahoma, sans-serif;
    background-color: var(--sarc-bg);
    color: var(--sarc-text);
    direction: rtl;
    text-align: right;
}

/* Navbar */
.navbar-sarc {
    background: linear-gradient(135deg, var(--sarc-blue) 0%, var(--sarc-blue-light) 100%);
    border-bottom: 4px solid var(--sarc-red);
    padding: 8px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.navbar-sarc .navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-sarc .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 8px 14px !important;
    border-radius: 6px;
    transition: all 0.2s;
}

.navbar-sarc .nav-link:hover,
.navbar-sarc .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white !important;
}

.navbar-sarc .navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

/* Page Header */
.page-header {
    background: white;
    border-right: 5px solid var(--sarc-red);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.page-header h2 {
    color: var(--sarc-blue);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Cards */
.sarc-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--sarc-border);
    overflow: hidden;
}

.sarc-card .card-header {
    background: var(--sarc-blue);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1rem;
}

.sarc-card .card-header.red {
    background: var(--sarc-red);
}

.sarc-card .card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-top: 4px solid var(--sarc-blue);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-card.red { border-top-color: var(--sarc-red); }
.stat-card.green { border-top-color: var(--sarc-success); }
.stat-card.orange { border-top-color: var(--sarc-warning); }

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--sarc-blue);
    line-height: 1;
}

.stat-card.red .stat-value { color: var(--sarc-red); }
.stat-card.green .stat-value { color: var(--sarc-success); }
.stat-card.orange .stat-value { color: var(--sarc-warning); }

.stat-card .stat-label {
    color: var(--sarc-text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Buttons */
.btn-sarc-primary {
    background: var(--sarc-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sarc-primary:hover {
    background: var(--sarc-blue-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,35,126,0.3);
}

.btn-sarc-red {
    background: var(--sarc-red);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sarc-red:hover {
    background: var(--sarc-red-light);
    color: white;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--sarc-blue);
    margin-bottom: 4px;
}

.form-control, .form-select {
    border: 1.5px solid var(--sarc-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sarc-blue);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

/* Tables */
.sarc-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sarc-table thead th {
    background: var(--sarc-blue);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    border: none;
}

.sarc-table tbody td {
    padding: 11px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    font-size: 0.9rem;
    vertical-align: middle;
}

.sarc-table tbody tr:hover { background: #fafafa; }
.sarc-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge-new { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-returning { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-volunteer { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-waiting { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-completed { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }

/* Queue Number Display */
.queue-number-display {
    border: 4px solid var(--sarc-blue);
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 4rem;
    font-weight: 900;
    color: var(--sarc-blue);
    text-align: center;
    line-height: 1;
    min-width: 120px;
    display: inline-block;
}

/* Fee Display */
.fee-display {
    background: #fff3e0;
    border: 2px dashed var(--sarc-red);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sarc-red);
}

/* Status indicators */
.patient-status-new {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    padding: 8px 15px;
    font-weight: 600;
    display: none;
}

.patient-status-returning {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 8px 15px;
    font-weight: 600;
    display: none;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sarc-blue) 0%, #283593 50%, var(--sarc-red) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Print Receipt */
@media print {
    @page { size: 58mm auto; margin: 2mm; }
    body * { visibility: hidden !important; }
    #printReceipt, #printReceipt * { visibility: visible !important; }
    #printReceipt {
        display: block !important;
        position: fixed;
        left: 0; top: 0;
        width: 54mm;
        padding: 3mm;
        font-family: 'Arial', sans-serif;
        color: black !important;
        background: white !important;
    }
    .no-print { display: none !important; }
    .print-queue-num {
        border: 3px solid black;
        font-size: 52px;
        font-weight: 900;
        text-align: center;
        margin: 4px auto;
        width: 90%;
        line-height: 1.1;
    }
    .print-line {
        border-bottom: 1px dashed black;
        padding: 3px 0;
        font-size: 12px;
        text-align: right;
        margin: 2px 0;
    }
    .print-header {
        text-align: center;
        font-weight: bold;
        font-size: 13px;
        margin-bottom: 4px;
    }
    .print-footer {
        text-align: center;
        font-size: 10px;
        margin-top: 5px;
        border-top: 1px solid black;
        padding-top: 3px;
    }
}

/* Alerts */
.alert-sarc-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 500;
}

.alert-sarc-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 500;
}

/* Footer */
.sarc-footer {
    background: var(--sarc-blue);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 15px;
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.8rem; }
    .queue-number-display { font-size: 3rem; }
    .sarc-table { font-size: 0.8rem; }
    .sarc-table thead th, .sarc-table tbody td { padding: 8px; }
}
