/* アプリケーション全体の表示制御 */
#calendar-app {
    display: none;
}

#calendar-app.is-ready {
    display: block;
}

/* ローディングスピナー */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #666;
    font-size: 1.1em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    padding: 20px;
    max-width: 1280px;
}

/* 管理者表示のスタイル */
.admin-notice {
    background-color: #79cbb8;
    color: white;
    padding: 10px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* カレンダーのスタイル */
.calendar-container {
    width: 100%;
    max-width: 1280px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.calendar-header button {
    padding: 8px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    background: #005177;
}

.calendar-header button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 月表示カレンダー */
.month-calendar {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.weekday {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #ddd;
}

.calendar-cell {
    min-height: 150px;
    padding: 8px;
    border-right: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
    overflow-y: auto;
    position: relative;
}

/* スクロールバーのスタイリング */
.calendar-cell::-webkit-scrollbar {
    width: 4px;
}

.calendar-cell::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.calendar-cell::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.calendar-cell::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.calendar-cell:hover:not(.is-disabled):not(.is-other-month) {
    background-color: #f5f9ff;
}

.calendar-cell.is-disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.calendar-cell.is-other-month {
    background-color: #f9f9f9;
    color: #ccc;
    cursor: default;
}

.calendar-cell.is-today {
    background-color: #e8f5fe;
}

.calendar-cell.sunday .cell-date {
    color: #cc0000;
}

.calendar-cell.saturday .cell-date {
    color: #0066cc;
}

/* セルヘッダー */
.cell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cell-date {
    font-size: 1.1em;
    font-weight: bold;
}

/* 予約確認ボタン */
.show-reservations-btn {
    font-size: 0.8em;
    padding: 2px 6px;
    background: #09618b;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.show-reservations-btn:hover {
    background: #023d58;
}

/* 予約情報表示 */
.quota-info {
    font-size: 0.9em;
}

.quota-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.quota-label {
    font-weight: 500;
    color: #666;
}

.quota-label.medium-car,
.quota-label.big-car {
    background: #f0f7ff;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 24px;
    text-align: center;
}

.quota-label.medium-car {
    color: #0066cc;
}

.quota-label.big-car {
    color: #cc0000;
}

.quota-value {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 予約情報の表示 */
.reservation-info {
    display: none;
    margin-top: 8px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.85em;
}

.reservation-header {
    font-weight: bold;
    color: #666;
    margin-bottom: 4px;
    padding: 2px 4px;
    background: #fff;
    border-radius: 3px;
}

.vehicle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-bottom: 1px dashed #eee;
}

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

.vehicle-number {
    font-weight: bold;
    color: #333;
    background: #f0f7ff;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.vehicle-name {
    color: #666;
    font-size: 0.9em;
    flex: 1;
}

/* モーダルのスタイル */
.reservation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.3s;
}

.modal-content {
    background: white;
    padding: 12px 12px 20px 12px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-content h2 {
    font-size: 1em;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 3px;
    padding-bottom: 2px;
    border-bottom: 2px solid #0073aa;
}

.form-group {
    margin-bottom: 5px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 3px;
    font-weight: bold;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: larger;
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input[type="text"] {
    flex: 1;
}

.search-button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.search-button:hover {
    background: #005177;
}

@media (max-width: 480px) {
    .search-button {
        padding: 8px;
        font-size: 0.9em;
    }
}

.form-group textarea {
    height: 70px;
    resize: vertical;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.submit-button,
.cancel-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.submit-button {
    background-color: #0073aa;
    color: white;
}

.submit-button:hover {
    background-color: #005177;
}

.cancel-button {
    background-color: #f1f1f1;
    color: #333;
}

.cancel-button:hover {
    background-color: #ddd;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .calendar-cell {
        min-height: 100px;
        font-size: 0.9em;
    }
    
    .quota-info {
        font-size: 0.8em;
    }
    
    .modal-content {
        width: 90%;
        padding: 10px;
        font-size: 0.8em;
        position: absolute;
        top: 0%;
        margin: 10px;
    }
    .form-group textarea {
        height: 40px !important;
        resize: vertical;
    }
}