/* ============================================
   PUBLIC USER PROFILE STYLES
   Light, Clean Design (reusing blog patterns)
   ============================================ */

:root {
  --profile-bg-primary: #ffffff;
  --profile-bg-secondary: #f7f7f7;
  --profile-bg-tertiary: #f0f0f0;
  --profile-text-primary: #111111;
  --profile-text-secondary: #666666;
  --profile-accent: #FFCC00;
  --profile-border: #e0e0e0;
  --profile-shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --profile-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --profile-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --profile-verified: #10b981;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.user-profile-view {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: var(--profile-bg-primary);
  min-height: 100vh;
  box-sizing: border-box;
}

/* ============================================
   BACK BUTTON
   ============================================ */

.profile-back-btn {
  background: var(--profile-bg-secondary);
  border: 2px solid var(--profile-border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--profile-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-back-btn:hover {
  background: var(--profile-accent);
  border-color: var(--profile-accent);
  transform: translateY(-2px);
  box-shadow: var(--profile-shadow-md);
}

.profile-back-btn i {
  font-size: 0.9rem;
}

/* ============================================
   PROFILE HEADER
   ============================================ */

.profile-header {
  background: var(--profile-bg-primary);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: var(--profile-shadow-md);
  border: 2px solid var(--profile-border);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  text-align: left;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--profile-accent);
  object-fit: cover;
  box-shadow: var(--profile-shadow-lg);
}

.profile-verified-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: var(--profile-verified);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  border: 3px solid white;
  box-shadow: var(--profile-shadow-md);
}

.profile-info {
  width: 100%;
}

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

.profile-nickname {
  font-size: 2rem;
  font-weight: 900;
  color: var(--profile-text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.profile-edit-btn {
  background: #FFCC00;
  color: #000;
  border: 2px solid #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.profile-edit-btn:hover {
  background: #000;
  color: #FFCC00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.profile-edit-btn i {
  font-size: 14px;
}

.profile-bio {
  font-size: 1rem;
  color: var(--profile-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 100%;
}

/* ============================================
   PROFILE STATS
   ============================================ */

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--profile-bg-secondary);
  border-radius: 8px;
  border: 2px solid var(--profile-border);
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.profile-stat i {
  font-size: 1.5rem;
  color: var(--profile-text-secondary);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--profile-text-primary);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--profile-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.profile-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-action-btn {
  background: var(--profile-bg-secondary);
  border: 2px solid var(--profile-border);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--profile-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-action-btn:hover {
  background: var(--profile-bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--profile-shadow-md);
}

.profile-action-btn.primary {
  background: var(--profile-accent);
  border-color: var(--profile-accent);
}

.profile-action-btn.primary:hover {
  background: #FFD700;
  border-color: #FFD700;
}

/* ============================================
   TABS
   ============================================ */

.profile-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--profile-border);
  padding-bottom: 10px;
}

.profile-tab {
  background: transparent;
  border: none;
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--profile-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.profile-tab:hover {
  background: var(--profile-bg-secondary);
  color: var(--profile-text-primary);
}

.profile-tab.active {
  background: var(--profile-bg-primary);
  color: var(--profile-text-primary);
  border-bottom: 3px solid var(--profile-accent);
}

.profile-tab i {
  font-size: 1rem;
}

/* ============================================
   TAB CONTENT
   ============================================ */

.profile-content {
  min-height: 400px;
}

.profile-tab-content {
  display: none;
}

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

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.profile-loading,
.profile-empty,
.profile-error {
  text-align: center;
  padding: 60px 20px;
}

.profile-loading {
  font-size: 1.1rem;
  color: var(--profile-text-secondary);
}

.profile-empty i,
.profile-error i {
  font-size: 4rem;
  color: var(--profile-text-secondary);
  margin-bottom: 20px;
  opacity: 0.5;
}

.profile-empty p,
.profile-error p {
  font-size: 1.1rem;
  color: var(--profile-text-secondary);
  margin: 0;
}

/* ============================================
   LISTINGS GRID (Profile-specific)
   ============================================ */

.profile-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.profile-listing-card {
  background: var(--profile-bg-primary);
  border: 2px solid var(--profile-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--profile-shadow-sm);
}

.profile-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--profile-shadow-lg);
  border-color: var(--profile-accent);
}

.profile-listing-card .listing-image {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.profile-listing-card .listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-listing-card:hover .listing-image img {
  transform: scale(1.1);
}

.listing-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-listing-card .listing-content {
  padding: 12px 14px;
}

.profile-listing-card .listing-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--profile-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-listing-card .listing-location {
  font-size: 0.85rem;
  color: var(--profile-text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.profile-listing-card .listing-location i {
  font-size: 0.8rem;
}

.profile-listing-card .listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--profile-border);
  font-size: 0.8rem;
  color: var(--profile-text-secondary);
}

.profile-listing-card .listing-date {
  font-weight: 600;
}

.profile-listing-card .listing-views {
  font-weight: 600;
}

/* ============================================
   ERROR PAGES
   ============================================ */

.user-profile-error {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: var(--profile-bg-primary);
  min-height: 100vh;
  box-sizing: border-box;
}

.profile-error-content {
  text-align: center;
  padding: 80px 20px;
  background: var(--profile-bg-secondary);
  border-radius: 12px;
  border: 2px solid var(--profile-border);
  box-shadow: var(--profile-shadow-md);
}

.profile-error-content i {
  font-size: 5rem;
  color: var(--profile-text-secondary);
  margin-bottom: 30px;
  opacity: 0.5;
}

.profile-error-content h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--profile-text-primary);
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

.profile-error-content p {
  font-size: 1.1rem;
  color: var(--profile-text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.user-profile-loading {
  text-align: center;
  padding: 100px 20px;
  font-size: 1.2rem;
  color: var(--profile-text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .user-profile-view {
    padding: 15px;
  }

  .profile-header {
    padding: 20px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-nickname {
    font-size: 1.6rem;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .profile-tabs {
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-tab {
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .profile-listings-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }

  .profile-error-content {
    padding: 60px 20px;
  }

  .profile-error-content i {
    font-size: 4rem;
  }

  .profile-error-content h2 {
    font-size: 1.6rem;
  }

  .profile-action-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .profile-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-stat {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }

  .profile-listings-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    flex-direction: column;
    width: 100%;
  }

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

/* ============================================
   PERSONAL CATEGORIES GRID (2x2)
   ============================================ */

.profile-categories-section {
  max-width: 1400px;
  margin: 30px auto 20px auto;
  padding: 15px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.categories-header {
  margin-bottom: 15px;
}

.categories-title {
  font-size: 16px;
  font-weight: 900;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 6px solid #FFCC00;
  padding-bottom: 8px;
}

.personal-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.categories-export-wrapper {
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.categories-export-btn {
  background: #FFCC00;
  border: 2px solid #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.categories-export-btn:hover {
  background: #000;
  color: #FFCC00;
  transform: translateY(-2px);
}

.categories-export-btn i {
  font-size: 12px;
}

.category-mini-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.category-mini-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.category-mini-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}

.category-icon {
  font-size: 16px;
}

.category-label {
  font-size: 12px;
  font-weight: 700;
  color: #111;
  flex: 1;
}

.category-count {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 10px;
}

.category-mini-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-post-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 11px;
}

.mini-post-item:hover {
  background: #f9fafb;
}

.mini-post-position {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFCC00;
  color: #000;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.mini-post-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}

.mini-post-icon {
  font-size: 10px;
  color: #3B82F6;
}

.mini-empty {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  padding: 8px;
  font-style: italic;
}

.profile-export-btn {
  background: #FFCC00;
  color: #000;
  border: 2px solid #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-export-btn:hover {
  background: #FFD700;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

.profile-export-btn i {
  font-size: 14px;
}

/* Grid Responsive */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-header-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .personal-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .text-post-modal {
    padding: 20px;
  }

  .text-post-modal-title {
    font-size: 20px;
  }
}

/* Personal Blog Posts in Tabs */
.personal-blog-posts {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.personal-blog-post-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.personal-blog-post-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.personal-blog-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.personal-blog-post-position {
  background: #FFCC00;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  min-width: 40px;
  text-align: center;
}

.personal-blog-post-title {
  flex: 1;
  font-size: 18px;
  font-weight: 900;
  color: #111;
  margin: 0;
}

.personal-blog-post-public,
.personal-blog-post-private {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.personal-blog-post-public {
  background: #dcfce7;
  color: #166534;
}

.personal-blog-post-private {
  background: #fee2e2;
  color: #991b1b;
}

.personal-blog-post-excerpt {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 12px;
}

.personal-blog-post-link {
  display: inline-block;
  color: #3B82F6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}

.personal-blog-post-link:hover {
  text-decoration: underline;
}

.personal-blog-post-read {
  display: inline-block;
  background: #FFCC00;
  color: #000;
  border: 2px solid #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.personal-blog-post-read:hover {
  background: #000;
  color: #FFCC00;
  transform: translateY(-2px);
  text-decoration: none;
}

.personal-blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.personal-blog-post-tag {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
