/**
 * ファイル名: volunteer-calendar.css
 * 説明: ボランティアカレンダーのスタイルシート
 * 
 * 更新履歴:
 * - 過去エントリ専用スタイル追加
 * - 凡例の色表示改善
 * - レスポンシブデザイン対応強化
 * - 応募済みエントリの赤枠表示改善
 * -1.2.2 過去エントリの取り消し線削除
 * -1.2.3 凡例のレイアウトを追加
 *
 * @author 小坂田秀之
 * @since 2025-8-10 23:00
 * @version 1.2.3
 **/
/* === カレンダー全体のレイアウト === */
.volunteer-calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    user-select: none;
    margin-bottom: 28px;
}
.volunteer-calendar th, .volunteer-calendar td {
    border: 1px solid #ddd;
    vertical-align: top;
    width: 14.2857%;
    min-width: 60px;
    max-width: 110px;
    padding: 5px 5px 8px 5px;
    word-break: break-word;
    background: #fff;
}
.volunteer-calendar thead tr {
    height: 23px;
}
.volunteer-calendar th {
    background: #f5f5f5;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.1;
}
.volunteer-calendar td {
    min-height: 65px;
    height: 70px;
    font-size: 12px;
    padding: 5px 5px 8px 5px;
}
.volunteer-calendar td.empty-row {
    height: 18px;
    padding: 2px;
    border: none;
    background: transparent;
}
.volunteer-calendar td.empty-cell {
    background: transparent;
    border: none;
}
.volunteer-calendar .date-number {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1;
}
.volunteer-calendar .entry {
    margin-bottom: 4px;
    padding: 0px 3px;
    border-radius: 4px;
    color: #fff;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: block;
    border: 2px solid transparent;
    user-select: none;
    transition: opacity 0.2s ease;
}
.volunteer-calendar .entry:hover {
    opacity: 0.9;
}
.volunteer-calendar .entry.applied {
    border-color: red !important;
    font-weight: bold;
}
.volunteer-calendar .entry.application-closed {
    cursor: not-allowed;
    opacity: 0.7;
    background-color: #888 !important;
}
/* 過去エントリ専用スタイル */
.volunteer-calendar .entry.past-entry {
    background-color: #888888 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* === カレンダーヘッダー === */
.volunteer-calendar-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px 0;
}
.volunteer-calendar .nav-button {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 15px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    user-select: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}
.volunteer-calendar .nav-button:hover {
    background: #005177;
    color: white;
}

/* === 凡例 === */
.volunteer-legend {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 15px;
    font-size: 12.4px;
    line-height: 1.2;
}
.volunteer-legend .legend-item {
    margin-right: 20px;
    margin-bottom: 10px;
    vertical-align: middle;
    white-space: normal;
    color: #222;
}
.volunteer-calendar .legend-item.application-closed {
    opacity: 0.6;
}
#volunteer-calendar-container .legend-color {
  border-radius: 5px;
  color: white;
  font-size: 1em;
  padding: 3px;
  margin: 0 0.3em 0 0;
}
#volunteer-calendar-container .legend-color-red {
  border: 2px solid red;
  color: black;
}


/* 凡例テーブル全体 */
.legend-table,
.legend-table th,
.legend-table td {
    border: none;
    border-collapse: collapse;
}

.legend-table {
    margin-top: 8px;
    table-layout: auto;
    width:inherit!important;
}
/* 説明欄 */
.legend-table td:nth-child(2) {
    font-size: 0.9em;
    color: #444;
}


/* セル間の余白 */
.legend-table td {
    padding: 2px 4px;
    vertical-align: middle;
    line-height: 1em;
}

.legend-table td:nth-child(1) {
    width:auto;
    white-space: nowrap;
}

/* 色枠のサイズと中央揃え */
.legend-color {
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

/* 赤枠（応募済み）専用の例示 */
.legend-color-red {
    border: 2px solid red;
    background: transparent;
    color: red;
}




/* === 応募フォームのレイアウト === */
#volunteer-application-form {
    margin: 30px auto 20px auto;
    padding: 25px 30px 20px 30px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14.5px;
    border-radius: 8px;
    max-width: 550px;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
#volunteer-application-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 19px;
    border-left: 7px solid #2288ff;
    padding-left: 12px;
    display: inline-block;
    color: #333;
}
#volunteer-application-form label {
    display: block;
    margin-bottom: 6px;
    margin-top: 16px;
    font-weight: 600;
    color: #555;
}
#volunteer-application-form input[type="text"].small-input,
#volunteer-application-form input[type="email"].small-input,
#volunteer-application-form select.small-input {
    width: 150px;
    padding: 6px 8px;
    font-size: 14px;
    box-sizing: border-box;
}
#volunteer-application-form input[type="text"],
#volunteer-application-form input[type="email"],
#volunteer-application-form select {
    width: 100%;
    max-width: 320px;
    margin-bottom: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 14px;
}
#volunteer-application-form input[readonly] {
    background-color: #f7f7f7;
    cursor: not-allowed;
    color: #666;
}
#volunteer-application-form #attendees-container {
    margin-top: 14px;
}
#volunteer-application-form #attendees-list input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
}
#volunteer-application-form .submit-button,
#volunteer-application-form .delete-button {
    font-size: 16px;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    margin-top: 20px;
    margin-right: 15px;
    user-select: none;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
#volunteer-application-form .submit-button {
    background: #0073aa;
    color: white;
}
#volunteer-application-form .submit-button:hover {
    background: #005177;
}
#volunteer-application-form .delete-button {
    background: #cc0000;
    color: white;
    display: none;
}
#volunteer-application-form .delete-button:hover {
    background: #800000;
}
#volunteer-application-form #form-message {
    margin-top: 4px;
    margin-bottom: 16px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}
#volunteer-application-form #entry-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    white-space: pre-line;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

/* === メッセージエリア === */
#login-message, #application-closed-message {
    margin: 35px auto;
    color: #d33;
    font-weight: bold;
    font-size: 15px;
    padding: 20px 15px;
    background: #fffbe7;
    border: 1px solid #ffe6ae;
    border-radius: 8px;
    max-width: 480px;
    text-align: center;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#application-closed-message {
    background: #f5f5f5;
    border-color: #ccc;
    color: #666;
}
#application-closed-message #entry-info {
    background: #e8e8e8;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    white-space: pre-line;
    text-align: left;
    font-weight: normal;
    border: 1px solid #ddd;
}
#login-message a {
    color: #0073aa;
    text-decoration: none;
    font-weight: normal;
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: #0073aa;
    color: white;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
#login-message a:hover {
    background: #005177;
}

/* === レスポンシブデザイン === */
@media (max-width: 768px) {
    .volunteer-calendar th,
    .volunteer-calendar td { 
        min-width: 45px; 
        font-size: 11px; 
        padding: 3px;
    }
    .volunteer-calendar .date-number {
        font-size: 12px;
    }
    .volunteer-calendar .entry {
        font-size: 10px;
        padding: 1px 2px;
    }
    #volunteer-application-form { 
        max-width: 95vw; 
        padding: 20px 15px;
        margin: 20px auto;
    }
    .volunteer-calendar-header {
        padding: 5px 0;
    }
    .volunteer-calendar .nav-button {
        padding: 6px 12px;
        font-size: 12px;
        margin: 0 8px;
    }
    .volunteer-calendar .legend-item {
        display: block;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .volunteer-calendar th,
    .volunteer-calendar td { 
        min-width: 35px; 
        font-size: 10px;
        padding: 2px;
    }
    .volunteer-calendar .entry {
        font-size: 9px;
        margin-bottom: 2px;
    }
    #volunteer-application-form {
        padding: 15px 10px;
    }
    #volunteer-application-form h3 {
        font-size: 16px;
    }
}