@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600&display=swap');

/* 🎨 المتغيرات الأساسية */
:root {
  --primary: #0078ff;
  --bg: #f4f6fa;
  --card-bg: #fff;
  --muted: #777;
  --border: #e5e9f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
  --btn-bg: var(--primary);
  --btn-hover: #005fd1;
  --text: #222;
}
.hidden { display: none; }
.icon-btn { background:none; border:none; cursor:pointer; font-size:18px; }
.btn:hover { opacity:0.8; }
a{
    text-decoration:none;
}
/* 🌙 الوضع الليلي */
body.dark-mode {
  --bg: #121212;
  --card-bg: #1e1e1e;
  --text: #e4e4e4;
  --muted: #aaa;
  --border: #2c2c2c;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --btn-bg: #2d6cdf;
  --btn-hover: #498cff;
}

/* إعدادات عامة */
* {
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* زر تبديل الثيم */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  margin-right: 10px;
  transition: transform 0.3s ease;
}
.theme-toggle:hover { transform: rotate(15deg) scale(1.1); }

/* شريط الأعلى */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.topbar .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.topbar nav a {
  margin: 0 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.topbar nav a.active,
.topbar nav a:hover {
  color: var(--primary);
}

/* تخطيط عام */
.fb-layout {
  background: var(--bg);
  min-height: 100vh;
}
.main-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  padding: 20px;
}

/* الغلاف */
.profile-cover {
  position: relative;
  text-align: center;
  background: var(--card-bg);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.cover-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0 0 10px 10px;
}
.upload-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  background: var(--btn-bg);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.upload-btn:hover { background: var(--btn-hover); }

/* المعلومات الشخصية */
.profile-info {
  position: relative;
  margin-top: -60px;
  
    text-align: center;

}
.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
}
.upload-avatar {
  position: absolute;
  top: 20px;
  left: calc(50% + 40px);
  background: var(--btn-bg);
  color: #fff;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
}
.upload-avatar:hover { background: var(--btn-hover); }
.btn-edit, .btn-cv {
  background: #eee;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  margin: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-edit:hover, .btn-cv:hover { background: var(--btn-hover); color: #fff; }
body.dark-mode .btn-edit, body.dark-mode .btn-cv {
  background: #2a2a2a;
  color: var(--text);
}
body.dark-mode .btn-edit:hover, body.dark-mode .btn-cv:hover {
  background: var(--btn-hover);
  color: #fff;
}

/* الكروت */
.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 15px;
  border: 1px solid var(--border);
}
.card h4 { margin-top: 0; }

/* النصوص والمحتوى */
.muted { color: var(--muted); }

/* المنشورات */
.create-post textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  padding: 10px;
  resize: none;
}
.post-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.btn-media {
  background: #eee;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #333;
}
body.dark-mode .btn-media {
  background: #2a2a2a;
  color: var(--text);
}
.posts .post {
  background: var(--card-bg);
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* الأزرار */
.btn-primary {
  background: var(--btn-bg);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary:hover { background: var(--btn-hover); }

/* الرسائل */
.msg-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 10px;
}
body.dark-mode .msg-success {
  background: #1f3a2e;
  color: #9fe6a0;
  border-color: #2d6c4f;
}
.msg-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 10px;
}
body.dark-mode .msg-error {
  background: #3b2224;
  color: #f4a6a9;
  border-color: #7a3b3f;
}
.msg-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  border-radius: 8px;
  padding: 10px;
}
body.dark-mode .msg-info {
  background: #1b2e35;
  color: #8ad1e0;
  border-color: #27555e;
}

/* الفوتر */
.footer {
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 13px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

/* 📱 تحسينات الموبايل */
@media(max-width: 768px) {
  body {
    font-size: 15px;
  }

  .topbar {
    padding: 8px 12px;
  }

  .topbar .logo {
    font-size: 16px;
  }

  .topbar nav a {
    margin: 0 5px;
    font-size: 14px;
  }

  .theme-toggle {
    font-size: 1.1rem;
    margin-right: 5px;
  }

  .profile-cover {
    margin-bottom: 0;
  }

  .cover-img {
    height: 160px;
  }

  .profile-info {
    margin-top: -50px;
  }

  .avatar-img {
    width: 90px;
    height: 90px;
  }

  .btn-edit, .btn-cv {
    padding: 4px 8px;
    font-size: 13px;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .card {
    padding: 12px;
  }

  .create-post textarea {
    font-size: 14px;
    padding: 8px;
  }

  .btn-primary {
    padding: 6px 12px;
    font-size: 14px;
  }

  .footer {
    font-size: 12px;
    padding: 12px;
  }

  /* عرض القوائم كمربعات صغيرة */
  .sidebar-left, .sidebar-right {
    display: block;
    order: -1;
  }

  .sidebar-left .card ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
  }

  .sidebar-left .card ul li {
    list-style: none;
    margin: 4px;
  }

  .sidebar-left .card ul a {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-block;
  }
  
}
/* 📱 تحسين واجهة تسجيل الدخول والتسجيل */
.auth-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  padding: 40px;
}

.auth-section .info-box,
.auth-section .auth-box {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
}

.auth-section .info-box {
  flex: 1;
  max-width: 500px;
}

.auth-section .auth-box h2 {
  margin-bottom: 15px;
  color: var(--primary);
}

.auth-section .input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.auth-logo img {
  width: 80px;
  margin-bottom: 5px;
}

.auth-logo p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.account-types {
  padding-right: 20px;
}

.account-types li {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

/* ⚙️ تحسين تخطيط تسجيل الدخول في الموبايل */
@media (max-width: 768px) {
  .auth-section {
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
  }

  .auth-section .info-box {
    order: 2;
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .auth-section .auth-box {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  .info-box ul {
    text-align: right;
    font-size: 13px;
    padding: 0;
  }

  .birthdate {
    flex-direction: column;
    gap: 5px !important;
  }
}

/* 📱 تحسين واجهة المستخدم بعد تسجيل الدخول */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .topbar .left, .topbar .center, .topbar .right {
    width: 100%;
    text-align: center;
  }

  .topbar .left input {
    width: 100% !important;
    margin-top: 5px;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .sidebar-left, .sidebar-right {
    order: -1;
  }

  .feed .create-post textarea {
    font-size: 14px;
  }

  .btn-primary {
    width: 100%;
  }

  .profile-info {
    margin-top: -40px;
  }

  .avatar-img {
    width: 80px;
    height: 80px;
  }

  .cover-img {
    height: 140px;
  }

  .btn-edit, .btn-cv {
    font-size: 13px;
    padding: 4px 8px;
  }
}

/* 📱 دعم إضافي للشاشات الصغيرة جدًا (أقل من 480px) */
@media (max-width: 480px) {
  .auth-section {
    padding: 10px;
  }

  .auth-section .info-box, 
  .auth-section .auth-box {
    padding: 15px;
  }

  .auth-section h3 {
    font-size: 18px;
  }

  .auth-section p, 
  .auth-section li {
    font-size: 13px;
  }

  .btn-primary {
    font-size: 14px;
    padding: 8px;
  }

  .topbar input {
    font-size: 13px;
  }
}
/* 📱 تحويل القائمة اليمنى إلى شريط سفلي عند العرض من الموبايل */
@media (max-width: 768px) {
  /* إخفاء القائمة اليسرى */
  .sidebar-left {
    display: none !important;
  }

  /* تحويل القائمة اليمنى إلى شريط سفلي */
  .sidebar-right {
      display:none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    z-index: 1000;
  }

  .sidebar-right .card {
    background: transparent;
    box-shadow: none;
    border: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0;
  }

  .sidebar-right .card h4,
  .sidebar-right .card p {
    display: none; /* إخفاء النصوص لتظهر فقط الأيقونات */
  }

  .sidebar-right .nav-item {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sidebar-right .nav-item span {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
  }

  /* مساحة إضافية أسفل الصفحة حتى لا تختفي المحتويات خلف الشريط */
  body {
    padding-bottom: 70px;
  }
}
 #requestsPopup.show {
    display:block !important;
    opacity:1 !important;
    transform:translateY(0) !important;
  }
/* 📱 شاشات أصغر (أقل من 480px) */
@media (max-width: 480px) {
  .sidebar-right {
    padding: 6px 0;
  }

  .sidebar-right .nav-item {
    font-size: 16px;
  }

  .sidebar-right .nav-item span {
    font-size: 10px;
  }

  body {
    padding-bottom: 60px;
  }
}
btn-add{
  --pad-x: 16px;
  --pad-y: 10px;

  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1;
  color: white;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  transition: transform .14s cubic-bezier(.2,.9,.2,1), box-shadow .14s, opacity .12s;
  will-change: transform, box-shadow;
  user-select: none;
}

/* أيقونة داخل الزر */
.btn-add .icon{
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 18px;
  stroke: rgba(255,255,255,0.95);
  fill: none;
}

/* تأثير عند المرور والضغط */
.btn-add:hover{
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 34px rgba(79,70,229,0.18);
}
.btn-add:active{
  transform: translateY(-1px) scale(.995);
  box-shadow: var(--shadow-sm);
}

/* حالة الوصول (تركّز بلوحة المفاتيح) */
.btn-add:focus{
  outline: 3px solid rgba(124,92,255,0.18);
  outline-offset: 4px;
}

/* نسخة مضمّنة صغيرة (اختياري للهواتف) */
@media (max-width:420px){
  .btn-add{ padding:8px 12px; font-size:14px; gap:8px; border-radius:10px;}
  .btn-add .icon{ width:16px; height:16px;}
}

/* ===== التموضع ===== */
/* العنصر الحاوي للزر في الوسط */
.center-area{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:24px 0;
}

/* زر موزع إلى يسار المحتويات داخل صف */
.content-row{
  display:flex;
  align-items:flex-start;
  gap:18px;
  padding:18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-radius: 14px;
}

/* نسخة اليسار: مظهر أخف (outline) مناسب لتراكب على محتوى */
.btn-add--left{
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: var(--accent);
  box-shadow: none;
  border: 1px solid rgba(79,70,229,0.10);
  padding: 9px 12px;
  font-weight: 700;
}

/* hover / focus خاص بالنسخة اليسار */
.btn-add--left:hover{
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}

/* مثال تنسيق للمحتوى بجانب زر اليسار */
.main-content{
  min-width:0;
  flex:1;
}