/* Enhanced Styles.css - Modern Social Media Design */

:root {
  /* Main color palette */
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3f37c9;
  --secondary-color: #f72585;
  --secondary-light: #ff4d6d;
  --success-color: #4cc9f0;
  --warning-color: #ffbe0b;
  --danger-color: #f72585;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --background-color: #f0f2f5;
  --card-color: #ffffff;
  --text-color: #333333;
  --text-muted: #6c757d;
  
  /* Categories colors */
  --category-politics: #dc3545;
  --category-technology: #0d6efd;
  --category-entertainment: #fd7e14;
  --category-sports: #198754;
  --category-health: #20c997;
  --category-science: #6610f2;
  --category-business: #0dcaf0;
  --category-education: #6f42c1;
}

/* Base styles */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* Header styling */
header {
  background-color: var(--card-color);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.8rem;
}

/* Button styling */
.btn {
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.btn-danger, .btn-outline-danger:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #d90166;
  border-color: #d90166;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(247, 37, 133, 0.3);
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-sm {
  border-radius: 8px;
  padding: 5px 12px;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Section styling */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* Card styling */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
}

/* Post card styling */
.post-card {
  background-color: var(--card-color);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-content {
  padding: 1.5rem;
}

.card-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.post-text-content {
  line-height: 1.6;
}

.post-text-content.collapsed {
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.post-text-content.expanded {
  max-height: none;
}

.read-more-btn {
  display: inline-block;
  color: var(--primary-color);
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.read-more-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.card-categories {
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #f8f9fa;
}

/* Category badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  background-color: #e9ecef;
  color: #495057;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-badge i {
  margin-right: 5px;
}

.category-badge:hover {
  background-color: #dee2e6;
  transform: translateY(-1px);
}

.category-politics {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--category-politics);
}

.category-technology {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--category-technology);
}

.category-entertainment {
  background-color: rgba(253, 126, 20, 0.1);
  color: var(--category-entertainment);
}

.category-sports {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--category-sports);
}

.category-health {
  background-color: rgba(32, 201, 151, 0.1);
  color: var(--category-health);
}

.category-science {
  background-color: rgba(102, 16, 242, 0.1);
  color: var(--category-science);
}

.category-business {
  background-color: rgba(13, 202, 240, 0.1);
  color: var(--category-business);
}

.category-education {
  background-color: rgba(111, 66, 193, 0.1);
  color: var(--category-education);
}

/* Carousel styling */
#trending-section {
  margin-bottom: 2rem;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 350px;
  margin: 20px auto;
  perspective: 1000px;
  overflow: hidden;
}

.post-item {
  position: absolute;
  width: 60%;
  height: auto;
  max-height: 300px;
  left: 20%;
  top: 0;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
  overflow: hidden;
  z-index: 1;
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: var(--primary-color);
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.prev-button {
  left: 10px;
}

.next-button {
  right: 10px;
}

/* Comment styling */
.comments-section {
  padding-top: 10px;
}

.comment-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.comment-item:hover {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding-left: 8px;
}

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

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-username {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 8px;
  color: var(--primary-color);
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.comment-content {
  margin-left: 42px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.comment-actions {
  margin-left: 42px;
  margin-top: 5px;
}

.comment-actions button {
  font-size: 0.8rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.comment-actions button:hover {
  color: var(--danger-color);
  text-decoration: underline;
}

.toggle-comments {
  font-size: 0.85rem;
  color: var(--primary-color);
  transition: all 0.2s ease;
}

.toggle-comments:hover {
  color: var(--primary-dark);
}

.comment-form {
  margin-bottom: 15px;
}

.comment-form .form-control {
  border-radius: 20px;
  padding: 10px 16px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.comment-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.empty-comments {
  text-align: center;
  padding: 15px;
  color: var(--text-muted);
  font-style: italic;
}

/* Profile styling */
.profile-header {
  position: relative;
  height: 300px;
  background-color: #e9ecef;
  background-image: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
  margin-bottom: 80px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-container {
  position: absolute;
  bottom: -70px;
  left: 50px;
  z-index: 10;
}

.profile-picture {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid white;
  background-color: #f8f9fa;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.profile-picture:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.profile-info {
  padding: 80px 20px 20px;
  background-color: white;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  padding: 15px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.stat-box {
  text-align: center;
  flex: 1;
  padding: 15px 10px;
  border-radius: 12px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.stat-box:hover {
  background-color: #e9ecef;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-count {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
  font-weight: 500;
}

/* Animation effects */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card {
  animation: fadeIn 0.3s ease forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.like-btn:hover, .dislike-btn:hover {
  animation: pulse 0.3s ease;
}

/* Form styling */
.form-control {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Alert styling */
.alert {
  border-radius: 12px;
  border: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.alert-success {
  background-color: rgba(76, 201, 240, 0.15);
  color: #0c7489;
}

.alert-danger {
  background-color: rgba(247, 37, 133, 0.15);
  color: #ac0950;
}

.alert-info {
  background-color: rgba(67, 97, 238, 0.15);
  color: #1e31a5;
}

.alert-warning {
  background-color: rgba(255, 190, 11, 0.15);
  color: #956b00;
}

/* Dropdown styling */
.dropdown-menu {
  border-radius: 12px;
  border: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 10px;
}

.dropdown-item {
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 3px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary-color);
}

.dropdown-item i {
  margin-right: 8px;
  color: var(--primary-color);
}

.dropdown-divider {
  margin: 8px 0;
}

.dropdown-header {
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
  .carousel-container {
    height: 300px;
  }
  
  .post-item {
    width: 80%;
    left: 10%;
  }
  
  .card-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .card-actions .btn {
    width: 100%;
  }
  
  .profile-header {
    height: 200px;
    margin-bottom: 60px;
  }
  
  .profile-picture-container {
    left: 20px;
    bottom: -50px;
  }
  
  .profile-picture {
    width: 100px;
    height: 100px;
  }
  
  .profile-info {
    padding: 60px 15px 15px;
  }
  
  .profile-stats {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .stat-box {
    flex: 0 0 calc(50% - 10px);
  }
  
  /* Additional mobile adjustments */
  .card-categories {
    padding: 0 1rem 1rem;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  .card-actions {
    padding: 1rem;
  }
  
  .btn {
    padding: 6px 12px;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
}

/* User profile editing styles */
.profile-pic-preview, .cover-pic-preview {
  width: 100%;
  background-color: #f8f9fa;
  border: 1px dashed #ced4da;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.profile-pic-preview {
  height: 200px;
  border-radius: 50%;
  margin: 0 auto;
  max-width: 200px;
}

.cover-pic-preview {
  height: 150px;
  border-radius: 12px;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6c757d;
  transition: all 0.3s ease;
}

.profile-pic-preview:hover, .cover-pic-preview:hover {
  border-color: var(--primary-color);
  cursor: pointer;
}

.profile-pic-preview:hover .upload-icon, 
.cover-pic-preview:hover .upload-icon {
  color: var(--primary-color);
}

/* Nav tabs styling */
.nav-tabs {
  border-bottom: 1px solid #dee2e6;
  gap: 5px;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 15px;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(67, 97, 238, 0.05);
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
  background-color: transparent;
}

/* Filter card styling */
.filter-card {
  margin-bottom: 2rem;
}

.filter-card .card-header {
  background-color: rgba(67, 97, 238, 0.05);
  color: var(--primary-color);
  font-weight: 600;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.active-filters {
  display: inline-block;
  padding: 6px 12px;
  background-color: #f8f9fa;
  border-radius: 20px;
  font-size: 0.9rem;
}