body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
}

h1 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 30px;
}

/* Info box styling */
.info-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-box p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.info-box ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 5px;
}

.info-box a {
    color: #0056b3;
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

#calendar-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.year-calendar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 1200px;
}

.year-title {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #0056b3;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.month-calendar {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: #fdfdfd;
}

.month-title {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #0056b3;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.day {
    padding: 8px 5px;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 3px;
    background-color: #f9f9f9;
    cursor: pointer;
    position: relative;
    font-size: 0.9em;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    user-select: none;
}

.day.empty {
    background-color: #f0f0f0;
    border: 1px solid #f0f0f0;
    cursor: default;
}

.day:not(.empty):active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* Demand Level Colors */
.day.low-demand {
    background-color: #e0ffe0;
}

.day.medium-demand {
    background-color: #fffacd;
}

.day.high-demand {
    background-color: #ffcccc;
}

/* Tooltip */
.tooltip {
    visibility: hidden;
    width: 280px;
    max-width: 90vw;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 15px;
    position: absolute;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

.tooltip.top::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip.bottom::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.day:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip.tooltip-active {
    visibility: visible !important;
    opacity: 1 !important;
}

.tooltip p {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.tooltip strong {
    color: #ffd700;
}

.tooltip ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.tooltip li {
    margin-bottom: 5px;
    font-size: 0.85em;
    line-height: 1.3;
}

.tooltip li:last-child {
    margin-bottom: 0;
}

/* スマホ対応 */
@media (max-width: 768px) {
    body {
        margin: 10px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .info-box {
        padding: 15px;
        margin-bottom: 20px;
        font-size: 14px;
    }

    .year-calendar {
        padding: 15px;
    }

    .month-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .month-calendar {
        padding: 8px;
    }

    .day {
        padding: 12px 5px;
        font-size: 0.85em;
        min-height: 20px;
    }

    .tooltip {
        width: 250px;
        max-width: 90vw;
        font-size: 13px;
        padding: 12px;
    }
}