/**
 * account.css - アカウントページ専用スタイル
 */

.main-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ========================================
   Page Header
======================================== */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--mhw-brown-light);
}

.page-header h1 {
  color: var(--mhw-orange);
  margin: 0;
  font-size: 2rem;
}

/* ========================================
   Account Section
======================================== */
.account-section {
  background: var(--mhw-brown);
  border: 2px solid var(--mhw-brown-light);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.account-section h2 {
  color: var(--mhw-orange);
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--mhw-brown-light);
}

/* ========================================
   Credit Information Card
======================================== */
.credit-info-card {
  background: linear-gradient(135deg, var(--mhw-brown) 0%, var(--mhw-brown-dark) 100%);
  border: 2px solid var(--mhw-orange);
}

.credit-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: rgba(233, 69, 96, 0.1);
  border-radius: 8px;
}

.credit-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.credit-number {
  font-size: 4rem;
  font-weight: bold;
  color: var(--mhw-orange);
  line-height: 1;
}

.credit-label {
  color: var(--mhw-text-muted);
  font-size: 1.2rem;
}

.btn-purchase {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  white-space: nowrap;
}

.credit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(15, 52, 96, 0.3);
  border-radius: 4px;
}

.stat-label {
  color: var(--mhw-text-muted);
  font-size: 0.9rem;
}

.stat-value {
  color: var(--mhw-text);
  font-size: 1.3rem;
  font-weight: 500;
}

/* ========================================
   Purchase History Table
======================================== */
.transaction-table-wrapper {
  overflow-x: auto;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.transaction-table thead {
  background: rgba(15, 52, 96, 0.6);
}

.transaction-table th {
  color: var(--mhw-text);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--mhw-brown-light);
}

.transaction-table td {
  color: var(--mhw-text-muted);
  padding: 1rem;
  border-bottom: 1px solid rgba(15, 52, 96, 0.3);
}

.transaction-table tbody tr:hover {
  background: rgba(233, 69, 96, 0.05);
}

.transaction-date {
  white-space: nowrap;
}

.transaction-plan {
  color: var(--mhw-orange);
  font-weight: 500;
}

.transaction-amount {
  text-align: right;
}

.transaction-credits {
  text-align: center;
  color: var(--mhw-text);
}

.transaction-status {
  text-align: center;
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-completed {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.status-pending {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.status-failed {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.btn-load-more {
  width: 100%;
  padding: 0.8rem;
  background: rgba(15, 52, 96, 0.6);
  color: var(--mhw-text);
  border: 1px solid var(--mhw-brown-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-load-more:hover {
  background: rgba(15, 52, 96, 0.8);
  border-color: var(--mhw-orange);
}

/* ========================================
   Account Information
======================================== */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(15, 52, 96, 0.3);
  border-radius: 4px;
}

.info-label {
  color: var(--mhw-text-muted);
  font-size: 0.9rem;
}

.info-value {
  color: var(--mhw-text);
  font-size: 1.1rem;
  font-weight: 500;
}

.btn-change-password {
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
}

/* ========================================
   Danger Zone
======================================== */
.danger-zone {
  border-color: rgba(244, 67, 54, 0.5);
  background: rgba(244, 67, 54, 0.05);
}

.danger-zone h2 {
  color: #f44336;
}

.danger-description {
  color: var(--mhw-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-danger {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
  border: 2px solid #f44336;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #f44336;
  color: white;
  transform: scale(1.05);
}

/* ========================================
   Empty State
======================================== */
.no-transactions {
  text-align: center;
  padding: 3rem;
  color: #888;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
  .main-container {
    padding: 0 1rem;
  }

  .account-section {
    padding: 1.5rem;
  }

  .credit-display {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .credit-number {
    font-size: 3rem;
  }

  .btn-purchase {
    width: 100%;
  }

  .credit-stats {
    grid-template-columns: 1fr;
  }

  .account-info-grid {
    grid-template-columns: 1fr;
  }

  .transaction-table {
    font-size: 0.9rem;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 0.6rem;
  }

  /* テーブルのスクロール表示を改善 */
  .transaction-table-wrapper {
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

  .account-section h2 {
    font-size: 1.2rem;
  }

  .credit-number {
    font-size: 2.5rem;
  }

  .transaction-table {
    font-size: 0.8rem;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 0.5rem;
  }
}
