/* Base Styles & Warm Palette */
:root {
  --bg-color: #fffaf5;
  --card-bg: #ffffff;
  --primary: #e67e22;
  --primary-hover: #d35400;
  --text-color: #2c3e50;
  --text-muted: #7f8c8d;
  --border-color: #f1e4d8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--primary);
}

.admin-link {
  font-size: 0.9rem;
  color: var(--text-muted) !important;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(180deg, #fff2e3 0%, var(--bg-color) 100%);
}

.hero h1 {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.tagline {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Container & Feed Layout */
.container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.feed-header {
  margin-bottom: 1.5rem;
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.post-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.author-badge {
  background-color: #fdebd0;
  color: var(--primary-hover);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

/* Comments Placeholder */
.comments-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.comments-section h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment-input-box {
  display: flex;
  gap: 0.5rem;
}

.comment-input-box input {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
}

.comment-input-box button {
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Form Container & Card */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.form-card h2 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

/* Radio Toggle Options */
.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.3rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: normal !important;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: var(--primary-hover);
}

/* Alert Message Box */
.message-box {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
}

.message-box.success {
  background-color: #d4edda;
  color: #155724;
}

.message-box.error {
  background-color: #f8d7da;
  color: #721c24;
}

/* Password Input Styling */
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

/* Auth Card */
.auth-card {
  max-width: 420px;
  margin: 2rem auto;
}

/* Admin Specific Elements */
.badge {
  font-size: 0.75rem;
  background-color: var(--primary);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  vertical-align: middle;
}

.status-badge.pending {
  background-color: #fff3cd;
  color: #856404;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.post-title {
  margin: 0.5rem 0;
  color: var(--text-color);
  font-size: 1.2rem;
}

/* Moderation Buttons */
.admin-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-approve {
  background-color: #27ae60;
  color: white;
}

.btn-approve:hover {
  background-color: #219653;
}

.btn-reject {
  background-color: #e74c3c;
  color: white;
}

.btn-reject:hover {
  background-color: #c0392b;
}

.logout-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

/* Mobile Responsiveness Rules */
@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
    text-align: center;
  }

  .nav-links {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .nav-links a {
    margin: 0 0.6rem;
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .container {
    padding: 0 0.8rem;
    margin: 1.2rem auto;
  }

  .form-card {
    padding: 1.2rem;
  }

  .radio-group {
    flex-direction: column;
    gap: 0.6rem;
  }

  .admin-actions {
    flex-direction: column;
  }
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.2rem;
}

.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

/* User Profile Menu & Avatar in Navbar */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background-color: #fcebe1;
  transition: background-color 0.2s;
}

.user-menu:hover {
  background-color: #f8d7c4;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-nickname {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-hover);
}

.logout-btn-nav {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

/* Author Avatar in Post Card */
.author-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Modal Popup Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.profile-preview {
  text-align: center;
  margin: 1rem 0;
}

.profile-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

/* Comments Styling */
.comments-list {
  margin: 0.8rem 0;
}

.comment-item {
  background-color: #fdf8f4;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--primary);
}

/* Hamburger Toggle Button */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Sidebar Styling */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background-color: var(--card-bg);
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.sidebar.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.close-sidebar {
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Sidebar User Info Card */
.sidebar-user-box {
  background-color: #fcf4ec;
  padding: 1rem;
  border-radius: 10px;
  margin: 1.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
}

.sidebar-nickname {
  font-weight: 700;
  color: var(--text-color);
}

.edit-profile-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  padding: 0;
  margin-top: 2px;
}

/* Sidebar Menu Links */
.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sidebar-menu a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background-color: #fdebd0;
  color: var(--primary-hover);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Sidebar Overlay Backing */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

.text-center {
  text-align: center;
}

/* Admin Tabs Navigation */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.admin-tabs .tab-btn {
  padding: 10px 18px;
  border: 1px solid var(--border-color, #e0e0e0);
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #555;
  transition: all 0.2s ease;
}

.admin-tabs .tab-btn.active,
.admin-tabs .tab-btn:hover {
  background: var(--primary-color, #e67e22);
  color: #ffffff;
  border-color: var(--primary-color, #e67e22);
}

/* Action Buttons */
.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-approve { background: #2ecc71; color: white; }
.btn-reject { background: #e74c3c; color: white; }
.btn-edit { background: #3498db; color: white; }
.btn-delete { background: #e74c3c; color: white; }

/* Users Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  background: #f4f6f8;
  font-weight: 700;
}

.comment-quote {
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 10px 14px;
  margin: 10px 0;
  font-style: italic;
}

.empty-msg {
  text-align: center;
  color: #888;
  padding: 2rem;
}

/* Pinned Post Border Accent */
.post-card.pinned-card {
  border: 2px solid #f39c12;
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
}

/* Modal Overlay & Card */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

.close-modal:hover {
  color: #000;
}

/* Profile Page Layout */
.profile-container {
  max-width: 800px;
  margin: 30px auto;
}

.profile-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
}

.profile-banner {
  height: 120px;
  background: linear-gradient(135deg, #e67e22, #f39c12);
}

.profile-header-content {
  padding: 0 24px 24px 24px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  position: relative;
  top: -40px;
  margin-bottom: -30px;
  flex-wrap: wrap;
}

.profile-avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.profile-main-info {
  flex: 1;
}

.username-tag {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.bio-text {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.4;
}

.profile-actions {
  margin-top: 10px;
}

.profile-banner {
  height: 140px;
  background: linear-gradient(135deg, #e67e22, #f39c12);
  background-size: cover;
  background-position: center;
}