* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f1eb 0%, #f9f7f4 100%);
  /* replaced blue gradient with warm beige gradient from index.css */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 90px;
}

.main-content {
  flex: 1;
  max-width: 850px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

.profile-container {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.6s ease-out;
}

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

.page-title {
  font-size: 28px;
  color: #1f2937;
  /* updated to dark gray-charcoal from index.css */
  margin-bottom: 24px;
  text-align: center;
  font-weight: 700;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.role-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #78643a 0%, #a88264 100%);
  /* replaced blue gradient with warm brown palette from index.css */
  color: white;
  border-radius: 6px;
  margin-bottom: 32px;
  font-weight: 600;
  font-size: 14px;
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 24px;
  background: #fafaf9;
  /* updated to warm light background from index.css */
  border-radius: 8px;
  border: 1px solid #e5ddd3;
  /* updated to warm border tone from index.css */
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #78643a 0%, #a88264 100%);
  /* replaced blue-teal with warm brown gradient from index.css */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(120, 100, 58, 0.2);
  /* updated shadow to warm tone */
}

.avatar-placeholder {
  font-size: 56px;
}

.avatar-info {
  font-size: 12px;
  color: #6b7280;
  /* updated text color to match index.css palette */
  font-weight: 500;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  /* updated to dark gray-charcoal from index.css */
  margin-top: 28px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5ddd3;
  /* updated border to warm tone */
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #1f2937;
  /* updated to dark gray from index.css */
  font-size: 13px;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5ddd3;
  /* updated border to warm tone */
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #a88264;
  /* updated focus color to warm brown from index.css */
  box-shadow: 0 0 0 2px rgba(168, 130, 100, 0.1);
  /* updated shadow to match */
}

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

.form-group select[multiple] {
  min-height: 100px;
  padding: 8px;
}

.form-group select[multiple] option:checked {
  background: linear-gradient(#78643a, #a88264);
  /* updated to warm brown gradient */
  color: white;
}

.help-text {
  display: block;
  font-size: 12px;
  color: #6b7280;
  /* updated text color */
  margin-top: 4px;
  font-style: italic;
}

.info-box {
  background: #fafaf9;
  /* updated to warm light background */
  border-left: 3px solid #a88264;
  /* updated to warm brown */
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  color: #1f2937;
  /* updated text color */
  font-size: 13px;
}

.teacher-section,
.methodist-section {
  background: #fafaf9;
  /* updated to warm light background */
  padding: 16px;
  border-radius: 8px;
  margin-top: 24px;
  border: 1px solid #e5ddd3;
  /* updated to warm border tone */
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #78643a 0%, #a88264 100%);
  /* replaced blue-teal with warm brown gradient */
  color: white;
  margin-top: 24px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(120, 100, 58, 0.3);
  /* updated shadow to warm tone */
}

.btn-secondary {
  background: #f0ebe4;
  /* updated to warm light background */
  color: #1f2937;
  /* updated text color */
  padding: 10px 16px;
  font-size: 14px;
  width: 100%;
}

.btn-secondary:hover {
  background: #e5ddd3;
  /* updated hover background */
}

.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  display: none;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  display: block;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  display: block;
}

.avatar-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-avatar,
.btn-avatar-clear {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-avatar {
  background: linear-gradient(135deg, #78643a 0%, #a88264 100%);
  /* updated to warm brown gradient */
  color: white;
}

.btn-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(120, 100, 58, 0.3);
  /* updated shadow */
}

.btn-avatar-clear {
  background: #fee2e2;
  color: #991b1b;
}

.btn-avatar-clear:hover {
  background: #fca5a5;
}

.avatar-editor-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

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

.avatar-editor-container {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.avatar-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5ddd3;
  /* updated border to warm tone */
}

.avatar-editor-header h3 {
  margin: 0;
  color: #1f2937;
  /* updated color */
  font-size: 16px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  /* updated color */
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f0f0f0;
  color: #a88264;
  /* updated hover color to warm brown */
}

.avatar-canvas {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 20px;
  border-radius: 8px;
  background: #fafaf9;
  /* updated background to warm tone */
}

.avatar-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  /* updated color */
}

.control-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #78643a, #a88264);
  /* updated to warm brown gradient */
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid #a88264;
  /* updated to warm brown */
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid #a88264;
  /* updated to warm brown */
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-group {
  flex-direction: row;
  gap: 12px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.hint-text {
  font-size: 12px;
  color: #6b7280;
  /* updated color */
  font-style: italic;
  margin: 0;
  padding: 8px 12px;
  background: #fafaf9;
  /* updated background to warm tone */
  border-left: 3px solid #a88264;
  /* updated border to warm brown */
  border-radius: 4px;
}

.avatar-editor-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary-modal,
.btn-primary-modal {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-modal {
  background: #f0ebe4;
  /* updated to warm light background */
  color: #1f2937;
  /* updated color */
}

.btn-secondary-modal:hover {
  background: #e5ddd3;
  /* updated hover background */
}

.btn-primary-modal {
  background: linear-gradient(135deg, #78643a 0%, #a88264 100%);
  /* updated to warm brown gradient */
  color: white;
}

.btn-primary-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(120, 100, 58, 0.3);
  /* updated shadow */
}

/* Clean mobile adaptation - 768px and below */
@media (max-width: 768px) {
  .main-content {
    padding: 20px 12px;
  }

  .profile-container {
    padding: 20px 16px;
  }

  .page-title {
    font-size: 22px;
  }

  .role-badge {
    font-size: 13px;
    padding: 8px 16px;
  }

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

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

  .avatar-placeholder {
    font-size: 48px;
  }

  .section-title {
    font-size: 15px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 13px;
    padding: 8px 10px;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 14px;
    padding: 10px 16px;
  }

  .avatar-editor-container {
    max-width: 90vw;
    padding: 16px;
  }

  .avatar-canvas {
    max-width: 250px;
  }

  .avatar-editor-buttons {
    flex-direction: column;
  }
}

/* Extra small devices - 480px and below */
@media (max-width: 480px) {
  body {
    padding-top: 70px;
  }

  .main-content {
    padding: 16px 10px;
  }

  .profile-container {
    padding: 16px 12px;
    border-radius: 8px;
  }

  .page-title {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .role-badge {
    font-size: 12px;
    padding: 6px 12px;
  }

  .avatar-section {
    padding: 16px;
    gap: 8px;
  }

  .avatar-preview {
    width: 90px;
    height: 90px;
  }

  .avatar-placeholder {
    font-size: 40px;
  }

  .avatar-info {
    font-size: 11px;
  }

  .avatar-controls {
    gap: 6px;
  }

  .btn-avatar,
  .btn-avatar-clear {
    padding: 6px 12px;
    font-size: 12px;
  }

  .section-title {
    font-size: 14px;
    margin-top: 20px;
    margin-bottom: 12px;
  }

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

  .form-group label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 12px;
    padding: 8px 10px;
  }

  .form-group textarea {
    min-height: 80px;
  }

  .help-text {
    font-size: 11px;
  }

  .info-box {
    font-size: 12px;
    padding: 10px;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 13px;
    padding: 10px 16px;
    margin-top: 16px;
  }

  .message {
    font-size: 12px;
    padding: 10px;
  }

  .avatar-editor-header h3 {
    font-size: 14px;
  }

  .control-group label {
    font-size: 12px;
  }

  .avatar-editor-buttons {
    gap: 8px;
  }

  .btn-secondary-modal,
  .btn-primary-modal {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Tiny devices - 360px and below */
@media (max-width: 360px) {
  .main-content {
    padding: 12px 8px;
  }

  .profile-container {
    padding: 12px 10px;
  }

  .page-title {
    font-size: 16px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 13px;
  }

  .btn-avatar,
  .btn-avatar-clear {
    font-size: 11px;
    padding: 5px 10px;
  }
}
