:root {
    --primary-color: #2563eb;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #ca8a04;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-top: 70px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.chat-container {
    height: calc(100vh - 200px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bg-light);
}

.message {
    display: flex;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

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

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

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

.assistant-message .message-avatar {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    margin-right: 0.75rem;
}

.message-content {
    flex: 1;
    max-width: 80%;
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
}

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

.assistant-message .message-content {
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.25rem;
}

.message-content p {
    margin-bottom: 0.5rem;
}

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

.message-content ul, .message-content ol {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.message-content code {
    background-color: rgba(0,0,0,0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.user-message .message-content code {
    background-color: rgba(255,255,255,0.2);
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    max-width: 150px;
}

.thinking-dots {
    display: flex;
    gap: 0.25rem;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.card-footer {
    border-top: 1px solid var(--border-color);
}

#chatInput {
    border-radius: 1.5rem;
    padding: 0.625rem 1rem;
}

#chatInput:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

#sendBtn {
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
}

.blacklist-list {
    max-height: 300px;
    overflow-y: auto;
}

.blacklist-list .list-group-item {
    border-left: 3px solid var(--danger-color);
}

.tip-item h6 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.footer {
    margin-top: auto;
}

@media (max-width: 991.98px) {
    .chat-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
    }
}

@media (max-width: 575.98px) {
    .chat-container {
        height: 55vh;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

.risk-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.risk-high { background-color: #fee2e2; color: #991b1b; }
.risk-medium { background-color: #fef3c7; color: #92400e; }
.risk-low { background-color: #d1fae5; color: #065f46; }
.risk-safe { background-color: #dbeafe; color: #1e40af; }

.locale-switch.active {
    font-weight: 600;
    background-color: var(--bg-light);
}
