* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: linear-gradient(to bottom, #f4f4f4, #e0e0e0);
  color: #333;
}

/* ===== Navbar ===== */
.navbar {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-top {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid #eee;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #573b8a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.site-title {
  font-size: 20px;
  font-weight: bold;
  color: #573b8a;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.logout-btn, .login-btn, .create-btn, .add-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.logout-btn {
  background: #e53935;
  color: #fff;
}

.logout-btn:hover {
  background: #c62828;
}

.login-btn {
  background: #573b8a;
  color: #fff;
}

.login-btn:hover {
  background: #6d44b8;
}

.create-btn {
  background: #198754;
  color: #fff;
}

.create-btn:hover {
  background: #157347;
}

.add-btn {
  background: #198754;
  color: #fff;
}

.add-btn:hover {
  background: #157347;
}

.navbar-bottom {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background: #f9f9f9;
}

.nav-link {
  color: #573b8a;
  text-decoration: none;
  font-weight: bold;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #6d44b8;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #573b8a;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== Blog Cards ===== */
.blog-container {
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 1fr; /* يساعد على توحيد ارتفاع الصفوف */
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px; /* ارتفاع أدنى احتياطي (يمكن تعديله) */
}

.blog-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.blog-card img {
  width: 100%;
  height: 220px; 
  object-fit: cover; 
  display: block;
  transition: transform 0.3s ease;
}

.blog-card:hover img {
  transform: scale(1.05);
}

.menu-dots {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.menu-dots:hover {
  background: rgba(0,0,0,0.8);
}

.card-content {
  padding: 20px;
  flex-grow: 1; /* يجعل المحتوى يملأ المساحة المتبقية */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 20px;
  font-weight: bold;
  color: #573b8a;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #777;
}

.comments {
  display: flex;
  align-items: center;
  gap: 6px;
}

a:link, a:visited {
  text-decoration: none;
  color: inherit;
}