/**
 * 独立チャットページ用スタイル
 */

.chat-page-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.chat-page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chat-page-header h1 {
    font-size: 2rem;
    color: #2D3436;
    margin-bottom: 0.5rem;
}

.chat-page-header p {
    color: #636E72;
    margin-bottom: 1rem;
}

.staff-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F8F9FA;
    border-radius: 20px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #B2BEC3;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #00B894;
}

.status-dot.offline {
    background: #FDCB6E;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* チャットコンテナ */
.chat-page-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* タブ */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid #E0E0E0;
}

.chat-tab {
    flex: 1;
    padding: 16px;
    background: #F8F9FA;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #636E72;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-tab:hover {
    background: #ECEFF1;
}

.chat-tab.active {
    background: white;
    color: #2D3436;
    border-bottom: 3px solid #4A90E2;
}

/* チャットパネル */
.chat-panel {
    display: none;
    flex-direction: column;
    min-height: 500px;
}

.chat-panel.active {
    display: flex;
}

/* メッセージエリア（チャットページ専用） */
.chat-page .chat-messages,
.chat-panel .chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    background: #FAFAFA;
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #E3F2FD;
}

.message-content {
    max-width: 70%;
}

.message-sender {
    font-size: 12px;
    color: #B2BEC3;
    margin-bottom: 4px;
}

.user-message .message-sender {
    text-align: right;
}

.message-text {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 14px;
}

.bot-message .message-text,
.staff-message .message-text {
    background: white;
    color: #2D3436;
    border: 1px solid #E0E0E0;
    border-top-left-radius: 4px;
}

.user-message .message-text {
    background: #4A90E2;
    color: white;
    border-top-right-radius: 4px;
}

.visitor-message .message-text {
    background: #4A90E2;
    color: white;
    border-top-right-radius: 4px;
}

/* クイック質問ボタン */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: #F8F9FA;
    border-top: 1px solid #E0E0E0;
}

.quick-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid #DFE6E9;
    border-radius: 20px;
    font-size: 13px;
    color: #2D3436;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

/* 入力エリア */
.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #E0E0E0;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #DFE6E9;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #4A90E2;
}

.chat-send-btn {
    padding: 12px 24px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-send-btn:hover {
    background: #357ABD;
}

/* ライブチャット開始画面 */
.live-start-screen {
    padding: 40px;
    text-align: center;
}

.live-start-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.live-start-screen h3 {
    font-size: 20px;
    color: #2D3436;
    margin-bottom: 8px;
}

.live-start-screen > p {
    color: #636E72;
    margin-bottom: 24px;
}

.live-start-form {
    max-width: 300px;
    margin: 0 auto;
    text-align: left;
}

.live-start-form .form-group {
    margin-bottom: 16px;
}

.live-start-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #2D3436;
    margin-bottom: 6px;
}

.live-start-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #DFE6E9;
    border-radius: 8px;
    font-size: 14px;
}

.live-start-form small {
    display: block;
    font-size: 12px;
    color: #B2BEC3;
    margin-top: 4px;
}

.btn-start-chat {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
}

/* ライブチャット画面 */
.live-chat-screen {
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.chat-actions {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #E0E0E0;
}

.btn-end-chat {
    padding: 8px 20px;
    font-size: 13px;
}

/* フッター */
.chat-page-footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #F8F9FA;
    border-radius: 12px;
}

.chat-page-footer p {
    color: #636E72;
    margin-bottom: 8px;
}

.phone-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4CAF50;
    text-decoration: none;
}

.phone-link:hover {
    text-decoration: underline;
}

.phone-hours {
    display: block;
    font-size: 14px;
    color: #B2BEC3;
    margin-top: 4px;
}

/* ボタン共通 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background: #357ABD;
}

.btn-secondary {
    background: #DFE6E9;
    color: #636E72;
}

.btn-secondary:hover {
    background: #B2BEC3;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .chat-page-section {
        padding: 1rem;
    }
    
    .chat-page-header h1 {
        font-size: 1.5rem;
    }
    
    .chat-tab {
        padding: 12px;
        font-size: 13px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-questions {
        padding: 10px;
    }
    
    .quick-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}
