/* ポイント履歴ページのスタイル */
.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.main-header {
  position: sticky;
  top: 0;
  background-color: #F1EDE7;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.member-points-main-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 0 0 20px 20px;
}

.points-ranking, .points-history {
    margin-bottom: 30px;
}

/* ヘッダースタイル */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dddddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.points-ranking h3, .points-history h3 {
    font-size: 20px;
    color: #555555;
    margin: 0;
}

.header .button {
    margin-left: 20px;
}

.points-ranking p {
    margin-bottom: 0;
}

.points-history-table {
    width: 50%;
    border-collapse: collapse;
}

.points-history-table th, .points-history-table td {
    border: 1px solid #dddddd;
    padding: 8px;
    text-align: center;
}

.points-history-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* 日付カラム（1列目）のデータを左揃え */
.points-history-table td:nth-child(1) {
    width: 120px;
    text-align: left;
}

/* 取得ポイントカラム（2列目）のデータを右揃え */
.points-history-table td:nth-child(2) {
    width: 100px;
    text-align: right;
    padding-right: 15px; /* 右側に余白を追加 */
}

/* 使用ポイントカラム（3列目）のデータを右揃え */
.points-history-table td:nth-child(3) {
    width: 100px;
    text-align: right;
    padding-right: 15px; /* 右側に余白を追加 */
}

/* ポイント残高カラム（4列目）のデータを右揃え */
.points-history-table td:nth-child(4) {
    width: 120px;
    text-align: right;
    padding-right: 15px; /* 右側に余白を追加 */
    font-weight: bold;
}

.points-history-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ポイントの取得/利用に関するスタイル */
.point-gain {
    color: #0AA273; /* 取得ポイントは緑色 */
}

.point-use {
    color: #ff6b6b; /* 利用ポイントは赤色 */
}

/* クリック可能な行のスタイル */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #e9f7fe !important;
}

/* モーダルのスタイル */
.point-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.point-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.point-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 1;
}

.point-modal-close:hover {
    color: #333;
}

.point-modal-title {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.point-modal-body {
    margin-top: 20px;
}

/* ポイント詳細テーブルのスタイル */
.points-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.points-detail-table th,
.points-detail-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

/* ポイント数カラム（3列目）を右揃えに */
.points-detail-table th:nth-child(3),
.points-detail-table td:nth-child(3) {
    text-align: right;
    padding-right: 15px;
}

.points-detail-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.points-detail-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* レスポンシブ対応 */
@media screen and (max-width: 1000px) {
    .points-history-table th,
    .points-history-table td,
    .points-detail-table th,
    .points-detail-table td {
        font-size: 14px;
        padding: 6px;
    }
    
    .points-ranking h3, 
    .points-history h3 {
        font-size: 18px;
    }
    
    .point-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media screen and (max-width: 768px) {
    .member-points-main-body {
        padding: 15px;
    }
    
    .points-history-table,
    .points-detail-table {
        width: 100%;
    }
    
    .points-history-table th,
    .points-history-table td,
    .points-detail-table th,
    .points-detail-table td {
        font-size: 13px;
        padding: 5px;
    }
    
    .points-ranking h3, 
    .points-history h3 {
        font-size: 16px;
    }
    
    .header .button {
        font-size: 13px;
        margin-left: 10px;
        padding: 6px 10px;
    }
    
    .point-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    /* スクロール可能なテーブルコンテナを追加 */
    .point-modal-body {
        overflow-x: auto;
    }
}

@media screen and (max-width: 480px) {
    .member-points-main-body {
        padding: 10px;
    }
    
    .points-history-table th,
    .points-history-table td,
    .points-detail-table th,
    .points-detail-table td {
        font-size: 12px;
        padding: 4px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header .button {
        margin-left: 0;
    }
    
    .points-ranking p {
        font-size: 13px;
    }
    
    .point-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
}

.points-table th, .ranking-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}
