/* ========== متغيرات الألوان والخط ========== */
:root {
  --primary-color: #2FAE97;    /* لون الهيدر/الفوتر */
  --text-light:   #ffffff;     /* نص الهيدر/الفوتر */
  --bg-body:      #f4f4f4;     /* خلفية الصفحة العامّة */
  --font-family:  'Tajawal', sans-serif;
}

/* ========== القاعدة العامة ========== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  direction: rtl;
  background: var(--bg-body);
  color: #333;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;       /* توسيط المحتوى أفقياً */
  justify-content: flex-start;
}

/* ========== الهيدر ========== */
header {
  background: var(--primary-color);
  color: var(--text-light);
}
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 10px;       /* هامش جانبي موحد */
}
.site-title {
  font-size: 1.4rem;
  margin: 0;
}
.logo {
  height: 50px;
}

/* ========== الصفحة الرئيسية ========== */
.homepage {
  justify-content: center;
  align-items: center;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 90%;
  max-width: 300px;
  text-align: center;
  margin-top: 20px;
}
.option-box {
  background: var(--primary-color);
  color: var(--text-light);
  padding: 15px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  width: 100%;
}
.option-box:hover {
  opacity: 0.9;
}

.option-box1 {
  background: #217a6a !important; /* لون مميز وثابت */
  color: var(--text-light) !important;
  padding: 15px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  width: 100%;
  display: inline-block;
}
.option-box1:hover {
  opacity: 0.9;
}


/* ========== عنوان النموذج ========== */
.form-title {
  text-align: center;
  margin: 30px 0 20px;
  font-size: 1.8rem;
  font-weight: 700;
}

/* ========== النماذج العمودية ========== */
.vertical-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 95%;               /* لا يتجاوز 90% من الصفحة */
  max-width: 600px;
  margin: 0 auto 20px;
}
.vertical-form label {
  font-weight: 600;
}
.vertical-form input,
.vertical-form select {
  width: 80%;               /* حقل التعبئة 80% من عرض النموذج */
  margin: 0 auto;
  padding: 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.vertical-form button.btn-primary {
  width: 80%;
  margin: 0 auto;
  padding: 14px;
  font-size: 1.1rem;
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.vertical-form button.btn-primary:hover {
  opacity: 0.9;
}

/* ========== صفحة الإدارة ========== */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 0 20px;          /* هامش جانبي موحد */
}
.btn-logout {
  background: #f44336;
  color: var(--text-light);
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}
.forms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 auto 30px;
  padding: 0 20px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.inline-form input,
.inline-form select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.inline-form button {
  padding: 10px 16px;
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  cursor: pointer;
}
.inline-form button:hover {
  opacity: 0.9;
}

/* ========== جدول الطلاب ========== */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
thead {
  background: var(--primary-color);
  color: var(--text-light);
}
th, td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 0.95rem;
}
tr.pending {
  background: #ffebcc;
}
tr.approved {
  background: #eaffea;
}
.btn-action {
  padding: 4px 8px;
  background: #555;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}
.btn-action:hover {
  opacity: 0.8;
}

/* ========== الفوتر بعرض كامل الشاشة ========== */
footer {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
}
.footer-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
}
.footer-flex p {
  margin: 0;
  text-align: center;
  color: var(--text-light);
  width: 100%;
}

/* ========== تجاوب للشاشات الصغيرة ========== */
@media (max-width: 768px) {
  .inline-form,
  .filters form {
    flex-direction: column;
  }
  .admin-header {
    flex-direction: column;
    gap: 15px;
  }
  .options {
    max-width: 90%;
  }
  .vertical-form {
    width: 100%;
    padding: 10px;
    gap: 15px;
  }
  .form-title {
    font-size: 1.6rem;
  }
}

/* WhatsApp floating button */
.whatsapp-chat {
  position: fixed;
  bottom: 70px;
  right: 25px;
  z-index: 1000;
  text-align: center;
}

.whatsapp-chat a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.whatsapp-icon {
  width: 50px;
  height: 50px;
}

.whatsapp-text {
  margin-top: 5px;
  background: var(--primary-color);
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
}