* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.header-content .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 28px;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

/* Chat Messages Container for Tabbed System */
.chat-messages-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.chat-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 16px;
    background: white;
}

.chat-messages.active {
    display: flex;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    background: #f5f7fa;
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 15px;
}

.user-message .message-content {
    background: #2196F3;
    color: white;
}

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

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

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply {
    background: white;
    border: 2px solid #2196F3;
    color: #2196F3;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-reply:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-2px);
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e0e6ed;
    background: #fafbfc;
}

.chat-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#messageInput:focus {
    border-color: #2196F3;
}

#sendButton {
    background: #2196F3;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#sendButton:hover {
    background: #1976D2;
    transform: scale(1.05);
}

#sendButton:active {
    transform: scale(0.95);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #f5f7fa;
    border-radius: 18px;
    margin-bottom: 16px;
    align-self: flex-start;
    max-width: 85%;
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

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

/* Mobile responsiveness */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: calc(100vh - 20px);
        border-radius: 15px;
    }
    
    .chat-header {
        padding: 20px 15px;
    }
    
    .header-content h1 {
        font-size: 20px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .quick-reply {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Topic Tabs Styles */
.topic-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
}

.tab-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
    border: 2px solid transparent;
    background: #f8f9fa;
}

.tab:hover {
    background: #e8f4fd;
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.tab:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.25);
}

.tab.active {
    background: #2196F3;
    color: white;
}

.tab.completed {
    background: #4CAF50;
    color: white;
}

.tab-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.tab-title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-status {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 1;
    visibility: visible;
}

.tab-status.completed {
    background: #4CAF50;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #4CAF50, 0 2px 8px rgba(76, 175, 80, 0.4);
}

.tab-status.completed::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.tab-status.active {
    background: #FF9800;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 3px #FF9800, 0 2px 8px rgba(255, 152, 0, 0.4);
    border: 2px solid white;
}

.tab-status.active::after {
    content: '•';
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

/* Enhanced tab interaction hints */
.tab::before {
    content: 'Click to view';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tab:hover::before {
    opacity: 1;
}

/* Enhanced active tab styling */
.tab.active {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border-color: #1976D2;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}

.tab.completed {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    border-color: #388E3C;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Topic Information Panel */
.topic-info-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.topic-info-panel.show {
    transform: translateX(0);
}

.topic-header {
    background: #2196F3;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-topic-btn {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 2px;
    background: #f5f5f5;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid transparent;
}

.close-topic-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.topic-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.topic-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.topic-responses {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.topic-responses h4 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.response-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.response-item.user {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.response-item.bot {
    background: #f1f8e9;
    border-left: 3px solid #4CAF50;
}
