/* Chatbot Styles - Matching AlgoVault Theme */

.chatbot-container {
    min-height: 100vh;
    background: var(--body-bg);
}

/* Header Section */
.chatbot-header {
    background: linear-gradient(135deg, var(--body-bg) 0%, var(--secondary-color) 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title i {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.header-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    animation: pulse 2s infinite;
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Chat Interface */
.chat-interface {
    padding: 2rem 0;
}

.chat-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--body-bg);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

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

/* Message Styles */
.message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
}

.user-message .message-avatar {
    background: var(--secondary-color);
    color: var(--text-color);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-bubble {
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    border: none;
}

.bot-message .message-bubble {
    background: var(--card-bg);
    color: var(--text-color);
}

.message-bubble p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
}

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

.message-bubble ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-bubble li {
    margin-bottom: 0.25rem;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.typing-bubble {
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    justify-content: flex-end;
}

#messageInput {
    flex: 1;
    resize: none;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    max-height: 120px;
    line-height: 1.5;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.powered-by {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.powered-by i {
    color: #4285f4;
}

/* Quiz Options Styling */
.quiz-options {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.quiz-option-item {
    background: var(--body-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.quiz-option-item::after {
    content: "Click to select";
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.quiz-option-item:hover::after {
    opacity: 1;
}

.quiz-option-item:hover {
    border-color: var(--primary-color);
    background: rgba(255, 0, 0, 0.05);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.1);
}

.quiz-option-item:active {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.15);
}

.quiz-option-item strong {
    color: var(--primary-color);
    margin-right: 0.25rem;
    display: inline;
}

/* Mode Selection Styling */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.mode-option {
    background: var(--body-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mode-option:hover {
    border-color: var(--primary-color);
    background: rgba(255, 0, 0, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.1);
}

.mode-option:active {
    transform: translateY(0);
}

.mode-option i {
    font-size: 2rem;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}

.mode-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.mode-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Quick Questions */
.quick-questions {
    padding: 3rem 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.quick-questions h3 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.question-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background: var(--body-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.question-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.1);
}

.question-card i {
    font-size: 2rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.question-card span {
    font-weight: 500;
    color: var(--text-color);
}

/* Error Styles */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #d00;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-header {
        padding: 2rem 0;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .ai-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .chat-messages {
        height: 400px;
        padding: 1rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .question-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .question-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        padding-top: 60px;
    }
    
    .page-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chat-wrapper {
        margin: 0 1rem;
        border-radius: 15px;
    }
    
    .chat-messages {
        height: 350px;
        padding: 0.75rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .input-wrapper {
        gap: 0.75rem;
    }
    
    .send-button {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}
