@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    --primary: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column; /* جعل العناصر تتراص عمودياً (فوق وتحت) */
    justify-content: center; /* توسيط عمودي لمحتوى الحاوية */
    align-items: center; /* توسيط أفقي لمحتوى الحاوية */
    height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
    text-align: right;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 5px;
}

/* Lock Screen */
.lock-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.slider-container {
    width: 300px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    position: relative;
    margin-top: 50px;
    border: 2px solid rgba(255,255,255,0.5);
}

.slider-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    pointer-events: none;
}

.slider-handle {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: grab;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Header */
.app-header {
    background: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    cursor: pointer;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
}

.border-blue { border-color: var(--primary); }
.border-yellow { border-color: var(--warning); }
.border-red { border-color: var(--danger); }

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 180px;
    z-index: 100;
    flex-direction: column;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-menu a {
    padding: 12px;
    text-decoration: none;
    color: var(--dark);
    border-bottom: 1px solid #f3f4f6;
}

/* Complaint Button */
.complaint-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px;
}

.stat-box {
    background: white;
    padding: 15px 5px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 5px;
}

.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-blue { color: var(--primary); }

/* Chat Button */
.chat-btn {
    display: block;
    width: 90%;
    margin: 20px auto;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.question-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-answer {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-yes { background: var(--success); color: white; }
.btn-no { background: var(--danger); color: white; }

/* --- Profile Page Styles --- */
.profile-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.profile-avatar-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary);
    margin-bottom: 10px;
}

.upload-btn {
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.success-alert {
    padding: 10px;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.error-alert {
    padding: 10px;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* --- Settings and Profile Display --- */
.info-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 0.95rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #6b7280;
    font-weight: 600;
}

.info-value {
    font-weight: bold;
    color: var(--dark);
}

/* Tabs for Settings Page */
.tabs-header {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    color: #9ca3af;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Schedule Display */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.schedule-box {
    background: var(--light);
    padding: 10px 5px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.schedule-box h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: var(--primary);
}
.schedule-box p {
    margin: 0;
    font-size: 0.8rem;
    font-weight: bold;
}