/* ===========================
   PROFILE PAGE STYLES
   =========================== */

/* Profile Container */
.profile-container {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition), color var(--transition);
}

/* Profile Header Section */
.profile-header {
  position: relative;
  background: var(--bg-secondary);
  margin-bottom: 2rem;
}

.profile-cover {
  height: 300px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.profile-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 300"><defs><pattern id="dots" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="1200" height="300" fill="url(%23dots)"/></svg>');
  opacity: 0.5;
}

.profile-cover-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.profile-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: flex-start;
  padding: 0 2rem 2rem;
  margin-top: -80px;
  position: relative;
  z-index: 1;
}

/* Avatar Section */
.profile-avatar-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 6px solid var(--bg-secondary);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  font-size: 1.2rem;
}

.avatar-edit-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* Profile Info Section */
.profile-info {
  padding-top: 1.5rem;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.profile-username {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  font-weight: 500;
}

.profile-bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
  max-width: 500px;
}

.profile-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item svg {
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
}

/* Profile Stats */
.profile-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

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

/* Profile Action Buttons */
.profile-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-action {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-action {
  background: var(--primary);
  color: white;
}

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

.btn-secondary-action {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

/* XP Progress Section */
.xp-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.xp-level {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.xp-level-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.xp-level-number {
  font-size: 2rem;
}

.xp-level-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.9;
}

.xp-level-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.xp-level-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.xp-info {
  text-align: right;
}

.xp-current {
  font-weight: 700;
  color: var(--primary);
}

.xp-total {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.xp-progress-container {
  margin-bottom: 1.5rem;
}

.xp-progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  width: 45%;
  border-radius: 10px;
  animation: progressFill 1s ease-out;
}

@keyframes progressFill {
  from {
    width: 0;
  }
}

.xp-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
}

.xp-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.xp-source {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
}

.xp-source-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.xp-source-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.profile-tabs::-webkit-scrollbar {
  height: 4px;
}

.profile-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.profile-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.profile-tab {
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition);
}

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

.profile-tab.active {
  color: var(--primary);
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.tab-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  font-weight: 700;
}

/* Tab Content Areas */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

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

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

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

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

.product-image {
  width: 100%;
  height: 180px;
  background: var(--bg-tertiary);
  object-fit: cover;
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.product-actions button {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.product-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.badge-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: visible;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: default;
}

.badge-card:not(.locked):hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.badge-card.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.badge-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.9rem;
}

.badge-icon {
  font-size: 2.8rem;
  margin-bottom: 0.4rem;
  line-height: 1;
}

.badge-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.badge-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.badge-date i {
  margin-right: 2px;
}

/* Tooltip badge su hover */
.badge-card .badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 180px;
  max-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  text-align: left;
  pointer-events: none;
}

.badge-card .badge-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

.badge-card:hover .badge-tooltip {
  display: block;
}

.badge-tooltip-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.badge-tooltip-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.badge-tooltip-xp {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

/* Mini badge strip (profilo header) */
.badge-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge-strip-item {
  font-size: 1.4rem;
  cursor: default;
  position: relative;
  transition: transform 0.15s;
}

.badge-strip-item:hover {
  transform: scale(1.3);
}

.badge-strip-item .badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 100;
  text-align: left;
  pointer-events: none;
  white-space: nowrap;
}

.badge-strip-item .badge-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.badge-strip-item:hover .badge-tooltip {
  display: block;
}

@media (max-width: 600px) {
  .badges-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
  .badge-icon { font-size: 2.2rem; }
  .badge-card .badge-tooltip { display: none !important; }
  .badge-strip-item .badge-tooltip { display: none !important; }
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 2rem;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-secondary);
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-text {
  color: var(--text-primary);
  margin: 0;
}

/* Followers List */
.followers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.follower-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.follower-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.follower-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.follower-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.follower-level {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.follower-actions {
  display: flex;
  gap: 0.5rem;
}

.follower-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-follow {
  background: var(--primary);
  color: white;
}

.btn-follow:hover {
  background: var(--primary-dark);
}

.btn-unfollow {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-unfollow:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Messages Section */
.messages-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
}

.messages-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-secondary);
}

.message-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.message-item:hover {
  background: var(--card-bg);
}

.message-item.active {
  background: var(--card-bg);
  border-left: 3px solid var(--primary);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.message-user {
  font-weight: 600;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.message-preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-area {
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 70%;
}

.message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  line-height: 1.5;
}

.message.received .message-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius) var(--radius-lg) var(--radius-lg);
}

.message.sent .message-bubble {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg) var(--radius) var(--radius-lg);
}

.chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font);
  resize: none;
  max-height: 100px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.chat-send-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.chat-send-btn:hover {
  background: var(--primary-dark);
}

/* Settings Section */
.settings-container {
  max-width: 800px;
}

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.form-group {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group.full {
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-label.required::after {
  content: '*';
  color: var(--danger);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: all var(--transition);
}

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

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

.form-help {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.toggle-label {
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  background: var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch input {
  display: none;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(22px);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition);
  cursor: pointer;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
}

/* Danger Zone */
.danger-zone {
  background: rgba(var(--danger-rgb), 0.05);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.danger-zone-title {
  color: var(--danger);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.danger-zone-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-danger {
  background: var(--danger);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .profile-main {
    grid-template-columns: 1fr;
    padding: 0 1.5rem 1.5rem;
  }

  .profile-actions {
    width: 100%;
  }

  .messages-container {
    grid-template-columns: 250px 1fr;
  }

  .form-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .profile-cover {
    height: 200px;
  }

  .profile-main {
    margin-top: -60px;
  }

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

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-stats {
    gap: 1rem;
  }

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

  .xp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .xp-level-badge {
    width: 60px;
    height: 60px;
  }

  .xp-level-number {
    font-size: 1.5rem;
  }

  .xp-info {
    text-align: left;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .messages-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .messages-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .message-item {
    border-bottom: 1px solid var(--border);
  }

  .chat-area {
    min-height: 400px;
  }

  .message {
    max-width: 85%;
  }

  .settings-section {
    padding: 1.5rem;
  }

  .followers-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

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

@media (max-width: 480px) {
  .profile-cover {
    height: 150px;
  }

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

  .avatar-edit-btn {
    width: 40px;
    height: 40px;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .profile-info {
    padding-top: 1rem;
  }

  .profile-stats {
    justify-content: space-around;
    gap: 0.5rem;
  }

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

  .profile-actions {
    flex-direction: column;
  }

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

  .xp-section {
    padding: 1.5rem;
  }

  .profile-tabs {
    overflow-x: auto;
  }

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

  .followers-list {
    grid-template-columns: 1fr;
  }

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

  .chat-messages {
    padding: 1rem;
  }

  .message {
    max-width: 90%;
  }

  .profile-main {
    padding: 0 1rem 1rem;
  }

  .settings-section {
    padding: 1rem;
  }

  .settings-section-title {
    font-size: 1rem;
  }
}

/* Dark Theme Enhancements */
[data-theme="dark"] .profile-avatar {
  border-color: var(--bg-primary);
}

[data-theme="dark"] .timeline-item::before {
  border-color: var(--bg-primary);
}

[data-theme="dark"] .chat-input,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .toggle-slider {
  background: var(--bg-tertiary);
}

/* ===========================
   PRODUCT LIST ROWS (profile tab)
   =========================== */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-row {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
  flex-wrap: nowrap;
}
.product-row:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}

.product-row-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.product-row-info {
  flex: 1;
  min-width: 0;
}
.product-row-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-row-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-row-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.product-row-date {
  font-size: 12px;
  color: var(--text-muted);
}

.product-row-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.product-row-badge.active {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.product-row-badge.featured {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}

.product-row-edit {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.product-row-edit:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Responsive: su mobile stack verticale */
@media (max-width: 600px) {
  .product-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .product-row-info {
    flex: 1 1 calc(100% - 64px);
  }
  .product-row-meta {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    gap: 12px;
    font-size: 12px;
  }
}
