/* Файл: /modules/mod_user_profile/css/profile.css */
.gdz-profile-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

.gdz-profile-wrapper {
  --bg: #0b0f1a; --surface: #111827; --card: #151e2e; --card2: #1a2540;
  --border: rgba(148,163,200,.10); --border2: rgba(148,163,200,.20);
  --accent: #38bdf8; --violet: #a78bfa; --green: #34d399;
  --gold: #fbbf24; --orange: #fb923c; --pink: #f472b6; --red: #f87171;
  --text: #e2eaf8; --muted: #6b7fa8; --r: 16px;
  font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--text);
  min-height: 80vh; padding: 24px 16px 60px; position: relative; overflow: hidden;
  transition: background .4s, color .4s;
}

.gdz-profile-wrapper::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 15% 5%, rgba(56,189,248,.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 90%, rgba(167,139,250,.08) 0%, transparent 60%);
}

.gp-wrap { max-width: 1060px; margin: 0 auto; position: relative; z-index: 1; }

/* ==================== HEAD (Шапка) ==================== */
.gp-head {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 20px; transition: background .4s, border-color .4s;
  position: relative;
}

.gp-user-info { display: flex; align-items: center; gap: 20px; flex: 1; }
.gp-actions-wrap { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }

.gp-av-wrap { flex-shrink: 0; position: relative; cursor: pointer; }
.gp-av {
  width: 88px; height: 88px; border-radius: 50%; border: 4px solid var(--card);
  background: linear-gradient(135deg, #1e3a5f, #2d1b6e); display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative; overflow: visible; transition: transform .25s;
}
.gp-av:hover { transform: scale(1.07); }
.gp-av-ring {
  position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--violet), var(--green), var(--accent));
  z-index: -1; animation: gpSpin 4s linear infinite;
}
@keyframes gpSpin { to { transform: rotate(360deg); } }
.gp-av-edit {
  position: absolute; bottom: 2px; right: 2px; background: var(--accent); color: #fff;
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border: 2px solid var(--card); cursor: pointer; transition: transform .2s;
}
.gp-av-wrap:hover .gp-av-edit { transform: scale(1.1); }

.gp-meta { display: flex; flex-direction: column; gap: 10px; }
.gp-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gp-username { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; }
.gp-level-badge {
  font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  color: #fff; font-family: 'Unbounded', sans-serif; white-space: nowrap;
}
.gp-next-level { font-size: 11px; color: var(--muted); font-weight: 600; }

.gp-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.gp-stat {
  display: flex; align-items: center; gap: 6px; background: var(--card2);
  padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border2);
}
.gp-stat-n { font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 700; }
.gp-stat-l { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ==================== HEAD controls ==================== */
.gp-controls { display: flex; gap: 10px; align-items: center; }

.gp-edit-btn {
  background: var(--card2); border: 1px solid var(--border2); color: var(--text);
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: 'Nunito', sans-serif; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.gp-edit-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(56,189,248,.05); }

.gp-skin-btn {
  background: var(--card2); border: 1px solid var(--border2); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.gp-skin-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(56,189,248,.05); }

/* ==================== STREAK ==================== */
.gp-streak {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(251,191,36,.12), rgba(251,146,60,.06));
  border: 1px solid rgba(251,191,36,.25); border-radius: 16px;
  padding: 12px 20px; flex-shrink: 0; min-width: 100px; height: 100%; box-sizing: border-box;
}
.gp-streak-fire { font-size: 26px; animation: gpFire 1.2s ease-in-out infinite alternate; margin-bottom: 2px; }
@keyframes gpFire { from { transform: scale(1) rotate(-5deg); } to { transform: scale(1.12) rotate(5deg); } }
.gp-streak-n { font-family: 'Unbounded', sans-serif; font-size: 20px; font-weight: 900; color: var(--gold); line-height: 1; }
.gp-streak-l { font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }

/* ==================== GRID BASE ==================== */
.gp-grid { display: flex; flex-direction: column; gap: 16px; }
.gp-full { grid-column: 1 / -1; }

/* CARD */
.gp-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; transition: background .4s, border-color .4s; }
.gp-card-title { font-family: 'Unbounded', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }

/* PROGRESS */
.gp-lvl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.gp-lvl-tag { background: linear-gradient(90deg, var(--accent), var(--violet)); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 11px; border-radius: 20px; font-family: 'Unbounded', sans-serif; }
.gp-xp-lbl { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.gp-xp-bar { height: 9px; background: var(--card2); border-radius: 30px; overflow: hidden; }
.gp-xp-fill { height: 100%; border-radius: 30px; background: linear-gradient(90deg, var(--accent), var(--violet)); position: relative; overflow: hidden; transition: width 1s ease; }
.gp-xp-fill::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); animation: gpShimmer 2s infinite; }
@keyframes gpShimmer { to { left: 200%; } }
.gp-xp-sub { font-size: 10px; color: var(--muted); font-weight: 600; margin-top: 5px; text-align: right; white-space: nowrap; }

/* ACTIVITY */
.gp-act-wrap { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } /* Обертка для мобильной прокрутки */
.gp-act-wrap::-webkit-scrollbar { display: none; }
.gp-act-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; min-width: 450px; } /* Минимальная ширина спасает от сплющивания */
.gp-day { aspect-ratio: 1; border-radius: 3px; background: var(--card2); transition: transform .15s; cursor: default; }
.gp-day:hover { transform: scale(1.5); }
.gp-day.l1 { background: rgba(52,211,153,.22); }
.gp-day.l2 { background: rgba(52,211,153,.45); }
.gp-day.l3 { background: rgba(52,211,153,.70); }
.gp-day.l4 { background: var(--green); }
.gp-act-labels { display: flex; justify-content: space-between; margin-top: 5px; }
.gp-act-labels span { font-size: 9px; color: var(--muted); font-weight: 600; }

/* GAMES */
.gp-games { display: flex; flex-direction: column; gap: 9px; }
.gp-game { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; display: flex; align-items: center; gap: 11px; transition: border-color .2s; }
.gp-game:hover { border-color: var(--border2); }
.gp-game-ico { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.gp-game-info { flex: 1; min-width: 0; }
.gp-game-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-game-sub { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.gp-game-rank { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank-gold { color: var(--gold); } .rank-silver { color: #94a3b8; } .rank-green { color: var(--green); } .rank-def { color: var(--muted); }

/* BADGES */
.gp-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gp-bdg { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 11px; border: 1px solid var(--border); background: var(--card2); cursor: pointer; transition: all .2s; position: relative; }
.gp-bdg:hover { border-color: var(--border2); transform: translateY(-2px); }
.gp-bdg.locked { opacity: .35; filter: grayscale(1); }
.gp-bdg-ico { font-size: 24px; }
.gp-bdg-name { font-size: 10px; font-weight: 700; text-align: center; color: var(--muted); line-height: 1.2; }
.gp-bdg.locked::after { content: '🔒'; position: absolute; top: 5px; right: 5px; font-size: 9px; }

/* TESTS */
.gp-tests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gp-test { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 10px; text-align: center; }
.gp-test-emoji { font-size: 26px; margin-bottom: 6px; }
.gp-test-name { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.gp-test-count { font-family: 'Unbounded', sans-serif; font-size: 24px; font-weight: 700; color: var(--accent); }
.gp-test-label { font-size: 10px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* LIST */
.gp-list { display: flex; flex-direction: column; gap: 7px; }
.gp-list-item { display: flex; align-items: center; gap: 9px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .2s; text-decoration: none; color: var(--text); }
.gp-list-item:hover { border-color: var(--border2); }
.gp-list-ico { font-size: 18px; flex-shrink: 0; }
.gp-list-text { flex: 1; min-width: 0; }
.gp-list-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-list-sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.gp-list-rm { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 0 4px; transition: color .2s; flex-shrink: 0; }
.gp-list-rm:hover { color: var(--red); }
.gp-empty { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; padding: 12px 0; }

/* ==================== ACCORDIONS (Избранное / История) ==================== */
.gp-accordion { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: border-color 0.3s; background: var(--card2); }
.gp-accordion-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; color: var(--text); user-select: none; transition: background 0.2s; }
.gp-accordion-head:hover { background: rgba(255, 255, 255, 0.03); }
.gp-accordion-ico { font-size: 14px; transition: transform 0.3s ease; color: var(--muted); }
.gp-accordion.open .gp-accordion-ico { transform: rotate(180deg); color: var(--accent); }
.gp-accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.gp-accordion-content { padding: 0 16px 16px 16px; }
.gp-accordion.open .gp-accordion-body { max-height: 1000px; /* Достаточно большое значение для раскрытия */ }

/* ==================== MODALS & UI ==================== */
.gp-modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
.gp-modal-overlay.open { display: flex; }
.gp-modal { position: relative; background: var(--card); border: 1px solid var(--border2); border-radius: 20px; padding: 24px; width: 460px; max-width: 94vw; color: var(--text); animation: gpSlideUp .25s ease; }
@keyframes gpSlideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.gp-modal-title { font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.gp-modal-section { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 7px; }

.gp-modal-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; background: var(--card2); border: none; border-radius: 50%; color: var(--muted); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 10; }
.gp-modal-close:hover { background: var(--border2); color: var(--text); }


/* INPUTS & BUTTONS */
.gp-input { width: 100%; background: var(--card2); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 15px; font-weight: 700; font-family: 'Nunito', sans-serif; outline: none; transition: border-color .2s; margin-bottom: 10px; }
.gp-input:focus { border-color: var(--accent); }
.gp-hint { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 14px; line-height: 1.4; }

.gp-btn { background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; border: none; padding: 10px 22px; border-radius: 30px; font-size: 13px; font-weight: 800; cursor: pointer; font-family: 'Nunito', sans-serif; transition: transform .15s, filter .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.gp-btn:hover { transform: scale(1.04); filter: brightness(1.1); }
.gp-btn:active { transform: scale(0.96); }
.gp-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; filter: none; }

.gp-btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border2); padding: 10px 22px; border-radius: 30px; font-size: 13px; font-weight: 800; cursor: pointer; font-family: 'Nunito', sans-serif; margin-left: 7px; transition: all .2s; }
.gp-btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.gp-btn-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: gpSpin .7s linear infinite; }

/* AVATAR GALLERY */
.gp-av-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.gp-av-opt { aspect-ratio: 1; border-radius: 50%; font-size: 32px; display: flex; align-items: center; justify-content: center; background: var(--card2); border: 2px solid transparent; cursor: pointer; transition: all .2s; }
.gp-av-opt:hover { transform: scale(1.1); border-color: var(--border2); }
.gp-av-opt.sel { border-color: var(--accent); background: rgba(56,189,248,.12); }
.gp-av-opt.locked { filter: grayscale(1) blur(1px); opacity: .45; cursor: not-allowed; pointer-events: none; }

/* SKIN CARDS */
.gp-skin-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gp-skin-card { border-radius: 12px; border: 2px solid var(--border); overflow: hidden; cursor: pointer; transition: all .2s; }
.gp-skin-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.gp-skin-card.active { border-color: var(--accent); }
.gp-skin-preview { height: 60px; }
.gp-skin-label { padding: 8px 10px; font-size: 12px; font-weight: 800; font-family: 'Unbounded', sans-serif; background: var(--card2); text-align: center; }

/* TOAST */
#gp-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--card2); border: 1px solid var(--green); border-radius: 30px; padding: 10px 22px; font-size: 13px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 8px; z-index: 10000; transition: all .35s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 8px 32px rgba(0,0,0,.4); pointer-events: none; opacity: 0; visibility: hidden; }
#gp-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* LOADING / GUEST */
.gp-loading { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; font-weight: 600; }
.gp-spin { display: inline-block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card2); border-top-color: var(--accent); animation: gpSpin 0.8s linear infinite; margin-bottom: 14px; }
.gp-guest { text-align: center; padding: 60px 20px; }
.gp-guest h2 { font-family: 'Unbounded', sans-serif; font-size: 22px; color: #edf3f9; font-weight: 700; margin-bottom: 12px; }
.gp-guest p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.gp-login-btn { display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; border: none; padding: 12px 30px; border-radius: 30px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: 'Nunito', sans-serif; text-decoration: none; }


/* ==================== АДАПТИВ (MEDIA QUERIES ПО УБЫВАНИЮ) ==================== */

/* Планшеты и небольшие экраны */
@media(max-width: 768px) {
  .gp-grid { grid-template-columns: 1fr; }
  .gp-full { grid-column: auto; }
  
  /* Планшеты: разбиваем на 2 строки по 15 дней */
  .gp-act-grid { 
    grid-template-columns: repeat(15, 1fr); 
    gap: 4px; 
    min-width: 350px;
  }

  .gp-head { flex-direction: column; align-items: stretch; gap: 20px; padding: 20px; }
  .gp-user-info { flex-direction: column; text-align: center; gap: 16px; }
  .gp-name-row { justify-content: center; }
  .gp-stats { justify-content: center; }

  .gp-actions-wrap { flex-direction: column; width: 100%; gap: 16px; }
  .gp-controls { width: 100%; justify-content: center; }

  .gp-streak { width: 100%; flex-direction: row; gap: 12px; padding: 14px; }
  .gp-streak-fire { margin-bottom: 0; font-size: 26px; }
  .gp-streak-n { font-size: 24px; }
  .gp-streak-l { font-size: 11px; margin-top: 0; }
  
  .gp-badges { grid-template-columns: repeat(3, 1fr); }
  .gp-av-gallery { grid-template-columns: repeat(4, 1fr); }
  .gp-skin-cards { grid-template-columns: repeat(3, 1fr); }
  
  .gp-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
  }
    .gp-card {
    width: 100%;
    min-width: 0; 
  }  
}

/* Мобильные телефоны (узкие экраны) */
@media(max-width: 480px) {
  .gdz-profile-wrapper { padding: 16px 10px 50px; }
  .gp-card { padding: 16px; }
  
  /* Телефоны: разбиваем на 3 строки по 10 дней */
  .gp-act-grid { 
    grid-template-columns: repeat(10, 1fr); 
    gap: 4px; 
    min-width: 250px;
  }

  /* Тесты: оставляем по 2 в ряд, чтобы не было гигантских карточек в столбик 
  .gp-tests { grid-template-columns: repeat(2, 1fr); gap: 8px; }*/
  
  /* Бейджи и карточки скинов тоже уплотняем, но не в одну колонку */
  .gp-badges { grid-template-columns: repeat(2, 1fr); }
  .gp-skin-cards { grid-template-columns: repeat(2, 1fr); }
  .gp-av-gallery { grid-template-columns: repeat(3, 1fr); }

  .gp-modal { padding: 20px 16px; }
  
  /* Статистика: делаем комфортный отступ и сохраняем хорошую читаемость шрифтов */
  .gp-stat { padding: 8px 12px; }
  .gp-stat-n { font-size: 14px; }
  .gp-stat-l { font-size: 11px; }

  /* Аватар делаем чуть компактнее, но не мелким */
  .gp-av { width: 76px; height: 76px; font-size: 34px; }
  
    .gp-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 14px; 
  }
      .gp-card {
    width: 100%;
    min-width: 0; 
  } 
  
}

/* Логика скрытия и показа для новых аккордеонов */
.gp-accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.gp-accordion-body.open { max-height: 1500px; } /* Достаточная высота для длинного списка */

/* Анимация стрелочки */
.gp-accordion-ico { transition: transform 0.3s ease; color: var(--muted); font-size: 14px; }
.gp-card-title.open .gp-accordion-ico { transform: rotate(180deg); color: var(--accent); }

/* кнопка выход */
.gp-btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
  padding: 12px;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.gp-btn-logout:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}
