body{
    font-family: Arial, sans-serif;
    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%;
}

/* ===== Post Styles ===== */
.post {
  width: 700px;
  
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  padding: 25px;
  transition: box-shadow 0.3s ease;
}

.post:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.user-info {
  font-size: 16px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info strong {
  color: #573b8a;
}

.post-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.post-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.post-title {
  font-size: 24px;
  font-weight: bold;
  color: #573b8a;
  margin: 15px 0 10px;
}

.post-content {
  color: #333;
  line-height: 1.8;
  font-size: 16px;
}

.actions button {
  border: none;
  padding: 8px 16px;
  margin-left: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.edit {
  background: #ffc107;
  color: #333;
}

.edit:hover {
  background: #e0a800;
}

.delete {
  background: #dc3545;
  color: #fff;
}

.delete:hover {
  background: #bb2d3b;
}

.add-comment {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.add-comment input {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  transition: border 0.3s ease;
}

.add-comment input:focus {
  border-color: #573b8a;
  outline: none;
}

.add-comment button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background: #573b8a;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.add-comment button:hover {
  background: #6d44b8;
}

.comments {
  margin-top: 25px;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.comment {
  border-bottom: 1px solid #eee;
  padding: 15px 0;
}

.comment-user {
  font-weight: bold;
  font-size: 15px;
  color: #573b8a;
}

.comment-content {
  font-size: 14px;
  margin: 8px 0;
  color: #555;
}

.comment-actions button {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 5px;
  background: #dc3545;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.comment-actions button:hover {
  background: #bb2d3b;
}

/* Form Styles for Add/Edit */
.post form input, .post form textarea, .post form select {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  transition: border 0.3s ease;
}

.post form input:focus, .post form textarea:focus, .post form select:focus {
  border-color: #573b8a;
  outline: none;
}

.post form textarea {
  min-height: 150px;
  resize: vertical;
}

.post form button {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  background: #198754;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.post form button:hover {
  background: #157347;
}

.img_dis{
  text-align: center;
width: 50% !important;

}

    .post-form {
  
      align-items: center;
        max-width: 600px;
        margin: 40px auto;
        padding: 30px;
        background-color: #ffffff;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        direction: rtl;
        text-align: right;
    }

    .form-group {
        margin-bottom: 25px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
        font-size: 15px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        width: 100%;
        padding: 12px 5px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        font-size: 16px;
        transition: all 0.3s ease;
        background-color: #f9f9f9;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        outline: none;
        border-color: #198754;
        background-color: #ffffff;
        box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
    }

    .form-select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592c.859 0 .313 1.013-.253 1.658l-4.796 5.482a1 1 0 0 1-1.494 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 15px center;
        padding-right: 40px;
        cursor: pointer;
    }

    .form-textarea {
        min-height: 180px;
        resize: vertical;
        line-height: 1.7;
    }

    .form-actions {
        margin-top: 30px;
        text-align: center;
    }

    .submit-btn {
        padding: 12px 30px;
        border: none;
        border-radius: 8px;
        background-color: #198754;
        color: #ffffff;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .submit-btn:hover {
        background-color: #157347;
    }

    input[readonly] {
        background-color: #f0f0f0;
        font-weight: bold;
        cursor: default;
    }