/* Profile Edit Page Styles */

.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.profile-container h1 {
  margin-bottom: 30px;
  color: #1a1a1a;
}

.form-section {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.25rem;
  color: #1a1a1a;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  align-items: start;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

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

.avatar-preview {
  border-radius: 8px;
}

.avatar-upload-controls {
  width: 100%;
  display: flex;
  justify-content: center;
}

.profile-fields {
  display: flex;
  flex-direction: column;
}

.file-input {
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  color: #333;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.15s ease;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.error-messages {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
  color: #721c24;
}

.error-messages h3 {
  margin-top: 0;
  font-size: 1rem;
}

.error-messages ul {
  margin: 8px 0 0 20px;
}

/* Avatar Crop Modal */
.avatar-crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.avatar-crop-modal-content {
  background: #ffffff;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.avatar-crop-modal-header {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.avatar-crop-modal-header h3 {
  margin: 0;
  color: #1a1a1a;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: #333;
}

.avatar-crop-modal-body {
  padding: 20px;
  flex: 1;
  overflow: auto;
}

.cropper-wrapper {
  max-height: 400px;
}

.avatar-crop-modal-footer {
  padding: 20px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Dark Theme */
[data-theme="dark"] .profile-container h1,
[data-theme="dark"] .form-section h2,
[data-theme="dark"] .form-group label {
  color: #fff;
}

[data-theme="dark"] .form-section {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .form-control {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

[data-theme="dark"] .form-control:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .avatar-crop-modal-content {
  background: #1a1a1a;
}

[data-theme="dark"] .avatar-crop-modal-header,
[data-theme="dark"] .avatar-crop-modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .avatar-crop-modal-header h3 {
  color: #fff;
}

[data-theme="dark"] .close-btn {
  color: #aaa;
}

[data-theme="dark"] .close-btn:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-container {
    padding: 20px 15px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .avatar-section {
    align-items: center;
  }

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

  .form-actions .btn {
    width: 100%;
  }
}
