/* ---------- الأساسيات ---------- */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  direction: ltr;
}

html[lang="ar"] body {
  direction: rtl;
}

a {
  text-decoration: none;
  color: #007BFF;
  transition: color 0.3s;
}

a:hover {
  color: #0056b3;
}

/* ---------- الشريط العلوي (Header) ---------- */
header {
  background-color: #343a40;
  color: white;
  padding: 20px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo img {
  height: 80px;
}

/* ---------- معلومات المستخدم ---------- */
.user-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.user-info img {
  border-radius: 50%;
  height: 60px;
  width: 60px;
  object-fit: cover;
  border: 2px solid white;
  margin-left: 15px;
}

html[lang="ar"] .user-info img {
  margin-left: 0;
  margin-right: 15px;
}

.user-info a {
  padding: 8px 16px;
  background-color: #007BFF;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 15px;
  margin-left: 10px;
  margin-top: 5px;
  transition: background-color 0.3s;
}

html[lang="ar"] .user-info a {
  margin-left: 0;
  margin-right: 10px;
}

.user-info a:hover {
  background-color: #0056b3;
}

/* ---------- اختيار اللغة ---------- */
.language-selector {
  margin-top: 10px;
}

.language-selector a {
  color: #ffc107;
  margin: 0 5px;
  font-weight: bold;
}

.language-selector a:hover {
  text-decoration: underline;
}

/* ---------- قائمة الأقسام (Navigation) ---------- */
nav {
  background-color: #e9ecef;
  padding: 15px 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav select {
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

nav select:hover,
nav select:focus {
  border-color: #007BFF;
}

/* ---------- المحتوى الرئيسي ---------- */
main {
  padding: 30px 20px;
  max-width: 100%;
  margin: 0 auto;
}

h2 {
  text-align: center;
  color: #343a40;
  margin-bottom: 20px;
}

/* ---------- بطاقات المنشورات ---------- */
.posts-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}


.post-card {
  flex: 1 1 220px;
  max-width: 250px;
  min-width: 200px;
  box-sizing: border-box;
  padding: 20px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.post-card:hover {
  transform: scale(1.02);
}


.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-card img {
  border-radius: 50%;
  height: 80px;
  width: 80px;
  object-fit: cover;
  margin-bottom: 15px;
  border: 2px solid #007BFF;
}

.post-card h3 {
  font-size: 20px;
  color: #007BFF;
  margin-bottom: 10px;
}

.post-card p {
  margin: 6px 0;
  color: #555;
  font-size: 15px;
}

.post-card a {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background-color: #007BFF;
  color: white;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.3s;
}

.post-card a:hover {
  background-color: #0056b3;
}

/* ---------- التذييل (Footer) ---------- */
footer {
  background-color: #343a40;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 30px;
  font-size: 14px;
}

.edit-container button {
  padding: 12px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.edit-container button:hover {
  color:yellow;
  background-color: #0056b3;
}
.back-button {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #6c757d;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 15px;
  transition: background-color 0.3s;
}

.back-button:hover {
  color:yellow;
  background-color: #5a6268;
}
.nav-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.new-post-button {
  padding: 8px 16px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.new-post-button:hover {
  color:yellow;
  background-color: #0056b3;
}
.top-bar {
    background-color: #007BFF;
    padding: 10px 20px;
    text-align: left;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.top-bar .home-button {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
.top-bar .home-button:hover {
    text-decoration: underline;
}
.description-text {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.post-container p {
    font-size: 16px;
    line-height: 1.6;
  width:90%;
    color: #333;
}
.comment-form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
}
.comment-form textarea {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 10px;
}
.comment-form button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}
.comment-form button:hover {
    background-color: #0056b3;
}
.comments-section {
    margin-top: 30px;
}
.comment {
    background-color: #fefefe;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.comment-user {
    font-weight: bold;
    color: #007BFF;
    margin-bottom: 5px;
}
.comment-text {
    margin-bottom: 5px;
}
.comment-date {
    font-size: 12px;
    color: #666;
}
.likes-section {
    margin-top: 20px;
}
.likes-section button {
    background-color: #FF5C5C;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}
.likes-section button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
