.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-lg);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.modal-large {
  max-width: 700px;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
}

.modal-body.no-padding {
  padding: 0;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
}

.auth-toggle {
  margin-top: var(--space-lg);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

/* Modern Composer */
.modern-composer {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.composer-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.composer-name {
  font-weight: 600;
  font-size: 16px;
}

.composer-input-area textarea {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 18px;
  resize: none;
  min-height: 100px;
}

.composer-input-area textarea:focus {
  box-shadow: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.tool-btn {
  color: var(--accent-violet);
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.tool-btn:hover {
  background: var(--hover-bg);
}

.category-select {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  width: auto !important;
}

.media-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.link-preview {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.location-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Search */
.search-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-violet);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.search-result-item {
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result-item:hover {
  border-color: var(--accent-violet);
  background: var(--hover-bg);
}

.search-result-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: var(--space-xs);
}

.search-result-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.search-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* User Profile */
.profile-header {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  margin-bottom: var(--space-lg);
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.profile-cover {
  width: 100%;
  height: 120px;
  background: radial-gradient(circle at top left, rgba(102,126,234,0.6), transparent),
              radial-gradient(circle at bottom right, rgba(240,147,251,0.4), transparent);
  position: relative;
}

.profile-cover-empty {
  display: block;
}

.profile-cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-main {
  padding: var(--space-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.profile-avatar-wrapper {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--bg-secondary);
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-main .avatar.lg {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  margin: 16px 0 0;
  text-align: center;
}

.profile-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.profile-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.profile-tabs {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.profile-tab:hover,
.profile-tab.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

.profile-actions-bar {
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-md);
}

.profile-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: 0 var(--space-lg) var(--space-lg);
}

.profile-post-item {
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-post-item:hover {
  border-color: var(--accent-violet);
  background: var(--hover-bg);
}

.profile-post-media-container {
  width: 100%;
  height: 180px;
  background: #000;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-post-media-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.profile-post-category-tag {
  font-size: 11px;
  color: var(--accent-violet);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-post-body-preview {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.profile-post-footer-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* YouTube Previews */
.youtube-preview-container {
  width: 100%;
  height: 180px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #000;
}

.youtube-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.youtube-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 12px 0;
  background: #000;
}

.youtube-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.detail-media-item {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: #000;
  border-radius: 12px;
  margin: 12px 0;
  display: block;
}

.detail-video-container {
  position: relative;
  width: 100%;
  max-height: 500px;
  background: #000;
  border-radius: 12px;
  margin: 12px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.detail-video-container video {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: contain;
}

.detail-body-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.edit-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.profile-cover:hover .edit-overlay {
  opacity: 1;
}

.edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.profile-avatar-wrapper:hover .edit-badge {
  opacity: 1;
}

/* Nearby Posts Modal */
.nearby-post-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition-fast);
}

.nearby-post-card:hover {
  border-color: var(--accent-violet);
}

.nearby-post-card img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  margin: 8px 0;
  cursor: pointer;
}

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.post-user-name {
  font-weight: 600;
  font-size: 15px;
}

.post-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
}

.post-body {
  font-size: 15px;
  line-height: 1.5;
  margin: var(--space-md) 0;
}

.post-actions {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 12px;
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.action-btn.active {
  color: #f5576c;
}

.comments-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}

.comment-item {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.comment-content {
  flex: 1;
  background: var(--bg-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: 12px;
}

.comment-user {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.comment-body {
  font-size: 14px;
  line-height: 1.4;
}

.comment-input-container {
  display: flex;
  gap: var(--space-sm);
}

.comment-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
}

.send-comment-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.send-comment-btn:hover {
  box-shadow: var(--shadow-glow);
}

@media (max-width: 768px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
  }

  .media-preview {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* Location adjust mini-map */
.location-adjust-map {
  width: 100%;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 4px;
}

/* Media viewer adjustments */
#mediaViewerContent img,
#mediaViewerContent video,
#mediaViewerContent iframe {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  display: block;
}

/* Admin Styles */
.admin-stat-card {
    background: #0f0f15;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 4px;
    color: #0f0;
    font-family: monospace;
}

/* Onboarding Overlay */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.onboarding-content {
  max-width: 600px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.onboarding-content h2 {
  font-size: 28px;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.onboarding-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 24px 0;
  text-align: left;
}

.onboarding-feature {
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.onboarding-feature svg {
  margin-bottom: 8px;
  color: var(--accent-violet);
}

.onboarding-feature h4 {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.onboarding-feature p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

.category-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 0 16px;
}

.category-filter-btn {
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

.category-filter-btn:hover {
  border-color: var(--accent-violet);
}