/* Reset and Base Styles */
* {
    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;
}

/* Demo Page Styles */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    color: white;
}

.demo-header {
    text-align: center;
    margin-bottom: 60px;
}

.demo-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.demo-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.demo-subtitle {
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 600;
    animation: bounce 2s infinite;
}

.demo-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 100px;
}

.demo-content h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

.demo-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.demo-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Chat Widget Styles - POSITIONED LEFT */
#chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;  /* Changed from right to left */
    z-index: 1000;
}

/* Floating Chat Button */
.chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(10, 42, 102, 0.4),
                0 0 0 0 rgba(10, 42, 102, 0.7);
    transition: all 0.3s ease;
    position: relative;
    animation: float 3s ease-in-out infinite, glow 2s ease-in-out infinite;
}

/* Animate the chat icon */
.chat-button svg {
    animation: iconBounce 2s ease-in-out infinite;
}

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

/* Ripple effect animation */
.chat-button::before,
.chat-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #0A2A66;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: ripple 2s infinite;
}

.chat-button::after {
    animation-delay: 1s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(10, 42, 102, 0.4),
                    0 0 0 0 rgba(10, 42, 102, 0.7);
    }
    50% {
        box-shadow: 0 4px 25px rgba(10, 42, 102, 0.6),
                    0 0 20px 5px rgba(10, 42, 102, 0.4);
    }
}

.chat-button:hover {
    transform: scale(1.1) translateY(0);
    box-shadow: 0 6px 30px rgba(10, 42, 102, 0.6),
                0 0 30px 8px rgba(10, 42, 102, 0.5);
    animation: none; /* Stop floating on hover */
}

.chat-button:hover svg {
    animation: none; /* Stop icon bounce on hover */
    transform: scale(1.15) rotate(15deg);
    transition: transform 0.3s ease;
}

.chat-button:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Window - POSITIONED LEFT */
.chat-window {
    position: fixed;
    bottom: 100px;
    left: 20px;  /* Changed from right to left */
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.bot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.close-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-button:hover {
    opacity: 1;
}

/* User Info Form */
.user-info-form {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.form-content h3 {
    color: #0A2A66;
    margin-bottom: 10px;
    font-size: 20px;
}

.form-content p {
    color: #6C757D;
    margin-bottom: 25px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #0A2A66;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #ef4444;
}

.optional {
    color: #6C757D;
    font-weight: 400;
    font-size: 12px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #0A2A66;
    box-shadow: 0 0 0 3px rgba(10, 42, 102, 0.1);
}

.submit-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 42, 102, 0.4);
}

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

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
    padding: 20px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

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

.message.bot {
    flex-direction: row;
}

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

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

.message.bot .message-avatar {
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message.bot .message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

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

.message-bubble .message-content {
    max-width: 100%;
}

.message-time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 3px;
    padding: 0 4px;
}

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

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

/* Chat Input */
.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

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

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #0A2A66;
}

.send-button {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #0A2A66 0%, #1e3a8a 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Actions */
.chat-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.end-conversation-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.end-conversation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 0 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #6C757D;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar,
.user-info-form::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.user-info-form::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb,
.user-info-form::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.user-info-form::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design - LEFT POSITION */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        left: 20px;  /* Changed from right to left */
        bottom: 100px;
    }
    
    .demo-header h1 {
        font-size: 2rem;
    }
    
    .demo-content {
        padding: 20px;
    }
}
