/* Profile Page Styles */

html {
  scroll-behavior: smooth;
}

body.profile-page {
  background-color: var(--custom-background, #ffffff);
  color: var(--custom-text, #2d3748);
}

/* Override navbar to use custom theme colors */
body.profile-page .navbar.bg-primary {
  background: linear-gradient(135deg, var(--custom-header, #667eea) 0%, var(--custom-button, #667eea) 100%) !important;
}

/* Override card headers to use custom theme colors */
body.profile-page .card-header {
  background: linear-gradient(135deg, var(--custom-header, #667eea) 0%, var(--custom-button, #667eea) 100%);
  color: white;
  font-weight: 600;
  border: none;
}

body.profile-page .card-header h6 {
  color: white;
  margin: 0;
}

/* Override buttons to use custom theme colors */
body.profile-page .btn-primary,
body.profile-page .btn-primary.btn-sm {
  background-color: var(--custom-button, #667eea) !important;
  border-color: var(--custom-button, #667eea) !important;
  color: white !important;
}

body.profile-page .btn-primary:hover,
body.profile-page .btn-primary:focus,
body.profile-page .btn-primary:active,
body.profile-page .btn-primary.btn-sm:hover,
body.profile-page .btn-primary.btn-sm:focus,
body.profile-page .btn-primary.btn-sm:active {
  background-color: color-mix(in srgb, var(--custom-button, #667eea) 85%, black) !important;
  border-color: color-mix(in srgb, var(--custom-button, #667eea) 85%, black) !important;
  color: white !important;
}

body.profile-page .btn-outline-primary {
  color: var(--custom-button, #667eea) !important;
  border-color: var(--custom-button, #667eea) !important;
  background-color: transparent !important;
}

body.profile-page .btn-outline-primary:hover,
body.profile-page .btn-outline-primary:focus,
body.profile-page .btn-outline-primary:active {
  background-color: var(--custom-button, #667eea) !important;
  border-color: var(--custom-button, #667eea) !important;
  color: white !important;
}

/* Form controls */
body.profile-page .form-control:focus,
body.profile-page .form-select:focus {
  border-color: var(--custom-button, #667eea);
  box-shadow: 0 0 0 0.25rem rgba(var(--custom-button-rgb, 102, 126, 234), 0.25);
}

/* Secondary buttons - use slightly muted theme color */
body.profile-page .btn-secondary {
  background-color: color-mix(in srgb, var(--custom-button, #667eea) 60%, #6c757d) !important;
  border-color: color-mix(in srgb, var(--custom-button, #667eea) 60%, #6c757d) !important;
  color: white !important;
}

body.profile-page .btn-secondary:hover,
body.profile-page .btn-secondary:focus,
body.profile-page .btn-secondary:active {
  background-color: color-mix(in srgb, var(--custom-button, #667eea) 50%, #5a6268) !important;
  border-color: color-mix(in srgb, var(--custom-button, #667eea) 50%, #5a6268) !important;
  color: white !important;
}

.profile-banner-container {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 250px;
  overflow: hidden;
}

.profile-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.profile-background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.profile-picture-container {
  text-align: center;
  margin-bottom: 20px;
}

.profile-picture {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid var(--custom-button, #667eea);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.no-picture-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid var(--custom-button, #667eea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: var(--custom-button, #667eea);
  background-color: rgba(102, 126, 234, 0.1);
  margin: 0 auto;
}

.profile-card {
  background: white;
  border-left: 4px solid var(--custom-button, #667eea);
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

.profile-card h2 {
  color: var(--custom-header, #667eea);
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.stat-item {
  padding: 8px;
  border-radius: 6px;
  background-color: rgba(102, 126, 234, 0.05);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--custom-button, #667eea);
}

.stat-label {
  font-size: 12px;
  color: var(--custom-text, #2d3748);
  margin-top: 4px;
}

#interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#interests-list .badge {
  background-color: var(--custom-button, #667eea);
}

.post-composer .card {
  border: 1px solid #e2e8f0;
  background: white;
}

.user-post {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.user-post:target {
  border-color: var(--custom-button, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
  0%, 100% {
    background-color: white;
  }
  50% {
    background-color: rgba(102, 126, 234, 0.1);
  }
}

.post-author {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  border: 2px solid var(--custom-button, #667eea);
}

.post-author-info {
  flex: 1;
}

.post-author-name {
  font-weight: 600;
  color: var(--custom-header, #667eea);
  font-size: 14px;
  margin-bottom: 2px;
}

.post-time {
  font-size: 12px;
  color: #a0aec0;
}

.post-content {
  color: var(--custom-text, #2d3748);
  margin-bottom: 12px;
  line-height: 1.6;
}

.post-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 0;
  min-height: auto;
  width: 100%;
  align-items: center;
}

.reaction-button {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.reaction-button:hover {
  border-color: var(--custom-button, #667eea);
  background-color: rgba(102, 126, 234, 0.05);
}

.reaction-button.active {
  border-color: var(--custom-button, #667eea);
  background-color: rgba(102, 126, 234, 0.15);
}

.reaction-add-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e0;
  background: white;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.reaction-add-btn:hover {
  background-color: #f7fafc;
}

.reaction-emoji-picker {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.reaction-emoji-picker.show {
  display: grid;
}

.reaction-emoji-option {
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.reaction-emoji-option:hover {
  background-color: #f7fafc;
  transform: scale(1.2);
}

.post-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.post-action-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: #718096;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.post-action-btn:hover {
  background-color: #f7fafc;
  color: var(--custom-button, #667eea);
}

.post-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  background-color: #f7fafc;
  border-radius: 4px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--custom-button, #667eea);
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 12px;
  color: var(--custom-header, #667eea);
  margin-bottom: 2px;
}

.comment-text {
  font-size: 13px;
  color: var(--custom-text, #2d3748);
  margin-bottom: 4px;
}

.comment-time {
  font-size: 11px;
  color: #a0aec0;
}

.comment-input-container {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.comment-input-container input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 13px;
}

.comment-input-container button {
  padding: 6px 12px;
  background-color: var(--custom-button, #667eea);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.comment-input-container button:hover {
  opacity: 0.9;
}

.activity-item {
  padding: 12px;
  margin-bottom: 12px;
  background-color: rgba(102, 126, 234, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: start;
  gap: 8px;
}

.activity-item.activity-link {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.activity-item.activity-link:hover {
  background-color: rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

.activity-item i {
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-description {
  font-size: 13px;
  color: var(--custom-text, #2d3748);
  line-height: 1.4;
  word-wrap: break-word;
}

.activity-time {
  font-size: 11px;
  color: #a0aec0;
  margin-top: 2px;
}

.chapter-item {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.chapter-item:last-child {
  border-bottom: none;
}

.chapter-name {
  font-weight: 600;
  color: var(--custom-header, #667eea);
  font-size: 13px;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s ease;
}

.chapter-name:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.chapter-role {
  font-size: 11px;
  color: #718096;
  margin-top: 2px;
}

.color-picker-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-input {
  width: 60px;
  height: 40px;
  padding: 2px;
  cursor: pointer;
}

.color-text {
  font-family: monospace;
  font-size: 12px;
  color: #718096;
}

.profile-upload-preview {
  width: 100%;
  height: 200px;
  background-color: #f7fafc;
  border: 2px dashed #cbd5e0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

/* Circular preview for profile picture (logo) */
#logo-preview-container {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid var(--custom-button, #667eea);
  background-color: #f7fafc;
}

#logo-preview-container img {
  border-radius: 50%;
}

/* Banner preview - keep rectangular */
#banner-preview-container {
  width: 100%;
  height: 150px;
}

/* Background preview - keep rectangular */
#background-preview-container {
  width: 100%;
  height: 200px;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.theme-card {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-card:hover {
  border-color: var(--custom-button, #667eea);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.theme-card.active {
  border-color: var(--custom-button, #667eea);
  background-color: rgba(102, 126, 234, 0.1);
}

.theme-colors {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.theme-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #cbd5e0;
}

.theme-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--custom-header, #667eea);
}

@media (max-width: 768px) {
  .profile-banner-container {
    height: 180px;
    margin-bottom: -75px;
  }

  .profile-picture {
    width: 150px;
    height: 150px;
  }

  .no-picture-placeholder {
    width: 150px;
    height: 150px;
    font-size: 60px;
  }

  .profile-card {
    margin-top: -15px;
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .themes-grid {
    grid-template-columns: 1fr;
  }

  .row {
    flex-direction: column;
  }

  .col-lg-3,
  .col-lg-6 {
    max-width: 100% !important;
  }
}
