/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.nav-brand h2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  color: #666;
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover,
.nav-link.active {
  color: #667eea;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background: #333;
  margin: 3px 0;
  transition: 0.3s;
}

/* Main Content */
.main-content {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

/* Authentication */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.auth-tab {
  flex: 1;
  padding: 15px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab.active {
  color: #667eea;
  border-bottom: 2px solid #667eea;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

/* Buttons */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border: 2px solid transparent;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e9ecef;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

/* Error Messages */
.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* Dashboard */
.dashboard {
  padding: 20px 0;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Sidebar */
.sidebar {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.user-avatar {
  font-size: 40px;
  color: #667eea;
}

.user-details h4 {
  color: #333;
  margin-bottom: 5px;
}

.user-details p {
  color: #666;
  font-size: 14px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-btn {
  padding: 15px 20px;
  border: none;
  background: none;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: #666;
}

.sidebar-btn:hover,
.sidebar-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Main Area */
.main-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Create Post */
.create-post-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.post-form textarea {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  padding: 20px;
  font-size: 16px;
  resize: vertical;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

.post-form textarea:focus {
  outline: none;
  border-color: #667eea;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Posts */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.post-card:hover::before {
  opacity: 1;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.post-avatar {
  font-size: 40px;
  color: #667eea;
}

.post-author {
  flex: 1;
}

.post-author h4 {
  color: #333;
  margin-bottom: 5px;
}

.post-time {
  color: #666;
  font-size: 14px;
}

.post-content {
  margin-bottom: 20px;
  line-height: 1.6;
  color: #333;
}

.post-image {
  width: 100%;
  border-radius: 15px;
  margin-bottom: 20px;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.post-stats {
  display: flex;
  gap: 20px;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 12px;
  border-radius: 20px;
}

.post-stat:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
  color: #667eea;
}

.post-stat.liked {
  color: #dc3545;
}

.post-options {
  position: relative;
}

.post-options-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.post-options-btn:hover {
  background: #f0f0f0;
  color: #333;
}

/* Comments */
.comments-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.comment-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.comment-input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.comment-input:focus {
  outline: none;
  border-color: #667eea;
}

.comment {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.comment-avatar {
  font-size: 30px;
  color: #667eea;
}

.comment-content {
  flex: 1;
  background: #f8f9fa;
  padding: 12px 15px;
  border-radius: 15px;
}

.comment-author {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.comment-text {
  color: #666;
  line-height: 1.4;
}

.comment-time {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

/* Modal */
.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: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: #333;
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 30px;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(102, 126, 234, 0.1);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Smooth animations for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  animation: fadeInUp 0.6s ease-out;
}

.post-card:nth-child(1) {
  animation-delay: 0.1s;
}
.post-card:nth-child(2) {
  animation-delay: 0.2s;
}
.post-card:nth-child(3) {
  animation-delay: 0.3s;
}
.post-card:nth-child(4) {
  animation-delay: 0.4s;
}
.post-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 60px;
    flex-direction: column;
    background-color: white;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .main-area {
    order: 1;
  }

  .auth-card {
    padding: 30px 20px;
  }

  .post-actions {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .post-stats {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .dashboard-layout {
    padding: 0 10px;
  }

  .create-post-card,
  .post-card {
    padding: 20px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }
}
