/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8fafc;
}

/* Navigation */
.navbar {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: #3b82f6;
}

.nav-logo i {
  font-size: 28px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  color: #64748b;
  font-weight: 500;
  transition: color 0.3s ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: #3b82f6;
}

.auth-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.auth-btn:hover {
  background: #2563eb;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: calc(100vh - 70px);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 80px 20px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  color: #64748b;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
}

.section-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.btn-secondary {
  background: #64748b;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

/* Posts Grid */
.posts-container {
  margin-top: 40px;
}

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

.post-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

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

.post-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #64748b;
  font-size: 0.9rem;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-author i {
  color: #3b82f6;
}

.post-content {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tag {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

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

.btn-danger {
  background: #ef4444;
  color: white;
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}

.pagination button {
  padding: 10px 16px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  color: #3b82f6;
}

.pagination button.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Profile Section */
.profile-content {
  display: grid;
  gap: 30px;
  margin-top: 30px;
}

.profile-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  font-size: 60px;
  color: #3b82f6;
}

.profile-details h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #1e293b;
}

.profile-details p {
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-details i {
  color: #3b82f6;
  width: 16px;
}

.my-posts-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.my-post-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #3b82f6;
}

.my-post-card h4 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #1e293b;
}

.my-post-card p {
  color: #64748b;
  margin-bottom: 15px;
  line-height: 1.6;
}

.my-post-card .post-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #94a3b8;
}

.my-post-card .post-actions {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.post-detail-content {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 20px;
}

.close:hover {
  color: #000;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Auth Forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #1e293b;
  font-size: 1.5rem;
}

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

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

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 30px;
}

/* Post Form */
#postForm .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
}

#postForm .form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Post Detail */
.post-detail {
  margin-bottom: 30px;
}

.post-detail h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #1e293b;
}

.post-detail .post-meta {
  margin-bottom: 20px;
}

.post-detail .post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 30px;
}

.post-detail .post-tags {
  margin-bottom: 30px;
}

/* Comments Section */
.comments-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

.comments-section h3 {
  margin-bottom: 20px;
  color: #1e293b;
}

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

.comment-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 15px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  border-left: 4px solid #3b82f6;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comment-author {
  font-weight: 600;
  color: #1e293b;
}

.comment-date {
  color: #64748b;
  font-size: 0.9rem;
}

.comment-content {
  color: #374151;
  line-height: 1.6;
}

.comment-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 4000;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification {
  animation: slideIn 0.3s ease;
}

.notification.slideOut {
  animation: slideOut 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 15px;
  }

  .nav-menu {
    gap: 20px;
  }

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

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

  .main-content {
    padding: 20px 15px;
  }

  .section-header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .modal-content {
    margin: 10% auto;
    padding: 30px 20px;
    width: 95%;
  }

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

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 15px;
  }

  .nav-menu {
    flex-direction: column;
    gap: 15px;
  }

  .hero {
    padding: 40px 15px;
  }

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

  .section-header h2 {
    font-size: 2rem;
  }
}

.profile-field {
  margin-bottom: 20px;
}

.profile-field label {
  display: block;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 5px;
}

.profile-value {
  display: block;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  font-size: 1rem;
}

/* Comments Section */
.comments-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

.comments-section h3 {
  color: #1e293b;
  margin-bottom: 20px;
  font-size: 20px;
}

.comment-form {
  margin-bottom: 25px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

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

.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.comment-form button:hover {
  background: #2563eb;
}

/* Profile Section */
.profile-content {
  display: grid;
  gap: 30px;
}

.profile-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.profile-card h3 {
  color: #1e293b;
  margin-bottom: 20px;
  font-size: 24px;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 10px;
}

.profile-details p {
  margin-bottom: 15px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 4px solid #3b82f6;
}

.profile-details strong {
  color: #1e293b;
  font-weight: 600;
}

.my-posts-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.my-posts-section h3 {
  color: #1e293b;
  margin-bottom: 20px;
  font-size: 24px;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 10px;
}

/* Comment Display */
.comment {
  background: #f8fafc;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.comment p {
  margin-bottom: 10px;
  color: #475569;
  line-height: 1.6;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}

.comment-meta button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.comment-meta button:hover {
  background: #2563eb;
}

.comment-meta button:last-child {
  background: #ef4444;
}

.comment-meta button:last-child:hover {
  background: #dc2626;
}
