/* ============================================
   PouFlip - Secondary Pages
   Profile, History, Legal, Support
   ============================================ */

/* === PAGE LAYOUT === */
.page-main {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  min-height: 100vh;
}

/* === PAGE HEADER === */
.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
}

/* === BACK BUTTON === */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.page-back::before {
  content: '\2190';
  font-size: 16px;
  line-height: 1;
}

.page-back:hover {
  color: var(--gold);
  background: var(--gold-subtle);
}

/* === CONTENT CARDS === */
.page-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  transition: border-color 0.2s var(--ease);
}

.page-card:last-child {
  margin-bottom: 0;
}

/* === PAGE CARD HEADER === */
.page-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-card-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.page-card-header .btn {
  flex-shrink: 0;
}

/* === INFO ROWS === */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s var(--ease);
}

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

.info-row-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.info-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.info-row-value.gold {
  color: var(--gold);
}

.info-row-value.green {
  color: var(--green);
}

.info-row-value.red {
  color: var(--red);
}

/* Editable info rows */
.info-row.editable {
  cursor: pointer;
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: var(--radius-sm);
}

.info-row.editable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.info-row.editable .info-row-value::after {
  content: '\270E';
  margin-left: 10px;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.info-row.editable:hover .info-row-value::after {
  opacity: 1;
}

/* === FORMS INSIDE CARDS === */
.page-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.page-card .form-group:last-child {
  margin-bottom: 0;
}

.page-card .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.page-card .form-group input,
.page-card .form-group select,
.page-card .form-group textarea {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s var(--ease);
  outline: none;
  width: 100%;
}

.page-card .form-group input::placeholder,
.page-card .form-group textarea::placeholder {
  color: var(--text-muted);
}

.page-card .form-group input:focus,
.page-card .form-group select:focus,
.page-card .form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.page-card .form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.page-card .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 20px;
}

/* === HISTORY LIST === */
.history-list {
  display: flex;
  flex-direction: column;
}

/* === HISTORY ITEM === */
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s var(--ease);
}

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

.history-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.history-item-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 18px;
  background: rgba(255, 255, 255, 0.04);
}

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

.history-item-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-item-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  text-align: right;
}

.history-item-amount.positive {
  color: var(--green);
}

.history-item-amount.negative {
  color: var(--red);
}

/* History item type variants */
.history-item.deposit .history-item-icon {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
}

.history-item.withdraw .history-item-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.history-item.bet-win .history-item-icon {
  background: rgba(247, 166, 0, 0.1);
  color: var(--gold);
}

.history-item.bet-loss .history-item-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin-bottom: 24px;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

/* === FILTER BUTTON === */
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.filter-btn.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.filter-btn.active:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* === STATIC PAGE CONTENT === */
.static-content {
  max-width: 800px;
  margin: 0 auto;
}

.static-content h2 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.static-content h2:first-child {
  margin-top: 0;
}

.static-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--gold);
}

.static-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.static-content a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.static-content a:hover {
  color: var(--gold-light);
}

.static-content ul,
.static-content ol {
  margin-bottom: 16px;
  padding-left: 8px;
}

.static-content li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 4px 0 4px 20px;
  position: relative;
}

.static-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.static-content ol {
  counter-reset: static-ol;
}

.static-content ol li {
  counter-increment: static-ol;
}

.static-content ol li::before {
  content: counter(static-ol) '.';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
}

.static-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

.static-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--gold-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.static-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* === FAQ ACCORDION === */
.faq-item {
  border-bottom: 1px solid var(--border);
}

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

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  transition: color 0.2s var(--ease);
}

.faq-question::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
  width: 24px;
  text-align: center;
}

.faq-question:hover {
  color: var(--gold);
}

.faq-item.open .faq-question {
  color: var(--gold);
}

.faq-item.open .faq-question::after {
  content: '\2212';
  color: var(--gold);
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 18px;
}

.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer p + p {
  margin-top: 10px;
}

/* === PROFILE AVATAR SECTION === */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #000;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 0 0 4px var(--bg-card), 0 0 24px var(--gold-glow);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.profile-avatar-edit:hover {
  color: var(--gold);
  background: var(--bg-card-hover);
}

.profile-username {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-email {
  font-size: 14px;
  color: var(--text-muted);
}

/* === PROFILE STATS === */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.profile-stat {
  text-align: center;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.profile-stat-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}

.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === DANGER ZONE === */
.danger-zone {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.danger-zone .page-card-header {
  margin-bottom: 12px;
}

.danger-zone .page-card-header h3 {
  color: var(--red);
}

.danger-zone p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.danger-zone .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  color: var(--red);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s var(--ease);
}

.danger-zone .btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .page-main {
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 48px;
  }

  .page-header {
    margin-bottom: 28px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header p {
    font-size: 14px;
  }

  .page-card {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }

  .page-card-header {
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .page-card-header h3 {
    font-size: 16px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0;
  }

  .info-row-value {
    text-align: left;
  }

  .info-row.editable {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .page-card .form-group input,
  .page-card .form-group select,
  .page-card .form-group textarea {
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
  }

  .page-card .form-actions {
    flex-direction: column;
  }

  .page-card .form-actions .btn {
    width: 100%;
  }

  .empty-state {
    padding: 40px 16px;
  }

  .empty-state-icon {
    font-size: 40px;
  }

  .empty-state h4 {
    font-size: 16px;
  }

  .history-item {
    gap: 10px;
    padding: 12px 0;
  }

  .history-item-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .history-item-desc {
    font-size: 13px;
  }

  .history-item-amount {
    font-size: 14px;
  }

  .filter-bar {
    margin-bottom: 16px;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .static-content h2 {
    font-size: 19px;
    margin-top: 32px;
    margin-bottom: 12px;
  }

  .static-content h3 {
    font-size: 16px;
    margin-top: 24px;
  }

  .static-content p,
  .static-content li {
    font-size: 14px;
  }

  .faq-question {
    font-size: 14px;
    padding: 14px 0;
  }

  .faq-answer p {
    font-size: 13px;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 30px;
  }

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

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .profile-stat {
    padding: 12px 8px;
  }

  .profile-stat-value {
    font-size: 17px;
  }

  .profile-stat-label {
    font-size: 10px;
  }

  .danger-zone {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .page-main {
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: 32px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .page-card {
    padding: 16px;
  }

  .page-card-header h3 {
    font-size: 15px;
  }

  .history-item-icon {
    display: none;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }

  .profile-avatar-section {
    padding: 24px 16px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 12px 16px;
  }

  .profile-stat-value {
    font-size: 18px;
    margin-bottom: 0;
  }

  .profile-stat-label {
    font-size: 11px;
  }

  .static-content h2 {
    font-size: 18px;
  }

  .danger-zone {
    padding: 16px;
  }

  .danger-zone .btn-danger {
    width: 100%;
    justify-content: center;
  }
}

