/* ============================================
   QUEST4YOU - PROFILE PAGE STYLES
   ============================================ */

/* Profile Container */
.profile-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e53935, #ff9800, #fdd835, #4caf50);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e53935, #c2185b);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar img.loaded {
  display: block;
}

.avatar-fallback {
  font-size: 2.5rem;
  color: white;
  font-weight: 700;
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  color: #333;
}

.profile-email {
  color: #666;
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.profile-joined {
  color: #999;
  margin: 0;
  font-size: 0.85rem;
}

.btn-edit {
  padding: 10px 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e53935;
}

.stat-label {
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Sections */
.results-section,
.badges-section,
.settings-section,
.danger-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.result-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.result-card:hover {
  transform: translateY(-3px);
}

.result-card-header {
  padding: 1.25rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.result-card-icon {
  font-size: 2rem;
}

.result-card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.result-card-body {
  padding: 1.25rem;
}

.result-score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.result-score-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.result-score-fill {
  height: 100%;
  background: linear-gradient(90deg, #e53935, #ff9800);
  border-radius: 4px;
}

.result-score-value {
  font-weight: 600;
  color: #e53935;
  min-width: 45px;
}

.result-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #666;
}

.result-date {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state p {
  color: #666;
  margin-bottom: 1.5rem;
}

/* Badges Grid */
.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  min-width: 100px;
  transition: transform 0.2s ease;
}

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

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

/* Settings Card */
.settings-card,
.danger-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow: hidden;
}

.setting-item,
.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.setting-item:last-child,
.danger-item:last-child {
  border-bottom: none;
}

.setting-info,
.danger-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-label,
.danger-label {
  font-weight: 500;
  color: #333;
}

.setting-desc,
.danger-desc {
  font-size: 0.85rem;
  color: #888;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #e53935, #c2185b);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Danger Zone */
.danger-section .section-title {
  color: #c62828;
}

.danger-card {
  border: 1px solid rgba(198, 40, 40, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #f44336, #c62828);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #e53935, #b71c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 450px;
  width: 100%;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e0e0e0;
}

.modal-content h2 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
}

.modal-content .form-group {
  margin-bottom: 1rem;
}

.modal-content label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #444;
}

.modal-content input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  box-sizing: border-box;
}

.modal-content input:focus {
  outline: none;
  border-color: #e53935;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions .btn {
  flex: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-info h1 {
    font-size: 1.5rem;
  }
  
  .btn-edit {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .setting-item,
  .danger-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
