@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
    --primary: #0f172a; 
    --primary-light: #1e293b;
    --accent: #facc15; 
    --accent-hover: #eab308;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); padding-bottom: 30px; }

/* --- الهيدر --- */
header { background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%); border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; padding: 15px 20px 40px; color: white; position: relative; overflow: hidden; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; max-width: 1100px; margin: 0 auto 30px auto; }
.btn-register { background: var(--accent); color: #1e293b; border: none; padding: 8px 12px; border-radius: 8px; font-weight: 800; font-family: 'Cairo', sans-serif; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; cursor: pointer; z-index: 2; }
.btn-register:hover { background: var(--accent-hover); }
.logo-container { display: flex; align-items: center; gap: 10px; z-index: 2; }
.logo-icon { font-size: 2rem; }
.logo-text h1 { font-size: 1.4rem; font-weight: 900; margin: 0; line-height: 1.2;}
.logo-text p { font-size: 0.7rem; margin: 0; color: #94a3b8; }
.menu-btn { background: none; border: none; cursor: pointer; z-index: 2;}
.hero-section { text-align: right; position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; }
.hero-text h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 10px; line-height: 1.3;}
.hero-text h2 span { color: var(--accent); }
.hero-text p { font-size: 0.95rem; color: #cbd5e1; }
.hero-image { position: absolute; left: 0; top: -20px; opacity: 0.8; font-size: 5rem; transform: rotate(-15deg); }

/* --- الفلاتر --- */
#filters-section { padding: 0 15px; margin-top: -25px; position: relative; z-index: 3; max-width: 1100px; margin-left: auto; margin-right: auto; }
.filters-card { background: var(--white); border-radius: 20px; padding: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.search-input-group { display: flex; align-items: center; background: var(--bg-color); border: 1px solid var(--border); border-radius: 12px; padding: 10px 15px; margin-bottom: 15px; }
.search-input-group input { border: none; background: transparent; width: 100%; padding-right: 10px; font-family: 'Cairo', sans-serif; font-size: 0.95rem; outline: none; }
.filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.select-wrapper { position: relative; display: flex; align-items: center; background: var(--bg-color); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.select-icon { font-size: 1.1rem; margin-left: 5px; }
.select-wrapper select { border: none; background: transparent; width: 100%; font-family: 'Cairo', sans-serif; font-size: 0.85rem; font-weight: 700; color: var(--text-main); outline: none; appearance: none; }

/* --- كروت المدرسين (تعديل الكمبيوتر) --- */
#teachers-container { 
    padding: 20px 15px; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* بيخلي الكروت جنب بعض */
    gap: 20px; 
    max-width: 1100px;
    margin: 0 auto;
}

.teacher-card { background: var(--white); border-radius: 20px; padding: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); display: flex; flex-direction: column; position: relative; border: 1px solid var(--border); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;}
.teacher-avatar-container { position: relative; }

.teacher-avatar {
    width: 65px; 
    height: 65px; 
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #bfdbfe 100%);
    color: #1e3a8a;
    display: flex; 
    justify-content: center; 
    align-items: center;
    font-size: 1.8rem; 
    font-weight: 800;
    border: 2px solid var(--accent);
}

.verified-badge { position: absolute; bottom: 0; left: 0; background: #3b82f6; border-radius: 50%; width: 20px; height: 20px; display: flex; justify-content: center; align-items: center; color: white; font-size: 12px; border: 2px solid white; }
.teacher-header-info { flex: 1; margin-right: 15px; text-align: right; }
.teacher-header-info h3 { font-size: 1.2rem; color: #1e3a8a; font-weight: 800; margin-bottom: 5px; }
.teacher-details { margin-bottom: 15px; display: flex; flex-direction: column; gap: 6px;}
.detail-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600;}
.detail-row span.icon { font-size: 1.1rem; }
.detail-row span.val { color: var(--text-main); }

.card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 15px;}
.rating-badge { background: #fef3c7; color: #d97706; padding: 6px 12px; border-radius: 8px; font-weight: 800; display: flex; align-items: center; gap: 4px; font-size: 0.9rem; }

.action-buttons { display: flex; gap: 8px; }
.card-actions-row { display: flex; gap: 10px; margin-top: 12px;}
.action-btn { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; border-radius: 10px; border: none; font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.85rem; cursor: pointer; flex: 1; transition: 0.2s; }
.btn-wa { background: var(--success); color: white; }
.btn-wa:hover { background: #16a34a; }
.btn-rate { background: var(--accent); color: #1e293b; }
.btn-rate:hover { background: var(--accent-hover); }
.btn-share { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }
.btn-share:hover { background: #e2e8f0; }

/* --- النوافذ (Modals) --- */
.modal { display: none; position: fixed; z-index: 1000; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); overflow-y: auto; }
.modal-content { background: var(--white); margin: 10vh auto; padding: 24px; border-radius: 20px; max-width: 400px; width: 90%; position: relative; }
.close-btn { position: absolute; top: 15px; left: 15px; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.modal-title { text-align: center; color: var(--primary); margin-bottom: 20px; font-size: 1.3rem;}
.form-group { margin-bottom: 15px; text-align: right; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 700; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-family: 'Cairo'; outline: none; background: var(--bg-color); }
.form-group input:focus, .form-group select:focus { border-color: #3b82f6; }
.checkbox-group { display: flex; gap: 10px; background: var(--bg-color); padding: 10px; border-radius: 10px; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; font-weight: 600; margin-bottom: 0; font-size: 0.85rem;}
.btn-primary { width: 100%; padding: 12px; background: #2563eb; color: white; border: none; border-radius: 10px; font-family: 'Cairo'; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 10px;}
.btn-warning { width: 100%; padding: 12px; background: var(--warning); color: white; border: none; border-radius: 10px; font-family: 'Cairo'; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 10px;}
.msg-text { text-align: center; font-weight: 700; font-size: 0.85rem; margin-top: 10px; }

/* --- شاشات الكمبيوتر (تظبيط الفلاتر) --- */
@media (min-width: 768px) {
    .filters-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-text h2 { font-size: 2.2rem; }
}