/* Color variables - easily change theme colors here */
:root {
  /* Dark theme colors */
  --primary-color-rgb: 59, 130, 246;
  --primary-color: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.8);
  --primary-glow-bg: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.4);

  --text-primary: #ccc;
  --text-secondary: #777;
  --text-highlight: white;

  --bg-main: #000;
  --bg-card: rgba(20, 20, 20, 0.5);
  --bg-nav: rgba(20, 20, 20, 0.5);

  --border-color: rgba(100, 100, 100, 0.3);
  --border-hover: rgba(100, 100, 255, 0.4);

  --box-shadow: rgba(100, 100, 255, 0.2);
  --box-shadow-hover: rgba(100, 100, 255, 0.4);

  /* Like animation colors */
  --like-color: #f87171;
  --like-glow: rgba(248, 113, 113, 0.6);

  /* Animation speed */
  --transition-speed: 0.3s;
}

/* Light theme colors */
html.light {
  --primary-color: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.6);
  --primary-glow-bg: rgba(59, 130, 246, 0.1);
  --primary-border: rgba(59, 130, 246, 0.3);

  --text-primary: #333;
  --text-secondary: #666;
  --text-highlight: #111;

  --bg-main: #ffffff;
  --bg-card: rgba(240, 240, 240, 0.5);
  --bg-nav: rgba(240, 240, 240, 0.5);

  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 100, 0.3);

  --box-shadow: rgba(0, 0, 100, 0.15);
  --box-shadow-hover: rgba(0, 0, 100, 0.3);

  /* Like animation colors */
  --like-color: #ef4444;
  --like-glow: rgba(239, 68, 68, 0.4);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    "Helvetica Neue", sans-serif;
}

html,
body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Font size classes */
body.font-small {
  font-size: 0.9rem;
}

body.font-medium {
  font-size: 1rem;
}

body.font-large {
  font-size: 1.1rem;
}

body.font-xlarge {
  font-size: 1.2rem;
}

/* App container */
.app-container {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.app-container.active {
  display: block;
}

/* Ensure canvas is behind content */
#canvas-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none; /* This ensures clicks pass through the canvas */
  display: block;
}

/* Ensure main content is above canvas */
main {
  position: relative;
  z-index: 2;
}

.content {
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
  height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Fix scrollbar styling */
.content::-webkit-scrollbar,
.notifications-container::-webkit-scrollbar,
#user-posts-container::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track,
.notifications-container::-webkit-scrollbar-track,
#user-posts-container::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb,
.notifications-container::-webkit-scrollbar-thumb,
#user-posts-container::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover,
.notifications-container::-webkit-scrollbar-thumb:hover,
#user-posts-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-hover);
}

h1 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 24px;
  color: var(--text-highlight);
  transition: color var(--transition-speed) ease;
}

/* Card styles - more transparent */
.card {
  padding: 16px;
  border-radius: 8px;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  transition: opacity 0.3s ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  position: relative;
  box-shadow: 0 0 10px var(--box-shadow);
}

.card:hover {
  box-shadow: 0 0 15px var(--box-shadow-hover);
  border-color: var(--border-hover);
}

.user-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #444;
  transition: background-color var(--transition-speed) ease;
}

.user-info {
  margin-left: 12px;
}

.username {
  font-weight: 500;
  transition: color var(--transition-speed) ease;
}

.time {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.post-text {
  font-size: 14px;
  line-height: 1.4;
  transition: color var(--transition-speed) ease;
}

/* Add this to position the delete button to the far right */
.actions {
  display: flex;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  position: relative;
}

/* Add a spacer to push the delete button to the right */
.actions-spacer {
  flex-grow: 1;
}

.action-btn {
  margin-right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
  display: flex;
  align-items: center;
  position: relative;
}

.action-btn svg {
  margin-right: 4px;
}

.action-btn:hover {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Like button animation */
.action-btn.like-btn.liked {
  color: var(--like-color);
  text-shadow: 0 0 10px var(--like-glow);
}

.action-btn.like-btn.liked svg {
  fill: var(--like-color);
  animation: like-pulse 0.5s ease;
}

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

/* Comment popout */
.comment-popout {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 0 0 8px 8px;
  border-top: 1px solid var(--border-color);
  padding: 16px;
  transform-origin: bottom center;
  transform: scaleY(0);
  opacity: 0;
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
  z-index: 10;
}

.comment-popout.active {
  transform: scaleY(1);
  opacity: 1;
}

.comment-input {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-primary);
  resize: none;
  margin-bottom: 8px;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
}

/* Reposition the share menu to be aligned with the share button */
.share-menu {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 8px;
  display: flex;
  opacity: 0;
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
  z-index: 10;
  box-shadow: 0 0 10px var(--box-shadow);
}

.share-menu.active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.share-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
}

.share-option:hover {
  background-color: var(--primary-glow-bg);
  color: var(--primary-color);
  transform: scale(1.1);
}

/* Notification dot */
.notification-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin-left: 8px;
  box-shadow: 0 0 5px var(--primary-glow);
}

/* Scrollable notifications */
.notifications-container {
  max-height: none;
  overflow-y: visible;
}

/* Navigation bar - island style - more transparent */
.nav-container {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 90%;
  max-width: 500px;
}

nav {
  background-color: var(--bg-nav);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  display: flex;
  justify-content: space-around;
  height: 64px;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-speed) ease;
  box-shadow: 0 0 10px var(--box-shadow);
}

nav:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px var(--box-shadow-hover);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 25%;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
  position: relative;
  border-radius: 12px;
  text-decoration: none;
}

.nav-btn:hover {
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
}

.nav-btn.active {
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
}

.nav-btn svg {
  transition: filter var(--transition-speed) ease;
}

.nav-btn:hover svg,
.nav-btn.active svg {
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-btn span {
  font-size: 12px;
  margin-top: 4px;
}

/* Redesigned theme toggle */
.theme-toggle-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
}

.theme-toggle {
  background-color: var(--bg-nav);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 10px var(--box-shadow);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px var(--box-shadow-hover);
}

/* Theme icons */
.theme-icon {
  position: absolute;
  width: 24px;
  height: 24px;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  color: var(--text-primary);
}

.theme-icon.sun {
  opacity: 0;
  transform: scale(0.7) rotate(-90deg);
}

.theme-icon.moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

html.light .theme-icon.sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}

html.light .theme-icon.moon {
  opacity: 0;
  transform: scale(0.7) rotate(90deg);
}

/* Tab content */
.tab-content {
  display: none;
  position: relative;
  z-index: 5;
}

.tab-content.active {
  display: block;
}

/* Settings page specific styles */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-info {
  flex: 1;
}

.setting-title {
  font-weight: 500;
  transition: color var(--transition-speed) ease;
}

.setting-description {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.section-title {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text-highlight);
  transition: color var(--transition-speed) ease;
}

.logout-btn {
  width: 100%;
  padding: 12px;
  background-color: rgba(220, 38, 38, 0.2);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  margin-top: 24px;
  cursor: pointer;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.logout-btn:hover {
  background-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

/* Profile page specific styles */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-color: #444;
  margin-bottom: 16px;
  transition: background-color var(--transition-speed) ease;
  box-shadow: 0 0 10px var(--box-shadow);
}

.profile-name {
  margin-bottom: 4px;
}

.profile-joined {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--transition-speed) ease;
}

/* Fix profile stats centering */
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  width: 100%;
  text-align: center;
}

.stat-item {
  text-align: center;
  min-width: 60px;
}

.stat-value {
  font-weight: bold;
  transition: color var(--transition-speed) ease;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.profile-tabs {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  margin-bottom: 16px;
  transition: border-color var(--transition-speed) ease;
}

.profile-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
}

.profile-tab:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.profile-tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Profile tab content with swipe effect */
.profile-content {
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

/* Add this to fix scrolling in profile tab content */
.profile-tab-content {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  pointer-events: none;
  max-height: 100%;
  overflow-y: auto;
}

.profile-tab-content.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.media-item {
  aspect-ratio: 1;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 0 10px var(--box-shadow);
}

.media-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px var(--box-shadow-hover);
}

.media-symbol {
  color: var(--text-secondary);
  font-size: 32px;
  transition: color var(--transition-speed) ease, text-shadow var(--transition-speed);
}

.media-item:hover .media-symbol {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Color customization panel */
.color-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 16px;
  z-index: 100;
  width: 280px;
  box-shadow: 0 0 15px var(--box-shadow);
  transition: transform var(--transition-speed) ease;
  transform: translateX(calc(100% + 16px));
}

.color-panel.open {
  transform: translateX(0);
}

.color-panel-toggle {
  position: absolute;
  left: -40px;
  top: 0;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 8px 0 0 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: color var(--transition-speed) ease, text-shadow var(--transition-speed) ease, transform
    var(--transition-speed) ease;
  box-shadow: 0 0 10px var(--box-shadow);
}

.color-panel-toggle:hover {
  color: var(--primary-color);
  text-shadow: 0 0 8px var(--primary-glow);
  transform: scale(1.05);
}

.color-panel-toggle svg {
  transition: filter var(--transition-speed) ease;
}

.color-panel-toggle:hover svg {
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.color-option {
  margin-bottom: 20px;
}

.color-option label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-highlight);
}

.color-panel h3 {
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--text-highlight);
  text-align: center;
}

/* Custom color picker */
.color-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-preview {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: box-shadow var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px var(--box-shadow);
}

.color-preview:hover {
  box-shadow: 0 0 10px var(--primary-glow);
}

.color-preview::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.color-preview input {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 0 5px var(--box-shadow);
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Custom slider */
.custom-slider {
  width: 100%;
  position: relative;
  height: 20px;
  margin-top: 10px;
}

.slider-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background-color: var(--bg-main);
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
}

.slider-fill {
  position: absolute;
  height: 6px;
  background-color: var(--primary-color);
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.slider-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 0 5px var(--primary-glow);
  transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.slider-thumb:hover {
  box-shadow: 0 0 10px var(--primary-glow);
  transform: translate(-50%, -50%) scale(1.1);
}

.slider-value {
  margin-top: 5px;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Additional settings */
.setting-select {
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-primary);
}

.setting-range {
  width: 100%;
  margin-top: 8px;
}

.setting-range-value {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}

/* Sound toggle */
.sound-toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.sound-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sound-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: .4s;
  border-radius: 24px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.sound-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

input:checked + .sound-slider:before {
  transform: translateX(14px);
}

/* Login page */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  border-radius: 12px;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 20px var(--box-shadow);
}

.login-title {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  color: var(--text-highlight);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  color: var(--text-primary);
}

.form-input {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.login-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Add these styles to ensure links are clickable */
.login-link {
  color: var(--primary-color);
  text-decoration: none;
  position: relative;
  z-index: 20;
  cursor: pointer;
  padding: 2px 4px;
  transition: text-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.login-link:hover {
  text-shadow: 0 0 8px var(--primary-glow);
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 4px;
}

.error-message {
  color: #f87171;
  font-size: 14px;
  margin-top: 4px;
}

/* Toast notification system */
.toast-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.toast {
  margin-top: 15px;
  padding: 12px 20px;
  border-radius: 6px;
  background-color: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-size: 14px;
  max-width: 350px;
  width: calc(100% - 30px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid var(--primary-color);
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.success {
  border-left-color: #10b981;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-card);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 0 20px var(--box-shadow);
}

.close {
  color: var(--text-secondary);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Comment styles */
.comments-container {
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.comment {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.comment .user-header {
  margin-bottom: 4px;
}

.comment .avatar.small {
  width: 30px;
  height: 30px;
}

.comment .username {
  font-size: 14px;
}

.comment .time {
  font-size: 10px;
}

.comment .comment-text {
  font-size: 14px;
  margin-left: 42px;
}

.no-comments {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  padding: 10px;
}

/* Profile bio */
.profile-bio {
  text-align: center;
  margin: 8px 0 16px;
  color: var(--text-primary);
  font-size: 14px;
  max-width: 400px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-glow-bg);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--primary-color);
}

/* Profile picture upload styles */
.profile-picture-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.current-picture {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #444;
  margin-bottom: 10px;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px var(--box-shadow);
}

.profile-picture-preview {
  margin-top: 10px;
}

/* Comment styles - Instagram-like comments display */
.comments-section {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.comment-item {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.comment-username {
  font-weight: bold;
  margin-right: 6px;
}

.comment-content {
  flex: 1;
  word-break: break-word;
}

.comment-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Improve close button for comment popup */
.comment-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.3);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 5;
  padding: 0;
  line-height: 1;
  font-size: 18px;
}

.comment-close:hover {
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.5);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Create post styles */
.create-post {
  margin-bottom: 20px;
}

.create-post textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  resize: none;
  margin-bottom: 10px;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.create-post textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.create-post-actions {
  display: flex;
  justify-content: flex-end;
}

/* Notification badge */
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--like-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 5px var(--like-glow);
}

/* Button styling for consistency */
.edit-profile-btn,
.create-post-btn,
.comment-submit,
.login-btn {
  padding: 8px 16px;
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.7);
  color: white;
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
  backdrop-filter: blur(4px);
  margin-top: 16px;
  font-weight: 500;
}

.edit-profile-btn:hover,
.create-post-btn:hover,
.comment-submit:hover,
.login-btn:hover {
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.8);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Make sure the post button is properly styled */
.create-post-btn {
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.7);
  color: white;
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
  font-weight: 500;
  margin-top: 0; /* Override the margin-top from the general button style */
}

.create-post-btn:hover {
  background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.8);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Create post styles - Update this section */
.create-post {
  margin-bottom: 20px;
}

.create-post textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  resize: none;
  margin-bottom: 10px;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.create-post textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.create-post-actions {
  display: flex;
  justify-content: flex-end;
}

/* Fix notification styling */
.notification {
  position: relative;
  transition: background-color var(--transition-speed) ease;
  padding: 16px; /* Consistent padding */
}

.notification .user-header {
  margin-top: 0; /* Ensure no extra margin */
  margin-bottom: 12px; /* Consistent margin */
}

.notification:hover {
  background-color: var(--primary-glow-bg);
}

.notification-text {
  margin-top: 0; /* Remove extra margin */
  font-size: 14px;
  line-height: 1.4;
}

.notification-content {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Unread notification indicator */
.notification.unread::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-color);
  box-shadow: 0 0 5px var(--primary-glow);
}

/* Add this to ensure the user posts container scrolls properly */
#user-posts-container {
  max-height: 100%;
  overflow-y: auto;
}

/* Add styling for the delete button with glow effect */
.action-btn.delete-btn {
  color: #ef4444;
  margin-left: auto;
  padding: 5px 10px;
  font-size: 11px;
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
}

.action-btn.delete-btn:hover {
  color: #dc2626;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Single post view styles */
.single-post-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.single-post-card {
  margin-bottom: 20px;
}

.back-to-home {
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color var(--transition-speed);
}

.back-to-home:hover {
  color: var(--primary-color);
}

.back-to-home svg {
  margin-right: 8px;
}
