.edit-profile-page {
  background: var(--body-bg);
  min-height: 100vh;
  padding-bottom: 2rem;
}

.edit-profile-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1.5rem);
  margin-bottom: 0;
}

.profile-header-card {
  background: var(--white);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  max-width: 1200px;
  margin: 0 auto;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: clamp(80px, 20vw, 100px);
  height: clamp(80px, 20vw, 100px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 3px solid #f3f4f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-header-info {
  text-align: center;
  width: 100%;
}

.profile-header-info h1 {
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.profile-header-info .profile-title {
  display: inline-block;
  padding: clamp(0.375rem, 1vw, 0.5rem) clamp(0.75rem, 2vw, 1rem);
  background: var(--primary-lightest);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.profile-header-info .profile-meta {
  color: var(--text-secondary);
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  margin: 0;
}

.edit-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.75rem, 3vw, 1.5rem);
}

.edit-section {
  background: var(--white);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(1rem, 3vw, 2rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #f3f4f6;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(0.75rem, 2vw, 1.25rem);
  border-bottom: 2px solid #f3f4f6;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex: 1;
  min-width: 0;
}

.section-icon {
  width: clamp(36px, 8vw, 48px);
  height: clamp(36px, 8vw, 48px);
  background: var(--primary-lightest);
  color: var(--primary-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

.toggle-icon {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.toggle-icon.open {
  transform: rotate(180deg);
}

.section-content {
  display: none;
}

.section-content.show {
  display: block;
  animation: slideDown 0.3s ease;
}


  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-divider {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
  text-align: center;
  position: relative;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.language-divider::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 0;
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  z-index: 0;
  pointer-events: none;
}

.language-label {
  display: inline-block;
  background: var(--white);
  padding: clamp(0.375rem, 1vw, 0.5rem) clamp(0.75rem, 2vw, 1.5rem);
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--primary-color);
  position: relative;
  z-index: 1;
  border-radius: 20px;
  border: 2px solid #e5e7eb;
  white-space: nowrap;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.form-row.full-width {
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-label {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: clamp(0.375rem, 1vw, 0.5rem);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.4;
}

.form-label .required {
  color: var(--error-color);
}

.form-input,
.form-select {
  padding: clamp(0.75rem, 2vw, 0.875rem) clamp(0.875rem, 2vw, 1rem);
  font-size: clamp(0.9375rem, 2vw, 1rem);
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: var(--white);
  color: var(--text-primary);
  width: 100%;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

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

.form-input:hover,
.form-select:hover {
  border-color: #d1d5db;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right clamp(0.75rem, 2vw, 1rem) center;
  background-size: 16px;
  padding-right: clamp(2rem, 6vw, 2.5rem);
}

.file-upload-wrapper {
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  cursor: pointer;
  background: #f9fafb;
  -webkit-tap-highlight-color: transparent;
}

.file-upload-wrapper:hover,
.file-upload-wrapper:active {
  border-color: var(--primary-color);
  background: var(--primary-lightest);
}

.file-upload-icon {
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--primary-color);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.file-upload-text {
  font-size: clamp(0.9375rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.file-upload-hint {
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  color: var(--text-tertiary);
}

.file-input {
  display: none;
}

.action-buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-top: clamp(1.5rem, 3vw, 2rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
  border-top: 2px solid #f3f4f6;
}

.btn-save,
.btn-cancel {
  padding: clamp(0.875rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
  font-size: clamp(0.9375rem, 2vw, 1rem);
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn-save {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(75, 88, 160, 0.25);
}

.btn-save:active {
  
  box-shadow: 0 1px 4px rgba(75, 88, 160, 0.3);
}

.btn-cancel {
  background: var(--white);
  color: var(--text-secondary);
  border: 2px solid #e5e7eb;
}

.btn-cancel:active {
  background: #f9fafb;
  border-color: #d1d5db;
}

.add-item-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(0.625rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.25rem);
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.add-item-btn:active {
  background: var(--primary-dark);
  
}

.item-card {
  background: #f9fafb;
  border-radius: 12px;
  padding: clamp(0.875rem, 2vw, 1.25rem);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1rem);
}

.item-content h4 {
  font-size: clamp(0.9375rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.item-content p {
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.item-actions {
  display: flex;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  justify-content: flex-end;
}

.icon-btn {
  width: clamp(40px, 10vw, 44px);
  height: clamp(40px, 10vw, 44px);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.125rem, 3vw, 1.25rem);
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn i {
  font-size: clamp(1.125rem, 3vw, 1.25rem) !important;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.edit {
  background: #e0f2fe;
  color: #0284c7;
}

.icon-btn.edit:active {
  background: #0284c7;
  color: var(--white);
}

.icon-btn.delete {
  background: #f3f4f6;
  color: #6b7280;
}

.icon-btn.delete:active {
  background: #dc2626;
  color: var(--white);
}

.inline-form {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

.inline-form-danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.inline-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
  background: var(--white);
  border-bottom: 2px solid #e5e7eb;
}

.inline-form-header h3 {
  font-size: clamp(1rem, 3vw, 1.125rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.inline-form-close {
  width: clamp(32px, 8vw, 36px);
  height: clamp(32px, 8vw, 36px);
  border-radius: 8px;
  border: none;
  background: #f3f4f6;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.875rem, 2vw, 1rem);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.inline-form-close:active {
  background: #e5e7eb;
  color: var(--text-primary);
}

.inline-form-body {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--white);
}

.inline-form-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
  background: #f9fafb;
  border-top: 2px solid #e5e7eb;
}

.inline-form-footer .btn-save,
.inline-form-footer .btn-cancel {
  width: 100%;
  justify-content: center;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  overflow-y: auto;
  padding: clamp(0.5rem, 2vw, 1.25rem);
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.modal-container {
  background: var(--white);
  border-radius: clamp(12px, 2vw, 16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}


  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1.25rem, 3vw, 2rem);
  border-bottom: 2px solid #f3f4f6;
}

.modal-header h3 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.modal-close-btn {
  width: clamp(32px, 8vw, 36px);
  height: clamp(32px, 8vw, 36px);
  border-radius: 8px;
  border: none;
  background: #f3f4f6;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.875rem, 2vw, 1rem);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:active {
  background: #e5e7eb;
  color: var(--text-primary);
}

.modal-body {
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: clamp(0.75rem, 2vw, 1rem);
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1.25rem, 3vw, 2rem);
  border-top: 2px solid #f3f4f6;
  background: #f9fafb;
}

.modal-footer .btn-save,
.modal-footer .btn-cancel {
  width: 100%;
  justify-content: center;
}

[dir="rtl"] .profile-header-card {
  flex-direction: column;
}

[dir="rtl"] .profile-header-info {
  text-align: center;
}

[dir="rtl"] .section-header-left {
  flex-direction: row-reverse;
}

[dir="rtl"] .section-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .toggle-icon.open {
  transform: rotate(180deg);
}

[dir="rtl"] .action-buttons {
  flex-direction: column-reverse;
}

[dir="rtl"] .form-label {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .form-input,
[dir="rtl"] .form-select,
[dir="rtl"] textarea.form-input {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .form-select {
  background-position: left clamp(0.75rem, 2vw, 1rem) center;
  padding-left: clamp(2rem, 6vw, 2.5rem);
  padding-right: clamp(0.875rem, 2vw, 1rem);
}

[dir="rtl"] .btn-save,
[dir="rtl"] .btn-cancel,
[dir="rtl"] .add-item-btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .item-card {
  flex-direction: column;
}

[dir="rtl"] .item-content {
  text-align: right;
}

[dir="rtl"] .item-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .language-label {
  direction: rtl;
}

[dir="rtl"] .file-upload-wrapper {
  direction: rtl;
}

[dir="rtl"] .file-upload-text,
[dir="rtl"] .file-upload-hint {
  direction: rtl;
}

[dir="rtl"] .inline-form-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .inline-form-footer {
  flex-direction: column-reverse;
}

[dir="rtl"] .inline-form-body {
  direction: rtl;
}

[dir="rtl"] .modal-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .modal-header h3 {
  text-align: right;
}

[dir="rtl"] .modal-body {
  direction: rtl;
}

[dir="rtl"] .modal-footer {
  flex-direction: column-reverse;
}

[dir="rtl"] .edit-container {
  direction: rtl;
}

[dir="rtl"] .section-title {
  text-align: right;
}

[dir="rtl"] .form-row {
  direction: rtl;
}

@media (min-width: 640px) {
  .form-row {
    flex-direction: row;
  }

  .action-buttons {
    flex-direction: row;
    justify-content: flex-end;
  }

  .btn-save,
  .btn-cancel {
    width: auto;
    min-width: 140px;
  }

  .add-item-btn {
    width: auto;
    min-width: 160px;
  }

  .inline-form-footer {
    flex-direction: row;
    justify-content: flex-end;
  }

  .inline-form-footer .btn-save,
  .inline-form-footer .btn-cancel {
    width: auto;
    min-width: 120px;
  }

  .modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }

  .modal-footer .btn-save,
  .modal-footer .btn-cancel {
    width: auto;
    min-width: 120px;
  }

  .item-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  [dir="rtl"] .action-buttons {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .inline-form-footer {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .item-card {
    flex-direction: row-reverse;
  }
}

@media (min-width: 768px) {
  .profile-header-card {
    flex-direction: row;
    align-items: center;
  }

  .profile-header-info {
    text-align: left;
  }

  [dir="rtl"] .profile-header-card {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .profile-header-info {
    text-align: right;
  }
}

@media (hover: hover) {
  .btn-save:hover {
    
    box-shadow: 0 4px 12px rgba(75, 88, 160, 0.35);
  }

  .btn-cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
  }

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

  .icon-btn.edit:hover {
    background: #0284c7;
    color: var(--white);
  }

  .icon-btn.delete:hover {
    background: #dc2626;
    color: var(--white);
  }

  .inline-form-close:hover {
    background: #e5e7eb;
    color: var(--text-primary);
  }

  .modal-close-btn:hover {
    background: #e5e7eb;
    color: var(--text-primary);
  }

  .item-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}
