/* Profile Modal Component Styles */

/* Profile Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.profile-modal {
  background: var(--cream);
  border-radius: 20px;
  padding: 0;
  width: 90%;
  max-width: 500px;
  height: 85vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-modal-content {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
  text-align: center;
}

.profile-modal .profile-pic-container {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--bg-medium);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 3px solid var(--amber);
  flex-shrink: 0;
}

.profile-modal .profile-pic-container.readonly {
  cursor: default;
}

.profile-modal .profile-pic-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-modal .profile-pic-container .initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-medium);
  line-height: 120px;
}

.profile-modal .profile-pic-container:hover::after {
  content: 'Change';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.75rem;
  padding: 6px;
}

.profile-modal .profile-username {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 5px;
}

.profile-modal .profile-email {
  font-size: 0.85rem;
  color: var(--text-medium);
  margin-bottom: 25px;
}

.profile-modal .logout-btn {
  background: var(--rust);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-modal .logout-btn:hover {
  background: #8b3a2f;
}

/* New profile modal header */
.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--bg-medium);
}

.profile-modal-header .logout-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Thread action buttons (Share, Close) - same styling as thread modal */
.find-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-bottom: 2px solid var(--bg-medium);
  flex-shrink: 0;
}

.thread-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--espresso);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.thread-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

.thread-action-btn:hover {
  background: var(--dark-chocolate);
  transform: translateY(-1px);
}

.thread-action-btn.share-btn:hover {
  background: var(--amber-dark);
}

.thread-action-btn.close-btn:hover {
  background: #1a0e08;
}

/* Social tabs */
.social-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
  border-bottom: 2px solid var(--bg-medium);
}

.social-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.2s;
}

.social-tab.active {
  color: var(--espresso);
  border-bottom-color: var(--amber);
  font-weight: 700;
}

.social-tab:hover {
  background: var(--bg-light);
}

/* Social tab content */
.social-tab-content {
  display: none;
}

.social-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Following/Followers tabs need flex layout for scrolling */
#following-tab.active,
#followers-tab.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Avatar grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.avatar-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}

.avatar-grid-item:hover {
  background: var(--bg-light);
}

.avatar-grid-item .avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--amber);
}

.avatar-grid-item .avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-grid-item .avatar-circle .initials {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
}

.avatar-grid-item .username {
  font-size: 0.75rem;
  color: var(--text-medium);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-grid-item .user-location {
  font-size: 0.65rem;
  color: var(--text-light);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  margin-top: -2px;
}

.avatar-grid .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-style: italic;
}

.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-medium);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Follow/Unfollow action buttons */
.follow-action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
  background: var(--espresso);
  color: white;
}

.follow-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.follow-action-btn:hover:not(:disabled) {
  background: var(--dark-chocolate);
  transform: translateY(-1px);
}

/* Search box for following */
.follow-search-container {
  padding: 0 16px 8px;
}

.follow-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--bg-medium);
  border-radius: 20px;
  font-size: 0.9rem;
  background: var(--bg-light);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.follow-search-input:focus {
  border-color: var(--amber);
}

.follow-search-input::placeholder {
  color: var(--text-light);
}
