/* ====== PROFILE PAGE SPECIFIC STYLES ====== */

.profile-page {
  padding-bottom: 80px; /* відступ для navbar */
}

/* ===== Галерея фото профілю ===== */
.profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
  padding: 12px;
  padding-bottom: 80px; /* місце під навігацію */
}

.profile-grid .photo-container {
  position: relative;
  width: calc(33.333% - 3.33px); /* 3 в ряд з gap 5px */
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 12px;
  background-color: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.profile-grid .photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.profile-grid button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.profile-grid button:hover { background: grey; }

.profile-grid button img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  margin: 0;
  padding: 0;
}

/* ===== Хедер: 20% фото, 80% ім’я + кнопки ===== */
.profile-header {
  display: grid;
  grid-template-columns: minmax(72px, 20%) 1fr; /* 20% під фото */
  column-gap: 16px;
  row-gap: 12px;
  align-items: center;
  margin: 24px 16px 20px 16px;
  padding: 0;
}

.profile-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;      /* коло в своїй колонці */
  border-radius: 50%;
  overflow: hidden;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #444;
  box-sizing: border-box;
  flex-shrink: 0;
}

.profile-photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Права зона: ім’я зверху, під ним 2 кнопки 50/50 */
.profile-info {
  display: grid;
  grid-template-rows: auto auto;    /* 1-й ряд — ім’я, 2-й — кнопки */
  grid-template-columns: 1fr 1fr;   /* дві колонки для кнопок */
  gap: 10px;
  min-width: 0;
}

.profile-info h2 {
  grid-column: 1 / -1;             /* ім’я на всю праву зону */
  margin: 0;
   color:#E4C09F;
  font-size: clamp(22px, 5.5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  padding-left: 20px;

}

/* Контейнер кнопок: грід 2 колонки */
.profile-buttons {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;   /* по 50% кожна */
  gap: 10px;
  width: 100%;
}

/* Кнопки рівні по ширині (заповнюють свою клітинку) */
.edit-profile-btn,
.subscription-btn {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Дозволяємо перенос рядка у першій кнопці */
.edit-profile-btn {
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Другу — однорядковою (за бажанням) */
.subscription-btn { white-space: nowrap; }

.edit-profile-btn:hover,
.subscription-btn:hover {
  background: #444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Екран редагування профілю (як було) ===== */
.edit-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #222;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.edit-title {
  margin: 0 auto;
  font-size: 1.7rem;
  font-weight: 500;
  color: #fff;
}

.edit-profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}

.edit-profile-form label {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.edit-profile-form input {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.save-btn {
  margin-top: 40px;
  background-color: #ffe4c4;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 18px 0;
  font-size: 1.25rem;
  width: 60%;
  max-width: 320px;
  min-width: 180px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
}

.save-btn:hover { background: #ffd6a0; }

/* ===== Загальні стилі ===== */
body { background: #000; }

#app {
  margin-top: 32px;
}

/* Заголовок для галереї фото */
h1[data-i18n="profileTitle"] {
  color: #ffe4c4;
  font-size: 24px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 40px;
  text-align: center;
  padding: 0 20px;
}

/* ===== Адаптації для вузьких екранів ===== */
@media (max-width: 360px) {
  .profile-header { grid-template-columns: minmax(64px, 20%) 1fr; }
  .edit-profile-btn, .subscription-btn {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 40px;
  }
}
/* ===== SF Pro / System UI + Inter fallback ===== */
:root{
  /* UI-шрифт для кнопок, лейблів, менших елементів */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text",
             system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial,
             "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji",
             "Segoe UI Symbol", Inter, sans-serif;

  /* Display-шрифт для великих заголовків */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                  "SF Pro Text", system-ui, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, "Noto Sans", Inter, sans-serif;
}

html{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body{
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0;
}

/* ВЕЛИКІ ЗАГОЛОВКИ — Display */
h1, h2, h3,
h1[data-i18n="profileTitle"],
.profile-info h2{
  font-family: var(--font-display);
  font-weight: 800;               /* виразніше під iOS стилістику */
  letter-spacing: -0.02em;        /* легке ущільнення як у SF Display */
}
h3.generatedPhotosTitle{
  text-align: center;

}
/* КНОПКИ, МАЛІ ЕЛЕМЕНТИ — Text/UI */
.edit-profile-btn,
.subscription-btn,
.back-btn,
.save-btn,
.edit-profile-form label,
.edit-profile-form input,
.profile-grid button{
  font-family: var(--font-ui);
  font-weight: 600;               /* iOS-подібний “Semibold” */
  letter-spacing: -0.01em;
}

/* Дозволяємо перенос у першій кнопці (як ти просила) */
.edit-profile-btn{
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Нюанс: великі заголовки на дуже вузьких екранах */
@media (max-width: 360px){
  h1, h2, h3,
  h1[data-i18n="profileTitle"],
  .profile-info h2{
    letter-spacing: -0.01em;
    font-weight: 700; /* трохи м’якше для читабельності */
  }
}
