/* Kavach AI - Professional Chat Interface */

/* Container */
.lyzr-agent-container {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 20px auto;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
}

/* Header */
.lyzr-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-badge {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-icon {
    font-size: 24px;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.lyzr-agent-minimize,
.lyzr-agent-clear {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lyzr-agent-minimize:hover,
.lyzr-agent-clear:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.lyzr-agent-clear .dashicons,
.lyzr-agent-minimize .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Messages Area */
.lyzr-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.lyzr-agent-messages::-webkit-scrollbar {
    width: 8px;
}

.lyzr-agent-messages::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.lyzr-agent-messages::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.lyzr-agent-messages::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

/* Message Bubbles */
.user-message,
.ai-message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
}

.avatar-icon {
    font-size: 20px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.message-header strong {
    color: #1e3c72;
    font-weight: 600;
}

.message-badge {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-content {
    padding: 16px 20px;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(30, 60, 114, 0.2);
}

.ai-message .message-content {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 6px 0;
}

.message-content strong {
    font-weight: 600;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 4px;
    font-weight: 500;
}

.user-message .message-time {
    text-align: right;
}

/* Welcome Message Special Styling */
.welcome-message .message-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    color: #0c4a6e;
}

.welcome-message .message-content ul {
    margin: 8px 0;
}

.welcome-message .message-content li {
    margin: 4px 0;
}

/* Input Area */
.lyzr-agent-input-wrapper {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}

.lyzr-agent-input {
    width: 100%;
    min-height: 60px;
    max-height: 150px;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    line-height: 1.5;
    background: #f8f9fa;
    box-sizing: border-box;
}

.lyzr-agent-input:focus {
    border-color: #2a5298;
    background: white;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.lyzr-agent-input:disabled {
    background: #f1f3f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 500;
    padding: 0 4px;
}

.lyzr-agent-send {
    padding: 14px 32px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.lyzr-agent-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.4);
}

.lyzr-agent-send:active:not(:disabled) {
    transform: translateY(0);
}

.lyzr-agent-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 16px;
    font-weight: bold;
}

.send-text {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Loader */
.lyzr-agent-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.loader-animation {
    display: flex;
    gap: 6px;
}

.loader-dot {
    width: 10px;
    height: 10px;
    background: #2a5298;
    border-radius: 50%;
    animation: loaderBounce 1.4s infinite ease-in-out both;
}

.loader-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loader-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Footer */
.lyzr-agent-footer {
    padding: 12px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.powered-by {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.powered-text {
    font-weight: 400;
}

.brand-name {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Error Message */
.error-message {
    margin-bottom: 16px;
    padding: 16px 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 12px;
    color: #c33;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.error-message .dashicons {
    color: #e74c3c;
}

/* Dark Theme */
.lyzr-agent-container[data-theme="dark"] {
    background: #1a202c;
}

.lyzr-agent-container[data-theme="dark"] .lyzr-agent-messages {
    background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%);
}

.lyzr-agent-container[data-theme="dark"] .ai-message .message-content {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

.lyzr-agent-container[data-theme="dark"] .lyzr-agent-input-wrapper {
    background: #2d3748;
    border-color: #4a5568;
}

.lyzr-agent-container[data-theme="dark"] .lyzr-agent-input {
    background: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
}

.lyzr-agent-container[data-theme="dark"] .lyzr-agent-input:focus {
    border-color: #4299e1;
    background: #2d3748;
}

.lyzr-agent-container[data-theme="dark"] .lyzr-agent-footer {
    background: #2d3748;
    border-color: #4a5568;
}

.lyzr-agent-container[data-theme="dark"] .welcome-message .message-content {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
    color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lyzr-agent-container {
        margin: 10px;
        border-radius: 12px;
        max-width: calc(100% - 20px);
        width: calc(100% - 20px);
    }
    
    .user-message,
    .ai-message {
        max-width: 90%;
    }
    
    .lyzr-agent-header {
        padding: 16px 20px;
    }
    
    .ai-badge {
        width: 40px;
        height: 40px;
    }
    
    .ai-icon {
        font-size: 20px;
    }
    
    .header-text h3 {
        font-size: 16px;
    }
    
    .lyzr-agent-messages {
        padding: 16px;
    }
    
    .lyzr-agent-input-wrapper {
        padding: 16px 20px;
    }
    
    .lyzr-agent-input {
        min-height: 50px;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .lyzr-agent-send {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Full Screen Mobile */
@media (max-width: 480px) {
    .lyzr-agent-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100vh !important;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .lyzr-agent-messages {
        height: calc(100vh - 280px);
    }
    
    .message-content {
        font-size: 14px;
    }
}

/* Minimized State */
.lyzr-agent-container.minimized {
    height: auto !important;
}

.lyzr-agent-container.minimized .lyzr-agent-messages,
.lyzr-agent-container.minimized .lyzr-agent-input-wrapper,
.lyzr-agent-container.minimized .lyzr-agent-footer {
    display: none;
}

/* Accessibility */
.lyzr-agent-send:focus,
.lyzr-agent-input:focus,
.lyzr-agent-clear:focus,
.lyzr-agent-minimize:focus {
    outline: 2px solid #2a5298;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .lyzr-agent-header,
    .lyzr-agent-input-wrapper,
    .lyzr-agent-footer,
    .lyzr-agent-loader {
        display: none !important;
    }
    
    .lyzr-agent-messages {
        height: auto !important;
        overflow: visible !important;
    }
}