/* Profile Page Styles */

.profile-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(107, 93, 79, 0.08);
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img,
.avatar-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
}

.avatar-placeholder {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
}

.profile-info {
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.profile-username {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.profile-rank {
  /* Styles inherited from main.css .rank-badge */
}

.profile-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-item i {
  font-size: 16px;
}

.profile-actions {
  flex-shrink: 0;
  margin-left: auto;
}

/* Profile buttons are now in buttons.css */

/* Tabs */
.profile-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  padding: 0 30px;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(107, 93, 79, 0.05);
}

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

.tab-btn i {
  font-size: 16px;
}

.tab-btn .icon-svg {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Tab Panels */
.profile-content {
  padding: 30px;
}

.tab-panel {
  display: none;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

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

/* Guestbook */
.guestbook-form {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.guestbook-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  background: var(--bg);
  color: var(--text-primary);
}

.guestbook-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.guestbook-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guestbook-entry {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.2s;
}

.guestbook-entry:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(107, 93, 79, 0.1);
}

.entry-info {
  width: 100%;
}

.entry-content-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px 0;
}


.entry-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.entry-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.entry-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 6px;
  color: var(--primary);
}

.entry-icon i {
  font-size: 14px;
}

.entry-author-name {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.entry-author-name:hover {
  opacity: 0.8;
}

.entry-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.entry-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 14px;
}

.entry-delete-btn:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.entry-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.entry-delete-btn i {
  font-size: 14px;
}

.entry-rank {
  /* Styles inherited from main.css .rank-badge */
}

/* Profile Topics */
.profile-topics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-topic-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.2s;
}

.profile-topic-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(107, 93, 79, 0.1);
}

.topic-info {
  width: 100%;
}

.topic-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.topic-title:hover {
  color: var(--primary);
}

.topic-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.topic-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.topic-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 6px;
  color: var(--primary);
  position: relative;
}

.topic-icon i {
  font-size: 14px;
}

.topic-icon .icon-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 1;
}

.topic-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.topic-footer .category-badge {
  margin-left: auto;
}

.category-badge {
  /* Styles inherited from main.css unified category badge */
}

/* Profile Posts */
.profile-posts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-post-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.2s;
}

.profile-post-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(107, 93, 79, 0.1);
}

.post-info {
  width: 100%;
}

.post-topic {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.post-topic:hover {
  color: var(--primary);
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px 0;
}


.post-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.post-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 6px;
  color: var(--primary);
}

.post-icon i {
  font-size: 14px;
}

.post-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-footer .category-badge {
  margin-left: auto;
}

/* Profile Edit */
.profile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  border-bottom: 1px solid var(--border);
}

.profile-edit-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.profile-edit-content {
  padding: 30px;
}

/* Form Grid - 2x2 layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.form-group {
  margin-bottom: 0;
}

/* Full width form groups (Avatar and Checkbox) */
.form-group-full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(166, 139, 111, 0.1);
}

.form-group small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.current-avatar img,
.current-avatar .avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
}

.current-avatar .avatar-placeholder {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
}

.avatar-upload {
  flex: 1;
}

.avatar-upload input[type="file"] {
  display: none;
}

/* Upload button is now in buttons.css */

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Form action buttons are now in buttons.css */

/* Responsive */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group-full {
    grid-column: 1;
  }
  
  .profile-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .profile-avatar img,
  .profile-avatar .avatar-placeholder {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
  
  .profile-info {
    flex: 1;
    width: auto;
  }
  
  .profile-name-row {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
  }
  
  .profile-username {
    font-size: 18px;
    margin-bottom: 0;
  }
  
  .profile-rank {
    /* Styles inherited from main.css .rank-badge */
  }
  
  .profile-stats {
    flex-direction: row;
    gap: 12px;
    width: auto;
    margin-top: 0;
    flex-wrap: wrap;
  }
  
  .stat-item {
    font-size: 12px;
    gap: 4px;
  }
  
  .stat-item i {
    font-size: 14px;
  }
  
  .profile-header {
    flex-wrap: wrap;
  }
  
  .profile-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
    order: 3;
  }
  
  .btn-friend,
  .btn-edit-profile {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .profile-tabs {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .profile-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab-btn {
    padding: 12px 10px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
    gap: 4px;
    max-width: 33.33%;
    flex: 1;
  }
  
  .tab-btn i {
    font-size: 12px;
    flex-shrink: 0;
  }
  
  .tab-btn .icon-svg {
    width: 12px;
    height: 12px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
  }
  
  .tab-btn span {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .profile-content {
    padding: 16px;
  }
  
  .empty-state {
    padding: 40px 20px;
  }
  
  .empty-state i {
    font-size: 36px;
  }
  
  .empty-state p {
    font-size: 14px;
  }
  
  .guestbook-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }
  
  .guestbook-form textarea {
    font-size: 14px;
    padding: 10px;
  }
  
  .guestbook-entries {
    gap: 16px;
  }
  
  .guestbook-entry {
    padding: 12px;
  }
  
  .entry-icon {
    width: 28px;
    height: 28px;
  }
  
  .entry-icon i {
    font-size: 12px;
  }
  
  .entry-content-text {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .entry-footer {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .entry-author-name {
    font-size: 11px;
  }
  
  .entry-date {
    font-size: 11px;
  }
  
  .entry-divider {
    margin: 10px 0;
  }
  
  .profile-topic-item,
  .profile-post-item {
    padding: 12px;
  }
  
  .topic-icon,
  .post-icon {
    width: 28px;
    height: 28px;
  }
  
  .topic-icon i,
  .post-icon i {
    font-size: 12px;
  }
  
  .topic-icon .icon-count {
    font-size: 9px;
    min-width: 14px;
    height: 14px;
    top: -5px;
    right: -5px;
  }
  
  .topic-info,
  .post-info {
    width: 100%;
  }
  
  .topic-title,
  .post-topic {
    font-size: 15px;
    margin-bottom: 6px;
  }
  
  .topic-footer,
  .post-footer {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .topic-date,
  .post-date {
    font-size: 11px;
  }
  
  .post-excerpt {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .topic-divider,
  .post-divider {
    margin: 10px 0;
  }
  
  .profile-edit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  
  .profile-edit-header h1 {
    font-size: 20px;
  }
  
  .profile-edit-content {
    padding: 16px;
  }
  
  .form-grid {
    gap: 20px;
  }
  
  .form-label {
    font-size: 13px;
  }
  
  .form-input,
  .form-select {
    padding: 10px;
    font-size: 14px;
  }
  
  .avatar-upload-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .current-avatar img,
  .current-avatar .avatar-placeholder {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
  
  .avatar-upload {
    width: 100%;
  }
  
  .btn-upload {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
  }
  
  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 12px 24px;
  }
}

