/* AI Chat Page Styles */

.ai-chat-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    color: white;
}

.ai-chat-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 800;
}

.ai-chat-header .subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Chat Type Selector */
.chat-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.chat-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-type-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.chat-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.chat-type-btn .type-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.chat-type-btn .type-title {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.chat-type-btn .type-desc {
    font-size: 0.9em;
    opacity: 0.8;
}

/* MBTI Input */
.mbti-input-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.mbti-input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.mbti-input-container input {
    width: 100%;
    max-width: 200px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.mbti-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.mbti-hint {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Chat Container */
.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.chat-messages {
    padding: 30px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* Custom scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Messages */
.message {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    font-size: 2em;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    padding: 15px 20px;
    border-radius: 15px;
    line-height: 1.6;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-note {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.user-message {
    flex-direction: row-reverse;
}

.assistant-message .message-content {
    background: white;
    border: 2px solid #e9ecef;
}

.error-message .message-content {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

#chatInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

#chatInput:focus {
    outline: none;
    border-color: #667eea;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.char-count {
    font-size: 0.9em;
    color: #666;
}

.send-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn .btn-icon {
    font-size: 1.2em;
}

/* Usage Info */
.usage-info {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.usage-info h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #856404;
}

.usage-info ul {
    list-style: none;
    padding: 0;
}

.usage-info li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
}

.usage-info li:last-child {
    border-bottom: none;
}

.usage-info strong {
    color: #856404;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 30px;
}

.faq-section h3 {
    font-size: 1.4em;
    margin-bottom: 20px;
    font-weight: 700;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.faq-btn {
    padding: 15px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 600;
    text-align: left;
    font-family: inherit;
}

.faq-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-header {
        padding: 30px 15px 25px;
    }

    .ai-chat-header h1 {
        font-size: 1.8em;
    }

    .ai-chat-header .subtitle {
        font-size: 1em;
    }

    /* Chat type buttons - Stack vertically for easier tapping */
    .chat-type-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chat-type-btn {
        min-height: 100px;
        padding: 25px 20px;
    }

    .chat-type-btn .type-icon {
        font-size: 2.5em;
    }

    .chat-type-btn .type-title {
        font-size: 1.3em;
    }

    .chat-type-btn .type-desc {
        font-size: 0.95em;
    }

    /* Chat messages - Optimized for mobile viewing */
    .chat-messages {
        padding: 15px;
        min-height: 350px;
        max-height: calc(100vh - 450px);
    }

    .message {
        margin-bottom: 20px;
        gap: 12px;
    }

    .message-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.6em;
    }

    .message-content {
        padding: 14px 16px;
        font-size: 1em;
        line-height: 1.7;
    }

    /* FAQ - Full width buttons */
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .faq-btn {
        padding: 16px 18px;
        font-size: 1em;
        min-height: 56px;
        text-align: center;
    }

    /* MBTI Input - Better mobile UX */
    .mbti-input-container {
        padding: 18px;
    }

    .mbti-input-container input {
        max-width: 100%;
        font-size: 1.2em;
        padding: 14px 16px;
    }

    /* Chat input area - Larger for mobile */
    .chat-input-container {
        padding: 15px;
    }

    #chatInput {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px 16px;
        min-height: 80px;
    }

    .send-btn {
        padding: 14px 28px;
        font-size: 1.05em;
        min-height: 52px;
    }

    /* Input actions - Better spacing */
    .input-actions {
        margin-top: 10px;
        gap: 10px;
    }

    .char-count {
        font-size: 0.95em;
    }

    /* Usage info - More compact */
    .usage-info {
        padding: 16px;
        margin-bottom: 20px;
    }

    .usage-info h3 {
        font-size: 1.15em;
        margin-bottom: 12px;
    }

    .usage-info li {
        padding: 6px 0;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .ai-chat-header {
        padding: 30px 15px 20px;
    }

    .ai-chat-header h1 {
        font-size: 1.5em;
    }

    .chat-type-btn {
        padding: 20px 15px;
    }

    .usage-info {
        padding: 15px;
    }

    .usage-info h3 {
        font-size: 1.1em;
    }
}
