:root {
  /* Основная тёмная тема */
  --primary-color: #0a84ff;
  --background-color: #000000;
  --surface-color: #1c1c1e;
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --border-color: #38383a;
  --accent-color: #30d158;
  --warning-color: #ff9f0a;
  --error-color: #ff453a;
}

[data-theme="light"] {
  /* Светлая тема */
  --primary-color: #007aff;
  --background-color: #ffffff;
  --surface-color: #f2f2f7;
  --text-primary: #000000;
  --text-secondary: #8e8e93;
  --border-color: #c6c6c8;
  --accent-color: #34c759;
  --warning-color: #ff9500;
  --error-color: #ff3b30;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
  padding-bottom: 40px;
}

.container {
  max-width: 100%;
  padding: 0 16px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background-color: var(--background-color);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  font-size: 20px;
  color: var(--primary-color);
  text-decoration: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.header-placeholder {
  width: 30px;
}

/* Avatar Section */
.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}

.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 60px;
  background-color: var(--surface-color);
  margin-bottom: 12px;
  cursor: pointer;
  overflow: hidden;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 60px;
}

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-text {
  font-size: 16px;
  color: var(--primary-color);
  cursor: pointer;
}

/* Profile Info */
.profile-info {
  background-color: var(--surface-color);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  min-height: 60px;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  flex: 1;
  font-size: 16px;
  color: var(--text-primary);
}

.info-value {
  flex: 2;
  font-size: 16px;
  color: var(--text-secondary);
  text-align: right;
  padding-right: 12px;
}

.edit-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--primary-color);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.edit-btn:hover {
  background-color: rgba(0, 122, 255, 0.1);
}

/* Logout Button */
.logout-btn {
  width: 100%;
  padding: 16px;
  background-color: var(--error-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background-color: #d70015;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: var(--background-color);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 16px;
}

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

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.ios-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  background-color: var(--background-color);
  color: var(--text-primary);
  transition: border-color 0.3s;
}

.ios-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Verification Section */
.verification-section {
  margin-top: 20px;
}

.verification-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.verification-code {
  width: 40px;
  height: 48px;
  text-align: center;
  font-size: 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--background-color);
  color: var(--text-primary);
}

.verification-code:focus {
  outline: none;
  border-color: var(--primary-color);
}

.verification-timer {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

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

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

.btn-secondary {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
}
.avatar-image {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--secondary-background);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  font-size: 48px;
  color: var(--secondary-label);
}

/* Улучшенная обработка больших изображений */
.avatar-image {
  transition: transform 0.3s ease;
}

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

/* Индикатор загрузки */
.uploading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 10;
}
