/* ==========================================================================
   Suzaku-AI Chat — Frontend Styles
   ========================================================================== */

/* ---- ベース ---- */
.sai-chat {
    border: 1px solid #d0d8e8;
    border-radius: 14px;
    background: #fff;
    color: #1a2540;
    max-width: 520px;
    font-size: 14px;
    box-shadow: 0 20px 60px rgba(20, 28, 70, 0.13);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---- フローティング ---- */
.sai-chat--floating {
    position: fixed;
    right: 20px;
    bottom: 148px;
    z-index: 9998;
    width: min(520px, calc(100vw - 40px));
    display: none;
    max-height: calc(100vh - 200px);
}

.sai-chat--floating.is-open {
    display: flex;
}

/* ---- トグルボタン ---- */
.sai-chat__toggle {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a4db5 0%, #1f6feb 100%);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(31, 111, 235, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sai-chat__toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(31, 111, 235, 0.55);
}

/* ---- ヘッダー ---- */
.sai-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a3a6c 0%, #1f6feb 100%);
    flex-shrink: 0;
}

.sai-chat__title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.02em;
}

.sai-chat__status {
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.sai-chat__close {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.75);
    padding: 0 2px;
    line-height: 1;
    margin-left: auto;
    transition: color 0.15s;
}

.sai-chat__close:hover {
    color: #fff;
}

/* ---- メッセージエリア ---- */
.sai-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 220px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px 14px;
    background: #f5f7fb;
    flex: 1;
}

.sai-chat__messages::-webkit-scrollbar {
    width: 4px;
}
.sai-chat__messages::-webkit-scrollbar-track {
    background: transparent;
}
.sai-chat__messages::-webkit-scrollbar-thumb {
    background: #c8d0e0;
    border-radius: 4px;
}

/* ---- メッセージバブル ---- */
.sai-chat__message {
    max-width: 82%;
    padding: 10px 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13.5px;
}

.sai-chat__message--assistant {
    align-self: flex-start;
    background: #fff;
    color: #1a2540;
    border-radius: 4px 16px 16px 16px;
    border: 1px solid #e0e8f5;
    box-shadow: 0 1px 4px rgba(20, 40, 100, 0.06);
}

.sai-chat__message--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1a4db5 0%, #1f6feb 100%);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
    box-shadow: 0 2px 8px rgba(31, 111, 235, 0.3);
}

/* ---- 入力エリア ---- */
.sai-chat__form {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e4eaf5;
    background: #fff;
    flex-shrink: 0;
}

.sai-chat__input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ccd5e8;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13.5px;
    background: #f5f7fb;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.sai-chat__input:focus {
    border-color: #1f6feb;
    background: #fff;
}

.sai-chat__button {
    border: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, #1a4db5 0%, #1f6feb 100%);
    color: #fff;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}

.sai-chat__button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ---- 予約ボタン ---- */
.sai-chat__action-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 18px;
    background: linear-gradient(135deg, #1a4db5 0%, #1f6feb 100%);
    color: #fff;
    border-radius: 22px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(31, 111, 235, 0.3);
    transition: opacity 0.2s;
}

.sai-chat__action-btn:hover {
    opacity: 0.88;
    color: #fff;
}
