/* ============================================
   СТРАНИЦА ПРОФИЛЯ — PULKOVO AIR
   Культурные крылья России
   ============================================ */

/* ----- СБРОС И БАЗА ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Comfortaa', cursive;
  background: #F5F7FA;
}

/* ----- СТРАНИЦА ----- */
.profile-page {
  flex: 1 0 auto;
  padding: 20px 0 40px;
  background: #F5F7FA;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ----- ЗАГОЛОВОК ----- */
.profile-header {
  text-align: center;
  margin-bottom: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.page-title i {
  color: #F59E0B;
  font-size: 24px;
}

.page-description {
  color: #6B7280;
  font-size: 12px;
}

/* ----- АЛЕРТЫ ----- */
.alert {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-success {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #DCFCE7;
  border-left: 4px solid #16A34A;
}

.alert-error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FEE2E2;
  border-left: 4px solid #DC2626;
}

.alert i {
  font-size: 18px;
}

/* ----- СЕТКА ----- */
.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----- КАРТОЧКА (правая колонка) ----- */
.card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #E2E8F0;
}

.card-header {
  font-size: 16px;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header i {
  color: #F59E0B;
}

.info-section {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #E5E7EB;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: #F59E0B;
}

/* ----- ЛЕВАЯ КОЛОНКА ----- */
.profile-sidebar {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #E5E7EB;
}

.avatar-card {
  padding: 20px;
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 15px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #F59E0B;
}

.avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #1E3A8A, #0F2B6E);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 3px solid #F59E0B;
}

.avatar i {
  font-size: 50px;
  color: #F59E0B;
}

.btn-change-avatar {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: #1E3A8A;
  border: 2px solid #F59E0B;
  border-radius: 50%;
  color: #F59E0B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.btn-change-avatar:hover {
  background: #F59E0B;
  color: #1E3A8A;
  transform: scale(1.05);
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 5px;
}

.profile-login {
  color: #6B7280;
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-login i {
  color: #F59E0B;
}

/* ----- БЕЙДЖИ ----- */
.role-badge {
  display: inline-block;
  background: #EFF6FF;
  color: #1E3A8A;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
}

.rank-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.rank-badge--pilot {
  background: #EFF6FF;
  color: #1E3A8A;
  border: 1px solid #BFDBFE;
}

.rank-badge--admin {
  background: linear-gradient(135deg, #FEF3E8, #FFF7ED);
  color: #B45309;
  border: 1px solid #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.profile-bio {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 12px;
  margin: 15px 0;
  text-align: center;
  font-size: 13px;
  color: #4B5563;
  border-left: 3px solid #F59E0B;
}

/* ----- КНОПКИ ----- */
.profile-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-edit,
.btn-logout,
.btn-admin,
.btn-primary,
.btn-accent,
.btn-danger,
.btn-outline,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 40px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: 'Comfortaa', cursive;
  min-width: 110px;
}

.btn-edit,
.btn-primary {
  background: linear-gradient(135deg, #1E3A8A 0%, #0F2B6E 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.btn-edit:hover,
.btn-primary:hover {
  background: #F59E0B;
  color: #1E3A8A;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

.btn-admin,
.btn-accent {
  background: #F59E0B;
  color: #1E3A8A;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-admin:hover,
.btn-accent:hover {
  background: #1E3A8A;
  color: #F59E0B;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(30, 58, 138, 0.3);
}

.btn-logout,
.btn-danger {
  background: #F3F4F6;
  color: #DC2626;
  border: 1px solid #FEE2E2;
}

.btn-logout:hover,
.btn-danger:hover {
  background: #DC2626;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

.btn-secondary,
.btn-outline {
  background: white;
  color: #1E3A8A;
  border: 2px solid #1E3A8A;
}

.btn-secondary:hover,
.btn-outline:hover {
  background: #1E3A8A;
  color: white;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-width: auto;
}

/* ----- VK / VATSIM ----- */
.vk-section,
.vatsim-section,
.connect-section {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
}

.vk-header,
.vatsim-header,
.connect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E5E7EB;
}

.vk-header-left,
.vatsim-header-left,
.connect-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vk-header-left i,
.vatsim-header-left i,
.connect-header-left i {
  font-size: 16px;
  color: #4680C2;
}

.vk-header-left h3,
.vatsim-header-left h3,
.connect-header-left h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1E3A8A;
  margin: 0;
}

.vk-badge,
.vatsim-badge,
.connect-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: #D1FAE5;
  color: #10B981;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.vk-badge.disconnected,
.vatsim-badge.disconnected,
.connect-badge.off {
  background: #FEF3C7;
  color: #D97706;
}

.vk-connected,
.vk-not-connected,
.vatsim-connected,
.vatsim-not-connected,
.connect-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.vk-connected .vk-icon,
.vatsim-connected .vatsim-icon,
.connect-body.on .connect-icon {
  background: #D1FAE5;
}

.vk-connected .vk-icon i,
.vatsim-connected .vatsim-icon i,
.connect-body.on .connect-icon i {
  color: #10B981;
  font-size: 18px;
}

.vk-icon,
.vatsim-icon,
.connect-icon {
  width: 36px;
  height: 36px;
  background: #EFF6FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vk-icon i,
.vatsim-icon i,
.connect-icon i {
  font-size: 18px;
}

.vk-content,
.vatsim-content,
.connect-info {
  flex: 1;
  min-width: 0;
}

.vk-title,
.vatsim-title,
.connect-info-title {
  font-weight: 700;
  color: #1E3A8A;
  font-size: 13px;
  margin-bottom: 2px;
}

.vk-description,
.vatsim-description,
.connect-info-desc {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
}

.vk-revoke-btn,
.vatsim-revoke-btn,
.connect-btn--revoke {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #DC2626;
  border: 1px solid #FEE2E2;
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.vk-revoke-btn:hover,
.vatsim-revoke-btn:hover,
.connect-btn--revoke:hover {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

.vk-connect-btn,
.vatsim-connect-btn,
.connect-btn--connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #4680C2;
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.vk-connect-btn:hover,
.vatsim-connect-btn:hover,
.connect-btn--connect:hover {
  background: #1E3A8A;
  transform: translateY(-1px);
}

/* ----- СТАТИСТИКА VATSIM ----- */
.vatsim-stats,
.connect-stats {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 16px 16px 16px;
  border-top: 1px solid #E5E7EB;
}

.vatsim-stat-item,
.connect-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #E5E7EB;
  font-size: 12px;
}

.vatsim-stat-item:last-child,
.connect-stat-item:last-child {
  border-bottom: none;
}

.vatsim-stat-label,
.connect-stat-label {
  color: #6B7280;
  font-weight: 500;
}

.vatsim-stat-value,
.connect-stat-value {
  color: #1E3A8A;
  font-weight: 600;
}

/* ----- ПРАВАЯ КОЛОНКА ----- */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Таблица рейсов */
.desktop-table {
  display: none;
}

.flights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.flights-table th,
.flights-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
}

.flights-table th {
  background: #F8FAFC;
  font-weight: 700;
  color: #1E3A8A;
  text-transform: uppercase;
  font-size: 10px;
}

.flight-number {
  font-family: monospace;
  font-weight: 700;
  color: #1E3A8A;
}

.rating {
  font-weight: 700;
  color: #10B981;
  text-align: center;
}

/* Мобильные карточки */
.mobile-flights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flight-card-mobile {
  background: #F9FAFB;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #E5E7EB;
}

.flight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E5E7EB;
}

.flight-number-mobile {
  font-family: monospace;
  font-weight: 800;
  font-size: 14px;
  color: #1E3A8A;
  background: #EFF6FF;
  padding: 3px 10px;
  border-radius: 16px;
}

.flight-rating-mobile {
  font-weight: 700;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
}

.flight-rating-mobile.rating {
  background: #D1FAE5;
  color: #10B981;
}

.flight-route-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: monospace;
  font-weight: 600;
  font-size: 14px;
  color: #1E3A8A;
}

.flight-route-mobile i {
  color: #F59E0B;
  font-size: 12px;
}

.flight-details-mobile {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #E5E7EB;
}

.detail-item {
  flex: 1;
  text-align: center;
  font-size: 11px;
}

.detail-label {
  color: #9CA3AF;
  display: block;
  margin-bottom: 3px;
}

.detail-value {
  font-weight: 600;
  color: #1E3A8A;
}

/* Личная информация */
.info-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #E5E7EB;
}

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

.info-label {
  font-weight: 600;
  color: #4B5563;
  font-size: 12px;
}

.info-value {
  color: #1E3A8A;
  font-weight: 500;
  font-size: 12px;
}

.text-muted {
  color: #9CA3AF;
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

.back-link {
  text-align: center;
  margin-top: 20px;
}

/* ----- ДРУЗЬЯ ----- */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.friend-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: #F8FAFC;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.friend-card:hover {
  background: #FFF7ED;
  border-color: #F59E0B;
  transform: translateY(-2px);
}

.friend-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #0F2B6E);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-avatar i {
  color: #F59E0B;
  font-size: 20px;
}

.friend-name {
  font-size: 13px;
  font-weight: 600;
  color: #1E3A8A;
  text-align: center;
}

.rank-mini {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  background: #EFF6FF;
  color: #1E3A8A;
}

.rank-mini--admin {
  background: #FEF3E8;
  color: #B45309;
  border: 1px solid #F59E0B;
}

.friend-achievements {
  font-size: 10px;
  color: #F59E0B;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.friends-requests-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FEF3E8;
  color: #F59E0B;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  transition: all 0.2s;
  border: 1px solid #FED7AA;
}

.friends-requests-badge:hover {
  background: #FFF7ED;
  border-color: #F59E0B;
}

.friends-requests-badge strong {
  color: #1E3A8A;
}

/* ----- ПОИСК ДРУЗЕЙ ----- */
.friends-search-form {
  max-width: 600px;
  margin: 0 auto;
}

.friends-search-input-wrapper {
  display: flex;
  gap: 10px;
  position: relative;
}

.friends-search-input-wrapper>i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 18px;
}

.friends-search-input-wrapper input {
  flex: 1;
  padding: 14px 16px 14px 46px;
  border: 2px solid #E2E8F0;
  border-radius: 40px;
  font-family: 'Comfortaa', cursive;
  font-size: 15px;
  transition: all 0.2s;
}

.friends-search-input-wrapper input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.friends-search-btn {
  padding: 14px 24px;
  background: #1E3A8A;
  color: white;
  border: none;
  border-radius: 40px;
  font-family: 'Comfortaa', cursive;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.friends-search-btn:hover {
  background: #F59E0B;
  color: #1E3A8A;
}

.friends-search-results {
  margin-top: 30px;
}

.friends-search-count {
  font-size: 14px;
  color: #64748B;
  margin-bottom: 16px;
}

.friends-search-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friend-search-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.friend-search-card:hover {
  border-color: #F59E0B;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.friend-search-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #0F2B6E);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.friend-search-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-search-avatar i {
  color: #F59E0B;
  font-size: 24px;
}

.friend-search-info {
  flex: 1;
  min-width: 0;
}

.friend-search-name {
  font-size: 16px;
  font-weight: 700;
  color: #1E3A8A;
  text-decoration: none;
}

.friend-search-name:hover {
  color: #F59E0B;
}

.friend-search-id {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.friend-search-bio {
  font-size: 13px;
  color: #64748B;
  margin-top: 6px;
  line-height: 1.4;
}

.friend-search-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.friend-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: #D1FAE5;
  color: #10B981;
  font-weight: 600;
}

.friend-search-actions {
  flex-shrink: 0;
}

/* ----- ДОСТИЖЕНИЯ ----- */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #F8FAFC, #FFF7ED);
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  transition: all 0.2s;
}

.achievement-item:hover {
  border-color: #F59E0B;
  background: #FFF7ED;
  transform: translateX(2px);
}

.achievement-icon {
  width: 48px;
  height: 48px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-name {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 2px;
}

.achievement-desc {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 6px;
  line-height: 1.4;
}

.achievement-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #94A3B8;
}

.achievement-date i,
.achievement-category i {
  margin-right: 4px;
  color: #CBD5E1;
}

.achievement-category {
  color: #F59E0B;
  font-weight: 500;
}

.achievement-points {
  font-size: 13px;
  font-weight: 700;
  color: #F59E0B;
  white-space: nowrap;
  flex-shrink: 0;
  background: #FEF3E8;
  padding: 6px 12px;
  border-radius: 20px;
}

.achievements-show-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  font-family: 'Comfortaa', cursive;
  font-size: 13px;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
}

.achievements-show-btn:hover {
  border-color: #F59E0B;
  color: #F59E0B;
  background: #FFF7ED;
}

/* ----- ФУТЕР ----- */
footer {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
  background: #0F2B6E;
  overflow-x: hidden;
}

/* ----- АДАПТИВНОСТЬ ----- */
@media (min-width: 768px) {
  .profile-page {
    padding: 30px 0 50px;
  }

  .container {
    padding: 0 15px;
  }

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

  .profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
  }

  .avatar-wrapper,
  .avatar {
    width: 120px;
    height: 120px;
  }

  .avatar i {
    font-size: 60px;
  }

  .profile-name {
    font-size: 20px;
  }

  .desktop-table {
    display: block;
  }

  .mobile-flights-list {
    display: none;
  }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .info-label,
  .info-value {
    font-size: 13px;
  }

  .vatsim-stats,
  .connect-stats {
    margin: 0 20px 20px 20px;
  }

  .profile-actions {
    flex-direction: row;
  }

  .btn-edit,
  .btn-logout,
  .btn-admin {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .profile-grid {
    grid-template-columns: 320px 1fr;
    gap: 30px;
  }

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

  .avatar-wrapper,
  .avatar {
    width: 140px;
    height: 140px;
  }

  .avatar i {
    font-size: 70px;
  }
}

@media (max-width: 767px) {
  .desktop-table {
    display: none !important;
  }

  .mobile-flights-list {
    display: flex !important;
  }
}

@media (max-width: 640px) {
  .friends-search-input-wrapper {
    flex-direction: column;
  }

  .friends-search-btn {
    width: 100%;
    justify-content: center;
  }

  .friend-search-card {
    flex-direction: column;
    text-align: center;
  }

  .friend-search-actions {
    width: 100%;
  }

  .friend-search-actions .btn-sm {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .friends-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vk-connected,
  .vk-not-connected,
  .vatsim-connected,
  .vatsim-not-connected,
  .connect-body {
    flex-wrap: wrap;
    gap: 10px;
  }

  .vk-content,
  .vatsim-content,
  .connect-info {
    flex: 1 1 100%;
    order: 1;
  }

  .vk-revoke-btn,
  .vk-connect-btn,
  .vatsim-revoke-btn,
  .vatsim-connect-btn,
  .connect-btn--revoke,
  .connect-btn--connect {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .vk-icon,
  .vatsim-icon,
  .connect-icon {
    order: 0;
  }

  .vk-header,
  .vatsim-header,
  .connect-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .vatsim-stats,
  .connect-stats {
    margin: 0 12px 12px 12px;
    padding: 10px 12px;
  }

  .vatsim-stat-item,
  .connect-stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .profile-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn-edit,
  .btn-logout,
  .btn-admin,
  .btn-primary,
  .btn-accent,
  .btn-danger,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 360px) {

  .avatar-wrapper,
  .avatar {
    width: 80px;
    height: 80px;
  }

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

  .profile-name {
    font-size: 16px;
  }

  .btn-edit,
  .btn-logout,
  .btn-admin,
  .btn-primary,
  .btn-accent,
  .btn-danger,
  .btn-outline {
    padding: 8px 16px;
    font-size: 12px;
    min-width: auto;
  }
}

/* ============================================
   РЕДАКТИРОВАНИЕ ПРОФИЛЯ
   ============================================ */

.profile-edit-page {
  flex: 1 0 auto;
  padding: 40px 24px 80px;
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  min-height: calc(100vh - 80px);
  width: 100%;
}

.profile-edit-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.profile-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.profile-edit-title {
  display: flex;
  align-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px 0;
}

.profile-edit-subtitle {
  color: #64748B;
  font-size: 15px;
  margin: 0 0 0 44px;
}

.profile-edit-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: white;
  color: #475569;
  border-radius: 40px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #E2E8F0;
  transition: all 0.2s;
  white-space: nowrap;
}

.profile-edit-back:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

/* Сообщения */
.profile-edit-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

.profile-edit-message.error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FEE2E2;
}

.profile-edit-message.success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #DCFCE7;
}

.profile-edit-message i {
  font-size: 18px;
}

/* Форма */
.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 20px;
}

/* Секции */
.profile-edit-section {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #E2E8F0;
}

.profile-edit-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #F1F5F9;
}

.profile-edit-section-header i {
  font-size: 24px;
  color: #F59E0B;
}

.profile-edit-section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
}

/* Сетка */
.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Поля */
.profile-edit-field {
  margin-bottom: 20px;
}

.profile-edit-field:last-child {
  margin-bottom: 0;
}

.profile-edit-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-edit-input-wrapper {
  position: relative;
}

.profile-edit-input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 16px;
  z-index: 1;
}

.profile-edit-input-wrapper input,
.profile-edit-input-wrapper select {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 2px solid #E2E8F0;
  border-radius: 14px;
  font-family: 'Comfortaa', sans-serif;
  font-size: 15px;
  color: #0F172A;
  background: white;
  transition: all 0.2s;
}

.profile-edit-field textarea,
.profile-edit-field input,
.profile-edit-field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 14px;
  font-family: 'Comfortaa', sans-serif;
  font-size: 15px;
  color: #0F172A;
  background: white;
  transition: all 0.2s;
  resize: vertical;
}

.profile-edit-input-wrapper input:focus,
.profile-edit-input-wrapper select:focus,
.profile-edit-field textarea:focus,
.profile-edit-field input:focus,
.profile-edit-field select:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.profile-edit-field textarea {
  min-height: 120px;
}

/* Уведомления */
.profile-edit-notifications {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-edit-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
}

.profile-edit-switch:last-child {
  border-bottom: none;
}

.profile-edit-switch-content strong {
  display: block;
  font-size: 15px;
  color: #0F172A;
  margin-bottom: 4px;
}

.profile-edit-switch-content small {
  font-size: 13px;
  color: #64748B;
}

.profile-edit-switch input {
  display: none;
}

.profile-edit-switch-slider {
  position: relative;
  width: 48px;
  height: 26px;
  background: #CBD5E1;
  border-radius: 30px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.profile-edit-switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-edit-switch input:checked + .profile-edit-switch-slider {
  background: #F59E0B;
}

.profile-edit-switch input:checked + .profile-edit-switch-slider::before {
  transform: translateX(22px);
}

/* Кнопки */
.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 8px;
  margin-bottom: 20px;
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Comfortaa', sans-serif;
}

.profile-edit-btn--primary {
  background: #F59E0B;
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.profile-edit-btn--primary:hover {
  background: #D97706;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.profile-edit-btn--secondary {
  background: white;
  color: #64748B;
  border: 2px solid #E2E8F0;
}

.profile-edit-btn--secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.profile-edit-btn i {
  font-size: 16px;
}

/* Адаптивность */
@media (max-width: 640px) {
  .profile-edit-page {
    padding: 24px 16px 60px;
  }
  
  .profile-edit-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .profile-edit-title {
    font-size: 24px;
  }
  
  .profile-edit-subtitle {
    margin-left: 0;
    margin-top: 4px;
  }
  
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-edit-section {
    padding: 20px;
  }
  
  .profile-edit-actions {
    flex-direction: column-reverse;
  }
  
  .profile-edit-btn {
    width: 100%;
    justify-content: center;
  }
  
  .profile-edit-switch {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .profile-edit-switch-content {
    flex: 1;
  }
}