/* 📱 Sapie 챗봇 반응형 디자인 - chatbot-responsive.css */

/* 태블릿 디자인 */
@media (max-width: 768px) {
    /* 스크롤 버튼 (태블릿) */
    #backtotop {
        bottom: 90px !important;
        right: 25px !important;
        width: 45px;
        height: 45px;
    }
    
    /* 챗봇 버튼 (태블릿) */
    #chatbot-container {
        bottom: 25px;
        right: 25px;
        width: 45px;
        height: 45px;
    }
    
    #chatbot-float-avatar {
        width: 26px;
        height: 26px;
    }
    
    /* 챗봇 창 (태블릿) */
    #chatbot-window {
        width: 320px;
        height: 400px;
        bottom: 60px;
        right: -20px;
    }
    
    /* 메시지 스타일 (태블릿) */
    .message-content {
        max-width: 85%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* 입력 영역 (태블릿) */
    #chat-input {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    #chat-send-btn {
        font-size: 13px;
        padding: 10px 20px;
        min-width: 70px;
    }
    
    /* 헤더 (태블릿) */
    #chatbot-header {
        padding: 10px 14px;
    }
    
    #chatbot-header strong {
        font-size: 15px;
    }
    
    #chatbot-close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* 모바일 디자인 */
@media (max-width: 480px) {
    /* 스크롤 버튼 (모바일) */
    #backtotop {
        bottom: 85px !important;
        right: 20px !important;
        width: 42px;
        height: 42px;
    }
    
    /* 챗봇 버튼 (모바일) */
    #chatbot-container {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }
    
    #chatbot-float-avatar {
        width: 24px;
        height: 24px;
    }
    
    /* 챗봇 창 (모바일) */
    #chatbot-window {
        width: 300px;
        height: 380px;
        bottom: 55px;
        right: -25px;
    }
    
    /* 메시지 스타일 (모바일) */
    .message-content {
        max-width: 90%;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
    }
    
    /* 입력 영역 (모바일) */
    #chat-input {
        font-size: 12px;
        padding: 8px 14px;
    }
    
    #chat-send-btn {
        font-size: 12px;
        padding: 8px 16px;
        min-width: 60px;
    }
    
    #chat-input-area {
        padding: 12px;
        gap: 8px;
    }
    
    /* 헤더 (모바일) */
    #chatbot-header {
        padding: 8px 12px;
    }
    
    #chatbot-header strong {
        font-size: 14px;
    }
    
    #chatbot-close-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    /* 메시지 영역 (모바일) */
    #chat-messages {
        padding: 12px;
        max-height: 250px;
    }
}

/* 소형 모바일 디자인 */
@media (max-width: 360px) {
    /* 챗봇 창 (소형 모바일) */
    #chatbot-window {
        width: 280px;
        height: 360px;
        right: -30px;
    }
    
    /* 메시지 스타일 (소형 모바일) */
    .message-content {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
    }
    
    /* 입력 영역 (소형 모바일) */
    #chat-input {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    #chat-send-btn {
        font-size: 11px;
        padding: 6px 12px;
        min-width: 50px;
    }
    
    /* 메시지 영역 (소형 모바일) */
    #chat-messages {
        padding: 10px;
        max-height: 220px;
    }
}

/* 가로 모드 최적화 */
@media (max-width: 768px) and (orientation: landscape) {
    #chatbot-window {
        height: 320px;
    }
    
    #chat-messages {
        max-height: 180px;
    }
}

/* 큰 화면 최적화 */
@media (min-width: 1200px) {
    #chatbot-window {
        width: 380px;
        height: 480px;
    }
    
    #chat-messages {
        max-height: 330px;
    }
    
    .message-content {
        font-size: 15px;
        padding: 14px 18px;
    }
    
    .message-avatar {
        width: 38px;
        height: 38px;
    }
    
    #chat-input {
        font-size: 15px;
        padding: 14px 20px;
    }
    
    #chat-send-btn {
        font-size: 15px;
        padding: 14px 28px;
        min-width: 90px;
    }
}

/* 다크 모드 지원 (선택적) */
@media (prefers-color-scheme: dark) {
    #chat-messages {
        background: linear-gradient(to bottom, #1a1a1a 0%, #2d2d2d 100%) !important;
    }
    
    .bot-message .message-content {
        background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 50%, #5a5a5a 100%);
        color: #e0e0e0;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .user-message .message-content {
        background: linear-gradient(135deg, #7c8fe8 0%, #6c7fdc 50%, #5c6fd0 100%);
        color: #ffffff;
    }
    
    #chat-input {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    #chat-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    /* 애니메이션 줄이기 */
    .message-avatar.sapie-avatar,
    .thinking-avatar,
    .thinking-content {
        animation: none;
    }
    
    #chatbot-window.opening,
    #chatbot-window.closing {
        animation: none;
        transition: opacity 0.2s ease;
    }
    
    .chat-message {
        animation: none;
    }
}