/* NMCZ Chatbot Styles */
:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --secondary-color: #f8f9fa;
    --accent-color: #17a2b8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header-text h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header-text p {
    color: var(--dark-color);
    font-size: 1rem;
    opacity: 0.8;
}

/* Chat Container */
.chat-container {
    flex: 1;
    background: var(--light-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

/* Connection Status */
.connection-status {
    background: var(--secondary-color);
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.connecting {
    background: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.status-indicator.connected {
    background: var(--success-color);
}

.status-indicator.disconnected {
    background: var(--danger-color);
}

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

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 500px;
    min-height: 400px;
}

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

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

.bot-message .message-avatar {
    background: var(--primary-color);
    color: white;
}

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

.user-message .message-avatar {
    background: var(--accent-color);
    color: white;
    margin-right: 0;
    margin-left: 15px;
}

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

.user-message .message-content {
    text-align: right;
}

.message-text {
    background: var(--secondary-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
}

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 5px 0;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    opacity: 0.7;
}

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

.welcome-message {
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px;
    background: rgba(0, 102, 204, 0.05);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0 20px 20px;
    animation: fadeIn 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 15px;
    padding: 12px 16px;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
}

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

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

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

@keyframes typing {
    0%, 60%, 100% { opacity: 0.4; }
    30% { opacity: 1; }
}

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

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chat-input:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.send-button {
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.send-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.char-counter {
    font-size: 0.8rem;
}

.clear-button {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--transition);
}

.clear-button:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Quick Actions */
.quick-actions {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.quick-actions h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.action-btn {
    padding: 12px 16px;
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

/* Footer */
.footer {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.footer-content p {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--dark-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-messages {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .message {
        margin-bottom: 15px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
    }
    
    .send-button {
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .chat-input-container,
    .quick-actions,
    .loading-overlay,
    .modal {
        display: none !important;
    }
    
    .chat-messages {
        max-height: none;
        overflow: visible;
    }
}
