/* === ОСНОВА === */
.profile-page {
  width: min(1100px, 100%);
  margin: 40px auto;
  padding: 0 20px 60px;
  font-family: 'Rubik', sans-serif;
  color: #f5f5f5;
}

/* === ШАПКА ПРОФИЛЯ === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 25px 35px;
  background: none;
  border: none;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
}

.profile-info .nickname {
  font-size: 24px;
  font-weight: 700;
  color: #ffa500;
}

.status { font-size: 14px; font-weight: 500; }
.status.online { color: #6cff74; }
.status.offline { color: #888; }

.reg-date { font-size: 13px; color: #999; margin-top: 6px; }

/* === ПОДПИСЬ === */
.edit-avatar-text {
  color: #ffa500;
  font-weight: 500;
  margin-right: 10px;
}

/* === ЕДИНЫЙ БЛОК ВЫБОРА ФАЙЛА === */
.file-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  vertical-align: middle;
}

.file-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 8px;
  background: rgba(25, 25, 25, 0.9);
}

/* кнопка внутри «капсулы» */
.file-btn {
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid rgba(255, 165, 0, 0.35);
  border-radius: 6px;
  color: #ffcc66;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
}
.file-btn:hover { background: rgba(255, 165, 0, 0.25); color: #fff; }

/* текст справа в капсуле */
.file-name {
  color: #aaa;
  font-size: 14px;
  min-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* скрытый input */
#avatar-input { display: none; }

/* кнопка загрузки */
.upload-btn {
  padding: 6px 14px;
  background: #ffa500;
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}
.upload-btn:hover {
  background: #d18800;
  box-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
}

/* === СЕКЦИИ === */
.profile-section {
  background: none;
  border: 1px solid rgba(255, 165, 0, 0.15);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 25px;
  box-shadow: 0 0 20px rgba(255, 165, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.profile-section h3 {
  font-size: 18px;
  color: #ffa500;
  margin-bottom: 16px;
  margin-top: 16px;
  font-weight: 700;
}

.all_service {
  margin-top: 0px !important;
}

/* === ИГРЫ / КАТЕГОРИИ === */
.game-block { margin-bottom: 30px; }
.game-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffcc66;
  text-shadow: 0 0 8px rgba(255,165,0,0.3);
}
.category-title { font-size: 15px; color: #ccc; margin-bottom: 8px; }

/* === ТАБЛИЦА УСЛУГ (как в game_category) === */

/* Обёртка */
.offers-grid {
  width: 100%;
  border: 1px solid rgba(255,165,0,0.25);
  border-radius: 10px;
  overflow: visible;
}

/* шапка и строки — grid с 3 колонками */
.offers-header {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
}

/* базовая ячейка */
.cell {
  padding: 10px 14px;
  font-size: 14px;
  border-right: 1px solid rgba(255,165,0,0.25);
  border-bottom: 1px solid rgba(255,165,0,0.15);
  display: flex;
  align-items: center;
  min-width: 0;
  box-sizing: border-box;
}

/* шапка */
.cell-header {
  background: rgba(255,165,0,0.15);
  color: #ffcc66;
  font-weight: 600;
  justify-content: center;
}

.cell-header-description {
  justify-content: left;
}

.offers-header .cell:last-child,
.offer-card .cell:last-child {
  border-right: none;
}

/* строки */
.offer-card {
  position: relative;
}

.offer-card-link {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  text-decoration: none;
  color: #ddd;
  transition: background 0.25s ease;
}

.offer-card-link:hover .cell {
  background: rgba(255,165,0,0.08);
}

.offer-edit-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  transform: scaleX(-1);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.45);
  color: #ffcc66;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  z-index: 2;
}

.offer-edit-btn:hover {
  background: rgba(255, 165, 0, 0.35);
  color: #ffa500;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.25);
}

body.light-theme .offer-card-link {
  color: #111;
}

body.light-theme .offer-edit-btn {
  background: #fff5dd;
  border-color: #f1c27a;
  color: #c57c00;
}

body.light-theme .offer-edit-btn:hover {
  background: #ffe3b0;
  color: #ff9500;
  box-shadow: none;
}

/* отдельные колонки */
.cell-platform {
  justify-content: center;
}
.cell-description {
  flex-direction: column;
  align-items: flex-start;
}
.price-cell {
  justify-content: flex-end;
  font-weight: 600;
  color: #ffcc66;
}

/* текст описания */
.offer-description-text {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
  max-width: 100%;
}

/* подпись платформы для мобилок (по умолчанию скрыта) */
.mobile-platform {
  display: none;
  font-size: 12px;
  color: #b0b0b0;
  margin-bottom: 4px;
}

/* === ОТЗЫВЫ === */
.review-card {
  background: rgba(30, 30, 30, 0.75);
  border: 1px solid rgba(255, 165, 0, 0.25);
  border-left: 4px solid #ffa500;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: 0 0 15px rgba(255,165,0,0.1);
  transition: 0.3s;
}
.review-card:hover { box-shadow: 0 0 25px rgba(255,165,0,0.25); }

/* === МОДАЛКА ДЛЯ ОБРЕЗКИ АВАТАРА (УВЕЛИЧЕННАЯ) === */
.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.crop-modal.show {
  display: flex;
}

/* окно кропа — сделано больше */
.crop-window {
  background: #151515;
  border-radius: 16px;
  padding: 24px;
  width: 800px;
  height: 700px;
  max-width: 95vw;
  max-height: 95vh;
  box-shadow: 0 0 30px rgba(255,165,0,0.35);
  display: flex;
  flex-direction: column;
}

.crop-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #ffcc66;
}

/* область с изображением */
.crop-image-wrapper {
  flex: 1;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.crop-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* кнопки снизу */
.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.crop-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

.crop-btn.cancel {
  background: #333;
  color: #eee;
}

.crop-btn.cancel:hover {
  background: #444444;
}

.crop-btn:not(.cancel) {
  background: rgb(255, 165, 0);
  color: #000;
}

.crop-btn:not(.cancel):hover {
  background: #d18800;
  transform: scale(1.03);
}

.crop-btn:hover {
  filter: brightness(1.05);
}

/* === АДАПТИВ === */
@media (max-width: 900px) {
  .file-name { max-width: 200px; }

  .crop-window {
    width: 90vw;
    height: 75vh;
  }
}

@media (max-width: 768px) {
  .profile-header { flex-direction: column; text-align: center; }
  .file-upload { flex-wrap: wrap; gap: 8px; }
}

/* На телефонах — 2 колонки: описание (с платформой) + цена */
@media (max-width: 700px) {
  .offers-header,
  .offer-card-link {
    grid-template-columns: 2fr 1fr;
  }

  /* в шапке скрываем колонку "Платформа" */
  .offers-header .cell:nth-child(1) {
    display: none;
  }
  .offers-header .cell:nth-child(2) {
    grid-column: 1;
  }
  .offers-header .cell:nth-child(3) {
    grid-column: 2;
  }

  /* в строках скрываем отдельную колонку платформы */
  .cell-platform {
    display: none;
  }
  .cell-description {
    grid-column: 1;
  }
  .price-cell {
    grid-column: 2;
  }

  .mobile-platform {
    display: block;
  }

  .offers-grid .cell {
    padding: 8px 8px;
    font-size: 13px;
  }

  .offer-edit-btn {
    top: -10px;
    right: -10px;
    transform: scaleX(-1);
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .upload-btn { display: inline-block; margin-top: 8px; }
  .edit-avatar-text { display: inline-block; margin-bottom: 6px; }
}

/* === СВЕТЛАЯ ТЕМА (Light Mode) === */
body.light-theme .edit-avatar-text {
  color: #000;
}

body.light-theme .nickname {
  color: #000;
}

body.light-theme .file-btn {
  background-color: white;
  color: #000;
  border: 1px solid #bbb;
}

body.light-theme .file-field {
  background-color: white;
  border: 1px solid #bbb;
}

body.light-theme .file-btn:hover {
  background: #c2c2c2;
  transition: 0.1s;
}

body.light-theme .file-name {
  color: #8b8b8b;
}

body.light-theme .upload-btn {
  background-color: white;
  border: 1px solid #bbb;
}

body.light-theme .upload-btn:hover {
  text-shadow: none;
  background: #c2c2c2;
  transition: 0.1s;
}

body.light-theme .profile-section {
  border: 1px solid #bbb;
}

body.light-theme .profile-section h3 {
  color: #000;
}

body.light-theme .profile-section h2 {
  color: #000;
}

body.light-theme .offers-grid {
  border: 1px solid #bbb;
  background-color: #ffffff;
}

body.light-theme .offers-grid .cell {
  border-right: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
}

body.light-theme .cell-header {
  background: #c2c2c2;
  color: #000;
}

body.light-theme .price-cell {
  color: #000;
}

body.light-theme .offer-card:hover .cell {
  background: #c2c2c2;
  transition: 0.1s;
}

body.light-theme .no_offers {
  color: #000;
}

body.light-theme .offers-grid a .cell {
  color: #000;
}

body.light-theme .no_reviews {
  color: #000;
}

body.light-theme .crop-window {
  background: #ffffff;
  box-shadow: none;
}

body.light-theme .crop-image-wrapper {
  border: none;
}

body.light-theme .cropper-crop {
  box-shadow: none;
}

body.light-theme .crop-title {
  color: #000;
}

body.light-theme .crop-btn.cancel {
  background: #ddd;
  color: #000;
  border: 1px solid #bbb;
}

body.light-theme .crop-btn.cancel:hover {
  background: #bbb;
}

body.light-theme .profile-avatar {
  box-shadow: none;
}

body.light-theme .upload-btn:hover {
  box-shadow: none;
}
