/* General site-wide styles */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  width: 100%;
  min-height: 100vh;
  min-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation styles */
nav {
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: #3a7bd5;
  text-decoration: none;
  margin: 0 10px;
  font-weight: 500;
}

nav a:hover {
  text-decoration: underline;
}

nav button {
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

nav button:hover {
  opacity: 0.9;
}

.nav-create-post {
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  margin-right: 10px;
  font-weight: 500;
  display: inline-block;
  transition: opacity 0.2s ease;
}

.nav-create-post:hover {
  opacity: 0.9;
  text-decoration: none;
}

.nav-logout-form {
  display: inline;
  margin-left: 10px;
}

.nav-logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

.nav-logout-btn:hover {
  background: #c82333;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Messages */
.messages {
  margin: 20px 0;
}

.messages .alert {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.messages .alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.messages .alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.messages .alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(58, 123, 213, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
  box-shadow: 0 7px 14px rgba(108, 117, 125, 0.3);
}

/* Enhanced Form styles */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.form-control:focus {
  outline: none;
  border-color: #3a7bd5;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.2);
  background-color: var(--bg-secondary);
}

.form-control:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Enhanced Button styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(58, 123, 213, 0.25);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(58, 123, 213, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #5a6268 0%, #727b84 100%);
  box-shadow: 0 7px 14px rgba(108, 117, 125, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #d62c1a 100%);
  box-shadow: 0 7px 14px rgba(220, 53, 69, 0.4);
}

/* Card styles */
.card {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Enhanced Navigation Styles */
nav {
  background: var(--bg-secondary);
  padding: 0.8rem 2rem;
  box-shadow: var(--nav-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 10px;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
}

nav a:hover {
  color: #00d2ff;
  text-decoration: none;
  background-color: rgba(58, 123, 213, 0.1);
}

.nav-logo {
  color: white !important;
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
}

.nav-logo:hover {
  color: white !important;
  background: linear-gradient(135deg, #2e63b8 0%, #00b8e6 100%);
  text-decoration: none;
}

.nav-profile {
  color: var(--text-primary) !important;
}

.nav-profile:hover {
  color: white !important;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

/* Center section keeps the logo centered */
.nav-center {
  flex: 1;
  justify-content: center;
}

/* Profile on the far left */
.nav-left {
  gap: 12px;
}

/* Links/buttons on the right with proper spacing */
.nav-right {
  gap: 16px;
  align-items: center;
}

.nav-logo {
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white !important;
  box-shadow: 0 4px 12px rgba(58, 123, 213, 0.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo:hover {
  text-decoration: none;
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(58, 123, 213, 0.35);
}

.nav-profile {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.nav-profile:hover {
  text-decoration: none;
  background-color: rgba(58, 123, 213, 0.1);
}

.nav-profile-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e1e5e9;
}

.nav-profile-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid #e1e5e9;
}

.nav-display-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 16px;
}

.nav-create-post {
  background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(58, 123, 213, 0.3);
  font-size: 15px;
}

.nav-create-post:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(58, 123, 213, 0.4);
}

.nav-follow-requests {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-follow-requests:hover {
  color: #00d2ff;
  background-color: rgba(58, 123, 213, 0.1);
}

.nav-logout-form {
  display: inline;
  margin-left: 8px;
}

.nav-logout-btn {
  background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
}

.nav-logout-btn:hover {
  background: linear-gradient(135deg, #c82333 0%, #d62c1a 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* Profile Page Styles */
.profile-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.profile-header {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 30px;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-img-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f0f0f0;
}

.profile-placeholder-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

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

.profile-display-name {
  color: var(--text-primary);
  font-size: 28px;
  margin: 0 0 10px 0;
}

.profile-links {
  margin-bottom: 15px;
}

.github-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.github-link:hover {
  color: #00d2ff;
}

.profile-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.profile-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.follow-form {
  display: inline;
}

.profile-content {
  margin-bottom: 30px;
}

.profile-posts-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 30px;
  border: 1px solid var(--border-color);
}

.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.posts-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
}

.posts-actions {
  display: flex;
  gap: 10px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3a7bd5, #00d2ff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover::before {
  opacity: 1;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
  border-color: #3a7bd5;
}

.post-card h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: var(--text-primary);
  font-weight: 600;
}

.post-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card h3 a:hover {
  color: #00d2ff;
}

.post-description, .post-content {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 15px;
}

.post-image-preview {
  margin: 15px 0;
}

.post-thumbnail {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  max-height: 200px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

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

.post-meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.no-posts {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Edit Profile Page Styles */
.edit-profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.edit-profile-header {
  text-align: center;
  margin-bottom: 30px;
}

.edit-profile-header h1 {
  color: var(--text-primary);
  font-size: 32px;
  margin: 0 0 10px 0;
}

.edit-profile-header p {
  color: var(--text-secondary);
  margin: 0;
}

.edit-profile-form-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 30px;
  border: 1px solid var(--border-color);
}

.edit-profile-form {
  width: 100%;
}

.profile-image-section, .profile-info-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eee;
}

.profile-image-section h3, .profile-info-section h3 {
  color: var(--text-primary);
  margin: 0 0 20px 0;
  font-size: 20px;
}

.profile-image-preview {
  text-align: center;
  margin-bottom: 20px;
}

.current-profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}

.profile-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3a7bd5;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 5px;
}

.form-error {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 5px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* Stream Page Styles */
.stream-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

.header-content {
  text-align: left;
}

.header-content h1 {
  color: #333;
  font-size: 32px;
  margin: 0 0 5px 0;
}

.header-content p {
  color: #666;
  font-size: 18px;
  margin: 0;
}

.header-actions {
  margin-left: auto;
}

.section-title {
  color: #333;
  font-size: 24px;
  margin-bottom: 20px;
  border-bottom: 2px solid #3a7bd5;
  padding-bottom: 10px;
}

.author-posts {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.author-name {
  color: var(--text-primary);
  font-size: 20px;
  margin-bottom: 15px;
}

.author-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.author-name a:hover {
  color: #00d2ff;
  text-decoration: underline;
}

.stream-post-card, .post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--text-primary);
}

.stream-post-card:hover, .post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.post-header {
  margin-bottom: 15px;
}

.post-author a {
  color: #3a7bd5;
  font-weight: 600;
  text-decoration: none;
  font-size: 16px;
}

.post-author a:hover {
  text-decoration: underline;
}

.post-meta {
  color: #666;
  font-size: 14px;
  margin-top: 5px;
}

.post-title {
  margin: 10px 0;
  font-size: 20px;
}

.post-title a {
  color: #333;
  text-decoration: none;
}

.post-title a:hover {
  color: #3a7bd5;
  text-decoration: none;
}

.post-description, .post-content {
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Constrain images in rendered markdown content */
.post-content img,
.post-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 10px 0;
}

.post-image-container {
  margin: 15px 0;
  text-align: center;
}

.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-actions {
  margin-top: 15px;
  text-align: right;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.section-divider {
  border: 0;
  border-top: 1px solid #e1e5e9;
  margin: 30px 0;
}

.no-posts {
  color: #666;
  font-style: italic;
  margin: 10px 0;
}

.empty-state {
  text-align: center;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 20px;
}

.empty-state h3 {
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  color: #666;
  margin: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination a, .page-info {
  padding: 10px 15px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  text-decoration: none;
  color: #3a7bd5;
  font-weight: 500;
}

.pagination a:hover {
  background: #f8f9fa;
}

/* ---- Create/Edit/Delete Post ---- */
.post-form-container {
  max-width: 900px;
  margin: 40px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 40px;
}

.post-form-header {
  text-align: center;
  margin-bottom: 25px;
}

.post-form-header h1 {
  font-size: 30px;
  color: #333;
  margin-bottom: 10px;
}

.post-form-header p {
  color: #666;
  font-size: 16px;
  margin: 0;
}

.post-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.post-form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.post-form .form-group {
  flex: 1;
  min-width: 280px;
  margin-bottom: 20px;
}

.post-form .form-group label {
  font-weight: 600;
  color: #555;
  display: block;
  margin-bottom: 8px;
}

.post-form .form-group input,
.post-form .form-group textarea,
.post-form .form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.post-form .form-group input:focus,
.post-form .form-group textarea:focus,
.post-form .form-group select:focus {
  border-color: #3a7bd5;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.2);
  outline: none;
}

.post-form .form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.post-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #3a7bd5;
  color: white;
  border: none;
}

.btn-primary:hover {
  background: #316ac9;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* ---- Delete Post ---- */
.delete-post-container {
  max-width: 700px;
  margin: 60px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 40px;
  text-align: center;
}

.delete-post-container h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 15px;
}

.delete-post-container p {
  color: #555;
  margin-bottom: 25px;
}

.delete-post-container .form-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-danger {
  background: #d9534f;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #c9302c;
}

/* --- Enhanced Post Detail Page --- */
.post-detail-container {
  max-width: 900px;
  margin: 30px auto;
  background: var(--bg-secondary) !important;
  border-radius: 12px;
  box-shadow: var(--card-shadow) !important;
  padding: 40px !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* --- Header --- */
.post-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-detail-header h1,
.post-title-group h1 {
  font-size: 34px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.post-detail-meta {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-author-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}
.post-author-link:hover {
  color: #00d2ff;
  text-decoration: underline;
}

/* --- Image --- */
.post-detail-image-container {
  position: relative;
  margin: 20px 0 60px 0;
  text-align: left;
}

.post-detail-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Like button, count, and link on left under image */
.image-actions {
  position: absolute;
  bottom: -40px; /* under image */
  left: 0;       /* left corner */
  display: flex;
  align-items: center;
  gap: 8px;      /* spacing between button and count */
}

.btn-like {
  background: #3a7bd5;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-like:hover {
  background: #2d66b1;
}

.like-count {
  font-weight: 500;
  color: #555;
}

.link-view-likes {
  color: #3270c6;
  text-decoration: none;
  font-weight: 500;
}
.link-view-likes:hover {
  text-decoration: underline;
}

/* Copy button on right under image */ 
.btn-copy {
  display: flex;
  margin-left: auto;
  background: #eef2ff;
  color: #3a7bd5;
  border: none;
  padding: 6px 12px;
  margin-top: 6px;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: #dce4ff;
}

.post-actions-bar {
  display: none;
}

/* --- Divider --- */
.divider {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 20px 0;
}

/* --- Footer Buttons --- */
.post-footer-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #3a7bd5;
  color: white;
}
.btn-primary:hover {
  background: #2e63b8;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}
.btn-secondary:hover {
  background: #ddd;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}
.btn-danger:hover {
  background: #c0392b;
}

.btn-info {
  background: #3a7bd5;
  color: white;
}
.btn-info:hover {
  background: #2e63b8;
  box-shadow: 0 7px 14px rgba(58, 123, 213, 0.3);
}

/* --- Comments --- */
.comment-section h3 {
  color: var(--text-primary);
  border-bottom: 2px solid #3a7bd5;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.comment-form textarea {
  width: 100%;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 15px;
  min-height: 100px;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.comment-form textarea:focus {
  border-color: #3a7bd5;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.2);
  outline: none;
}

.comments-list {
  margin-top: 15px;
}

.comment-card,
.post-detail-container .comment-card {
  background: var(--bg-secondary) !important;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 15px;
  box-shadow: var(--card-shadow) !important;
  border: 1px solid var(--border-color) !important;
}

.comment-author {
  font-weight: 600;
  color: #00d2ff;
  margin-bottom: 5px;
}

.comment-content {
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-primary);
}

.btn-comment-like {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 15px;
  transition: color 0.3s ease;
}
.btn-comment-like:hover {
  color: #ff8e8e;
}

.no-comments {
  color: var(--text-secondary);
  text-align: center;
  margin-top: 20px;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .post-detail-container {
    padding: 20px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
  }
  .btn-copy {
    position: static;
    margin-top: 10px;
  }
  .post-actions-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .post-footer-actions {
    justify-content: center;
  }

  /* Mobile comment card styling */
  .comment-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
  }
}



/* ---- Delete Post Confirmation ---- */
.delete-confirm {
  max-width: 600px;
  margin: 80px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 40px;
  text-align: center;
}

.delete-confirm h2 {
  color: #c33;
  font-size: 26px;
  margin-bottom: 20px;
}

.delete-confirm p {
  color: #555;
  margin-bottom: 30px;
}

.delete-confirm .form-actions {
  justify-content: center;
}

/* ---- Author Posts Page ---- */
.author-posts-container {
  max-width: 1000px;
  margin: 0 auto;
}

.author-posts-header {
  text-align: center;
  margin-bottom: 30px;
}

.author-posts-header h1 {
  font-size: 30px;
  color: #333;
}

.author-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.author-post-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e1e5e9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.author-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.author-post-card h3 {
  margin: 0 0 10px 0;
}

.author-post-card p {
  color: #666;
  line-height: 1.5;
}

/* ---- Follow Requests ---- */
.follow-requests-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 30px;
}

.follow-request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 15px 0;
}

.follow-request-item:last-child {
  border-bottom: none;
}

.follow-request-info {
  color: #333;
  font-weight: 500;
}

.follow-request-actions {
  display: flex;
  gap: 10px;
}

/* ---- Post Likes ---- */
.likes-container {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 30px;
  border: 1px solid var(--border-color);
}

.likes-container h2 {
  color: var(--text-primary);
  font-size: 26px;
  margin-bottom: 20px;
}

.likes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.likes-list li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.likes-list li:last-child {
  border-bottom: none;
}

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

.like-info {
  color: var(--text-secondary);
}

.like-info strong {
  color: var(--text-primary);
}

.error-message {
  color: #ff6b6b;
  text-align: center;
  font-weight: 500;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;          /* crop overflow */
  border: 2px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* fill without distortion */
}

/* Modern UI enhancements */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  padding: 30px;
  margin-bottom: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #eef2f7;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Enhanced Stream Page Styles */
.stream-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 10px;
}

.header-content {
  text-align: left;
}

.header-content h1 {
  color: var(--text-primary);
  font-size: 36px;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.header-content p {
  color: var(--text-secondary);
  font-size: 18px;
  margin: 0;
}

.header-actions {
  margin-left: auto;
}

.section-title {
  color: var(--text-primary);
  font-size: 28px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  position: relative;
  font-weight: 700;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #3a7bd5, #00d2ff);
  border-radius: 2px;
}

.stream-post-card {
  background: white;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stream-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3a7bd5, #00d2ff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stream-post-card:hover::before {
  opacity: 1;
}

.stream-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
  border-color: #dce6f7;
}

.post-header {
  margin-bottom: 18px;
}

.post-author a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 17px;
  transition: color 0.2s ease;
}

.post-author a:hover {
  color: #00d2ff;
  text-decoration: underline;
}

.post-meta {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-title {
  margin: 12px 0;
  font-size: 22px;
  color: var(--text-primary);
  font-weight: 600;
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: #3a7bd5;
}

.post-description, .post-content {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  nav {
    padding: 1rem;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .nav-left, .nav-center, .nav-right {
    justify-content: center;
  }

  .nav-left, .nav-right {
    order: 2;
  }

  .nav-center {
    order: 1;
    margin: 10px 0;
  }

  main {
    padding: 15px;
  }

  .auth-box, .logout-box {
    padding: 30px 20px;
    margin: 0 10px;
  }

  .posts-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .stream-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    margin-left: 0;
    margin-top: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .stream-header h1 {
    font-size: 28px;
  }

  .section-title {
    font-size: 24px;
  }

  .post-card, .stream-post-card {
    padding: 20px;
  }

  .post-title {
    font-size: 20px;
  }

  .pagination {
    flex-direction: column;
    gap: 10px;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-info {
    width: 100%;
  }

  .profile-actions {
    align-items: center;
    width: 100%;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .nav-logo {
    font-size: 22px;
    padding: 6px 14px;
  }

  .header-content h1 {
    font-size: 28px;
  }

  .section-title {
    font-size: 22px;
  }

  .post-form {
    padding: 15px;
  }

  .post-form-row {
    flex-direction: column;
    gap: 15px;
  }

  .post-form .form-group {
    min-width: 100%;
  }
}

