@charset "UTF-8";

/* ==========================================================================
   カレンダー全体のレイアウト・コンテナ
   ========================================================================== */
.calendar-container {
    width: 92%;
    max-width: 400px; /* スマホ時の最大幅 */
    margin: 16px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    position: relative; 
    transition: max-width 0.3s ease;
}

.calendar-container h1 {
    text-align: center;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 12px;
}

/* ヘッダー（年月表示・月移動ボタン） */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header h2 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
    font-weight: bold;
}

.nav-btn {
    background-color: #f0f4f8;
    color: #2c3e50;
    border: 1px solid #dcdfe6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.nav-btn:hover {
    background-color: #2b82c5;
    color: #ffffff;
    border-color: #2b82c5;
}

/* ==========================================================================
   カレンダーテーブル（日付部分）
   ========================================================================== */
.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    text-align: center;
    table-layout: fixed;
}

.calendar-table th {
    padding: 6px 0;
    font-size: 0.8rem;
    color: #666666;
    font-weight: 600;
}

.calendar-table th.sun { color: #e74c3c; }
.calendar-table th.sat { color: #2b82c5; }

.calendar-table td {
    height: 40px;
    line-height: 40px;
    font-size: 0.9rem;
    color: #333333;
    vertical-align: middle;
    text-align: center;
    border-radius: 50%;
    box-sizing: border-box;
    position: relative;
    cursor: pointer;
}

.calendar-table td.sun { color: #e74c3c; }
.calendar-table td.sat { color: #2b82c5; }
.calendar-table td.empty {
    background: transparent;
    cursor: default;
}

/* 今日（緑色の丸印） */
.calendar-table td.red-circle {
    background-color: #24f504b1;
    color: #113300;
    font-weight: bold;
}

/* 誕生日（青色の丸印） */
.calendar-table td.birth-circle {
    background-color: #2b82c5;
    color: #ffffff;
    font-weight: bold;
}

/* 今日 ＆ 誕生日の重なり表現（青丸はそのまま、外側に緑色の四角枠を表示） */
.calendar-table td.red-circle.birth-circle {
    background-color: #2b82c5 !important; /* 青い丸の背景を維持 */
    color: #ffffff !important;            /* 白文字を維持 */
    font-weight: bold;
    position: relative;                   /* 枠線配置の基準点 */
}

.calendar-table td.red-circle.birth-circle::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 5px solid #24f504;           /* 緑色の四角い枠線 */
    border-radius: 2px;                   /* くっきりした四角枠（不要なら0に） */
    pointer-events: none;                 /* クリックイベントを邪魔しない */
    box-sizing: border-box;
}

/* ==========================================================================
   ツールチップ（はみ出し対策済）
   ========================================================================== */
.calendar-table td .birthday-tooltip {
    display: none;
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: left;
    font-weight: normal;
    line-height: 1.4;
    pointer-events: none;
}

/* 日曜日 (1列目) */
.calendar-table td:nth-child(1) .birthday-tooltip {
    left: 0%;
    transform: translateX(0);
}

/* 月曜日 (2列目) */
.calendar-table td:nth-child(2) .birthday-tooltip {
    left: 20%;
    transform: translateX(-20%);
}

/* 金曜日 (6列目) */
.calendar-table td:nth-child(6) .birthday-tooltip {
    left: 80%;
    transform: translateX(-80%);
}

/* 土曜日 (7列目) */
.calendar-table td:nth-child(7) .birthday-tooltip {
    left: auto;
    right: 0%;
    transform: translateX(0);
}

.calendar-table td.birth-circle:hover .birthday-tooltip,
.calendar-table td .birthday-tooltip.active {
    display: block !important;
}

/* ==========================================================================
   下部エリア（本日のメッセージ＆誕生日リストのラッパー）
   ========================================================================== */
.calendar-bottom-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

/* 本日の誕生日メッセージ＆共有エリア */
.today-birthday-container {
    padding: 14px;
    background-color: #f0f7ff;
    border: 1px solid #cce3f7;
    border-radius: 10px;
    text-align: center;
}

.today-message {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    font-weight: bold;
    color: #1d3557;
    line-height: 1.5;
    word-break: break-word;
}

.today-message-none {
    margin: 0;
    font-size: 0.85rem;
    color: #666666;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.download-button,
.x-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    box-sizing: border-box;
    flex: 1 1 130px;
    max-width: 180px;
    cursor: pointer;
}

.download-button {
    background-color: #4b5563;
    color: #ffffff;
}

.x-share-button {
    background-color: #000000;
    color: #ffffff;
    transition: opacity 0.2s;
}

.x-share-button:hover {
    opacity: 0.85;
}

.x-icon {
    width: 13px;
    height: 13px;
    fill: #ffffff;
    margin-right: 5px;
}

/* 今月の誕生日座員リスト */
.birthday-list-container {
    padding-top: 12px;
    border-top: 2px dashed #eeeeee;
}

.birthday-list-container h3 {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: left;
    font-weight: bold;
}

.birthday-list-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.birthday-list-container li {
    font-size: 0.85rem;
    padding: 6px 0;
    color: #333333;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
}

.birthday-list-container li:last-child {
    border-bottom: none;
}

.birthday-list-container .birth-day {
    display: inline-block;
    background-color: #2b82c5;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 8px;
    min-width: 52px;
    text-align: center;
    flex-shrink: 0;
}

.birthday-list-container .member-name {
    font-weight: bold;
    color: #2c3e50;
    margin-right: 4px;
}

/* アフィリエイトボックス（基本：スマホ用の縦並び） */
.affiliate-box {
    width: 100%;
    display: flex;
    flex-direction: column; /* 縦並び */
    align-items: center;    /* 中央揃え */
    gap: 20px;
    margin: 16px 0 5px 0;
}

/* ==========================================================================
   タブレット・PC向けレスポンシブ設定 (画面幅 768px 以上)
   ========================================================================== */
@media (min-width: 768px) {
    .calendar-container {
        max-width: 800px; /* PCでは幅をゆったり拡張 */
        padding: 28px;
        margin: 32px auto;
    }

    .calendar-container h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .calendar-header h2 {
        font-size: 1.3rem;
    }

    .nav-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .calendar-table th {
        font-size: 0.95rem;
        padding: 10px 0;
    }

    .calendar-table td {
        height: 54px;
        line-height: 54px;
        font-size: 1.1rem;
    }

    /* 下部コンテンツを左右2カラムに並べる */
    .calendar-bottom-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
        margin-top: 24px;
    }

    .today-birthday-container {
        flex: 1;
        margin-top: 0;
        padding: 18px;
    }

    .today-message {
        font-size: 0.95rem;
    }

    .birthday-list-container {
        flex: 1;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        border-left: 2px dashed #eeeeee;
        padding-left: 24px;
    }

    .birthday-list-container h3 {
        font-size: 1rem;
    }

    .birthday-list-container li {
        font-size: 0.95rem;
        padding: 8px 0;
    }

    /* PC時：アフィリエイトボックスを横並びにする */
    .affiliate-box {
        flex-direction: row;     /* 横並び */
        justify-content: center; /* 中央寄せ */
        align-items: flex-start; /* 縦方向を上部揃えに変更 */
    }
}

/* ==========================================================================
   小型スマートフォン向け調整 (画面幅 360px 以下)
   ========================================================================== */
@media (max-width: 360px) {
    .calendar-container {
        padding: 12px 8px;
    }

    .calendar-table td {
        height: 34px;
        line-height: 34px;
        font-size: 0.8rem;
    }

    .download-button,
    .x-share-button {
        flex: 1 1 100%;
        max-width: 100%;
    }
}