/* ==============================
    Datepicker 全体
============================== */
.ui-datepicker {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px;
}

/* ==============================
    ヘッダー
============================== */
.ui-datepicker-header {
    background: none;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 10px;
    font-weight: bold;
    color: #333;
}

/* 年月セレクト */
.ui-datepicker select.ui-datepicker-year,
.ui-datepicker select.ui-datepicker-month {
    width: auto;
    padding: 4px 8px;
    margin: 0 4px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    appearance: none;
    background-color: #fff;
    background-size: 12px;
}

/* ==============================
    曜日・日付セル
============================== */
.ui-datepicker th {
    color: #333;
    font-weight: normal;
}

/* 日曜 */
.ui-datepicker th:nth-child(1),
.ui-datepicker td:nth-child(1) a,
.ui-datepicker td:nth-child(1) span {
    color: #e53935 !important;
}

/* 土曜 */
.ui-datepicker th:nth-child(7),
.ui-datepicker td:nth-child(7) a,
.ui-datepicker td:nth-child(7) span {
    color: #1e88e5 !important;
}

/* 祝日 */
.ui-datepicker td.holiday-date,
.ui-datepicker td.holiday-date a,
.ui-datepicker td.holiday-date span {
    color: #e53935 !important;
}

/* 日付セル */
.ui-datepicker td span,
.ui-datepicker td a {
    display: block;
    text-align: center;
    padding: 6px;
    color: #333 !important;
    background: none !important;
    border: none !important;
}

/* hover */
.ui-datepicker td a:hover {
    background: #F5F5F5 !important;
}

/* 選択中 */
.ui-datepicker td a.ui-state-active {
    color: #FFF !important;
    background: #0075FF !important;
}

/* ==============================
    前月・次月ナビゲーション
============================== */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    background: none !important;
    border: none !important;
}

/* 左右位置 */
.ui-datepicker .ui-datepicker-prev { left: 6px; }
.ui-datepicker .ui-datepicker-next { right: 6px; }

/* 左矢印 */
.ui-datepicker .ui-datepicker-prev::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 8px;
    width: 8px;
    height: 8px;
    border-left: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: translateY(-50%) rotate(45deg);
}

/* 右矢印 */
.ui-datepicker .ui-datepicker-next::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #333;
    border-top: 2px solid #333;
    transform: translateY(-50%) rotate(45deg);
}

/* デフォルトアイコンを非表示 */
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: none !important;
}

/* ==============================
    ローディング
============================== */
#ui-datepicker-div.fuw-loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

#ui-datepicker-div.fuw-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: #333;
    border-radius: 50%;
    border-collapse: separate;
    animation: spinner 0.8s linear infinite;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease; 
}

#ui-datepicker-div:not(.fuw-loading)::after {
    opacity: 0;
    pointer-events: none;
}

/* ==============================
    アニメーション
============================== */
@keyframes spinner {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
