:root {
  /* Light mode colors */
  --primary-color: #4e54c8;
  --secondary-color: #8f94fb;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-color: #f9f9f9;
  --card-bg: #fff;

  /* Dark mode colors */
  --dark-primary-color: #6a75e0;
  --dark-secondary-color: #a1a8ff;
  --dark-text-color: #f0f0f0;
  --dark-text-light: #b0b0b0;
  --dark-border-color: #444;
  --dark-bg-color: #121212;
  --dark-card-bg: #1e1e1e;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark {
  background-color: var(--dark-bg-color);
  color: var(--dark-text-color);
}

#profile {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

body.dark #profile {
  background-color: var(--dark-card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-header {
  margin-bottom: 20px;
  position: relative;
}

.profile-picture {
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  transition: border-color 0.3s ease;
}

.profile-picture-container{
  display: flex;
}

body.dark .profile-picture {
  border-color: var(--dark-primary-color);
}

.profile-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark .profile-header h1 {
  color: var(--dark-text-color);
}

.username {
  color: var(--text-light);
  font-size: 16px;
  display: block;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

body.dark .username {
  color: var(--dark-text-light);
}

.profile-meta {
  display: flex;
  gap: 15px;
  margin-top: 5px;
  margin-bottom: 15px;
  font-size: 14px;
  flex-direction: column;
  color: var(--text-light);
  flex-wrap: wrap;
  transition: color 0.3s ease;
}

body.dark .profile-meta {
  color: var(--dark-text-light);
}

.profile-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.profile-meta i {
  font-size: 16px;
}

.bio {
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark .bio {
  color: var(--dark-text-color);
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

body.dark .profile-stats {
  border-top-color: var(--dark-border-color);
  border-bottom-color: var(--dark-border-color);
}

.stat {
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px 10px;
  border-radius: 8px;
}

.stat:hover {
  background-color: rgba(78, 84, 200, 0.1);
}

body.dark .stat:hover {
  background-color: rgba(106, 117, 224, 0.1);
}

.stat-number {
  font-size: 20px;
  font-weight: 600;
  display: block;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

body.dark .stat-number {
  color: var(--dark-primary-color);
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.3s ease;
}

body.dark .stat-label {
  color: var(--dark-text-light);
}

.btns {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.btns button, .follow-btn {
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

#follow, .follow-btn, #settings {
  color: white;
  background-color: var(--primary-color);
}

#follow:hover, .follow-btn:hover, #settings:hover {
  background-color: #4348a8;
  transform: translateY(-2px);
}

body.dark #follow,
body.dark .follow-btn,
body.dark #settings {
  background-color: var(--dark-primary-color);
}

body.dark #follow:hover,
body.dark .follow-btn:hover,
body.dark #settings:hover {
  background-color: #5a62c9;
}

#follow:active, .follow-btn:active, #settings:active {
  transform: translateY(0);
}

#follow.following {
  background-color: var(--text-light);
}

#follow.following:hover {
  background-color: #555;
}

body.dark #follow.following {
  background-color: var(--dark-text-light);
}

body.dark #follow.following:hover {
  background-color: #777;
}

.profile-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

body.dark .profile-tabs {
  border-bottom-color: var(--dark-border-color);
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-light);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

body.dark .tab-btn {
  color: var(--dark-text-light);
}

.tab-btn.active {
  color: var(--primary-color);
}

body.dark .tab-btn.active {
  color: var(--dark-primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
  transition: background-color 0.3s ease;
}

body.dark .tab-btn.active::after {
  background-color: var(--dark-primary-color);
}

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

body.dark .tab-btn:hover {
  color: var(--dark-primary-color);
}

.profile-posts {
  margin-top: 20px;
}

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

.post {
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 9/16;
}

.post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post:hover img {
  transform: scale(1.05);
}

.post-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.post-overlay span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.cover{
  border-radius: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  transition: color 0.3s ease;
}

body.dark .empty-state {
  color: var(--dark-text-light);
}

.empty-state i {
  font-size: 50px;
  color: var(--border-color);
  transition: color 0.3s ease;
}

body.dark .empty-state i {
  color: var(--dark-border-color);
}

.empty-state h3 {
  margin: 0 0 10px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark .empty-state h3 {
  color: var(--dark-text-color);
}

.empty-state p {
  margin: 0 0 20px;
}

.create-post-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 90px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

body.dark .create-post-btn {
  background-color: var(--dark-primary-color);
}

.create-post-btn i, .follow-btn i {
  font-size: 20px;
}

.create-post-btn:hover {
  background-color: #4348a8;
  transform: translateY(-2px);
}

body.dark .create-post-btn:hover {
  background-color: #5a62c9;
}

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

.follow-btn {
  display: inline-flex;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--card-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.dark .user-card {
  background-color: var(--dark-card-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.user-picture {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark .user-info h3 {
  color: var(--dark-text-color);
}

.user-info p {
  margin: 5px 0 0;
  color: var(--text-light);
  font-size: 14px;
  transition: color 0.3s ease;
}

body.dark .user-info p {
  color: var(--dark-text-light);
}

img {
  aspect-ratio: 1;
}

.share, .back {
  font-size: 20px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark .share,
body.dark .back {
  color: var(--dark-text-color);
}

.banned {
  color: red;
  padding: 10px;
  border-radius: 5px;
}

svg {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 60px;
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s ease;
}

body.dark svg {
  color: var(--dark-text-color);
}

a {
  text-decoration: none;
  text-align: center;
  padding: 0;
}

a h4 {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

body.dark a h4 {
  color: var(--dark-primary-color);
}

.thumbnail-text {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #6a11cb 0%, var(--text-color) 100%);
}

body.dark .thumbnail-text {
  background: linear-gradient(135deg, #6a11cb 0%, var(--dark-text-color) 100%);
}

.bi-newspaper, .bi-image {
  padding: 7px;
}

.cover-container{
  height: 200px;
  width: 100%;
  position: relative;
  border-radius: 3px;
}

.cover-container .cover{
  height: 200px;
  width: 100%;
  object-fit: cover;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastSlideIn 0.3s ease;
}

body.dark .toast {
  background: rgba(0, 0, 0, 0.9);
}

.toast i {
  font-size: 20px;
}

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

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

@media (max-width: 500px) {
  #profile, .t {
    padding: 5px;
  }
  #profile {
    overflow: hidden;
  }
  .back, .share {
    font-size: 10px;
  }
  span {
    font-size: 10px;
  }
  .btns button {
    padding: 5px;
    font-size: 10px;
  }
  .btns button i {
    font-size: 10px;
  }
  .stat .stat-label {
    font-size: 10px;
  }
  .stat .stat-number {
    font-size: 16px;
  }
  .profile-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }
  .profile-tabs button {
    font-size: 10px;
    padding: 4px;
  }
  .tab-btn.active::after {
    height: 1px;
  }
  .user-card h3, .user-card p{
    font-size: 10px;
  }
  .user-card {
    padding: 0;
  }
  .user-info {
    gap: 0;
  }
  .user-card .user-bio {
    font-size: 10px;
  }
  .user-card img, .profile-picture{
    width: 50px;
    height: 50px;
    border: none;
  }
  .profile-picture-container{
    flex-direction: column;
    align-items: center;
  }
  .cover-container{
    height: 100px;
    overflow: hidden;
  }
}