/* 対応履歴ページのスタイル */
.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-reservations-main-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 0 0 20px 20px;
}

.reservations-list {
    margin-bottom: 30px;
}

/* ヘッダースタイル */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dddddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.reservations-list h3 {
    font-size: 20px;
    color: #555555;
    margin: 0;
}

.header .button {
    margin-left: 20px;
}

/* モバイル用メニュー */
.mobile-menu-container {
    display: none;
    width: 100%;
    margin-bottom: 15px;
}

.mobile-menu-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-size: 14px;
}

/* テーブルスタイル */
.reservations-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.reservations-table th, 
.reservations-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: left;
}

.reservations-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    border-top: 1px solid #ddd;
}

.reservations-table th:first-child,
.reservations-table td:first-child {
    border-left: 1px solid #ddd;
}

/* カラム幅の調整 */
.reservations-table th.service-name,
.reservations-table td:nth-child(1) {
    width: 90px;
}

.reservations-table th.reservation-date,
.reservations-table td:nth-child(2) {
    width: 70px;
}

.reservations-table th.notes,
.reservations-table td:nth-child(3) {
    width: 30%;
}

.reservations-table th.last-response-date,
.reservations-table td:nth-child(4) {
    width: 80px;
}

.reservations-table th.last-response-details,
.reservations-table td:nth-child(5) {
    width: 25%;
}

.reservations-table th.status,
.reservations-table td:nth-child(6) {
    width: 80px;
}

/* 対応状況セルの背景色と中央寄せ */
.status-cell {
    text-align: center !important;
    vertical-align: middle;
}

.status-cell.未対応 { background-color: #ffcccc; }
.status-cell.対応中 { background-color: #ffffcc; }
.status-cell.完了 { background-color: #ccffcc; }
.status-cell.キャンセル { background-color: #dddddd; }
.status-cell.保留 { background-color: #ddeeff; }
.status-cell.要再対応 { background-color: #ffddaa; }

/* クリック可能な行のスタイル */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #e9f7fe !important;
}

/* 編集インターフェース */
.editor-form {
    padding: 5px;
}

.date-input, .time-input, .status-select {
    width: 100%;
    margin-bottom: 5px;
    padding: 3px;
}

.text-input {
    width: 100%;
    height: auto;
    min-height: 60px;
    margin-bottom: 0;
    padding: 5px;
    resize: vertical;
}

.editor-buttons {
    display: flex;
    justify-content: space-between;
}

.save-btn, .cancel-btn {
    padding: 3px 8px;
    cursor: pointer;
}

.save-btn {
    background-color: #4CAF50;
    color: white;
}

.cancel-btn {
    background-color: #f44336;
    color: white;
}

/* ヘッダーを左揃えに（対応状況以外） */
.reservations-table th.service-name,
.reservations-table th.reservation-date,
.reservations-table th.notes {
    text-align: left;
    padding-left: 15px;
}

/* 対応状況ヘッダーは中央揃えを維持 */
.reservations-table th.status {
    text-align: center;
}

/* サービス名と予約日時カラムのデータは左揃え */
.reservations-table td:nth-child(1),
.reservations-table td:nth-child(2),
.reservations-table td:nth-child(3) {
    text-align: left;
    padding-left: 15px;
}

.reservations-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ステータスのスタイル */
.reservations-table td.complete {
    color: #0AA273; /* 完了ステータスの色 (緑) */
    text-align: center;
}

.reservations-table td.incomplete {
    color: #fff; /* 未完了ステータスのテキスト色 */
    background-color: #ff6b6b; /* 未完了ステータスの背景色 (赤) */
    font-weight: bold;
    text-align: center;
}

/* 依頼詳細のスタイル - 左揃えと上揃えを維持 */
.reservations-table td:nth-child(3) {
    max-width: 300px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5; /* 行間を適切に設定 */
    padding: 12px; /* パディングを少し大きくして読みやすく */
    vertical-align: top; /* テキストを上揃えに */
    text-align: left; /* 依頼詳細は左揃えを維持 */
}

/* 依頼詳細内の段落間隔 */
.reservations-table td:nth-child(3) br {
    line-height: 1.8; /* 改行後の行間を広げる */
    display: block;
    content: ""; /* 空の内容でブロック要素化 */
    margin-top: 5px; /* 改行間に余白を追加 */
}

/* ホバーエフェクト */
.reservations-table tr:hover {
    background-color: #e9f7fe;
}

/* 状態テキストのスタイル */
.status-complete {
    color: #0AA273; /* 完了は緑色 */
    font-weight: bold;
}

.status-pending {
    color: #f0ad4e; /* 対応中はオレンジ色 */
    font-weight: bold;
}

.status-canceled {
    color: #d9534f; /* キャンセルは赤色 */
    font-weight: bold;
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #333;
    text-decoration: none;
}

.modal h3 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    color: #333;
}

.service-info {
    background-color: #f8f9fa;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid #0275d8;
}

.service-info p {
    margin: 10px 0; /* 行間を5px増加 */
    line-height: 1.3;
}

/* 履歴テーブルのスタイル */
.response-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    border: 1px solid #ddd;
}

.response-history-table th,
.response-history-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.response-history-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}
.response-history-table th:nth-child(3) {
    text-align: center;
}

.response-history-table td:nth-child(1) {
    width: 120px;
    white-space: nowrap;
}

.response-history-table td:nth-child(2) {
    width: auto;
}

.response-history-table td:nth-child(3) {
    width: 100px;
    text-align: center;
}

/* 対応状況のスタイル（モーダル内） */
.未対応 {
    background-color: #ffcccc;
}

.対応中 {
    background-color: #ffffcc;
}

.完了 {
    background-color: #ccffcc;
}

.キャンセル {
    background-color: #dddddd;
}

.保留 {
    background-color: #ddeeff;
}

.要再対応 {
    background-color: #ffddaa;
}

/* 対応追加ボタン */
.add-response-btn {
    margin-bottom: 15px;
    background-color: #0AA273;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.add-response-btn i {
    font-size: 16px;
}

.add-response-btn:hover {
    background-color: #088c61;
}

/* 新規対応入力フォーム */
.new-response-form {
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none;
}

.new-response-form.active {
    display: block;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 8px;
    gap: 10px;
}

.form-group {
    flex: 1;
    min-width: 120px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.form-group textarea {
    height: 90px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.form-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.form-buttons .save-btn {
    background-color: #0AA273;
    color: white;
}

.form-buttons .cancel-btn {
    background-color: #ff6b6b;
    color: white;
}

/* 戻るボタン（モバイル用） */
.mobile-return-button {
    display: none;
    margin-bottom: 15px;
    text-align: center;
}

.mobile-return-button a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.mobile-return-button a i {
    margin-right: 5px;
}

/* レスポンシブ対応 */
@media screen and (max-width: 1000px) {
    .reservations-table th,
    .reservations-table td {
        font-size: 14px;
        padding: 8px;
    }
    
    .reservations-list h3 {
        font-size: 18px;
    }
    
    .reservations-table th.service-name {
        width: 120px;
    }
    
    .reservations-table th.reservation-date {
        width: 150px;
    }
    
    .reservations-table th.status {
        width: 90px;
    }
}

@media screen and (max-width: 768px) {
    .member-reservations-main-body {
        padding: 15px;
    }
    
    .reservations-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .reservations-table th,
    .reservations-table td {
        font-size: 13px;
        padding: 6px;
    }
    
    .reservations-list h3 {
        font-size: 16px;
    }
    
    /* モバイル用メニューを表示 */
    .button-group {
        display: none;
    }
    
    .mobile-menu-container {
        display: block;
    }
    
    /* ヘッダーの戻るボタンを非表示に */
    .main-header .return-button {
        display: none;
    }
    
    /* モバイル用戻るボタンを表示 */
    .mobile-return-button {
        display: block;
    }
    
    /* モバイル用のテーブルレイアウト調整 */
    .reservations-table th.notes,
    .reservations-table td:nth-child(3),
    .reservations-table th.last-response-details,
    .reservations-table td:nth-child(5) {
        display: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .response-history-table td,
    .response-history-table th {
        padding: 6px;
        font-size: 13px;
    }
    
    .service-info {
        padding: 10px;
    }
    
    .service-info p {
        font-size: 13px;
    }
    
    .new-response-form {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .form-buttons button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .member-reservations-main-body {
        padding: 10px;
    }
    
    .reservations-table th,
    .reservations-table td {
        font-size: 12px;
        padding: 4px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header .button {
        margin-left: 0;
    }
    
    .reservations-list h3 {
        font-size: 15px;
    }
    
    .modal-content {
        padding: 10px;
    }
    
    .modal h3 {
        font-size: 16px;
    }
    
    .add-response-btn {
        width: 100%;
    }
    
    /* 480px以下の場合のモーダル内テーブルフォントサイズ調整 */
    .response-history-table th,
    .response-history-table td {
        font-size: 11px;
        padding: 4px;
    }

    .response-history-table td:nth-child(1) {
        width: 70px;
    }
    
    .response-history-table td:nth-child(3) {
        width: 64px;
        font-size: 10px;
        padding: 4px 2px;
        white-space: nowrap;
    }
    
    .service-info p {
        font-size: 12px;
        margin: 8px 0;
    }
}