/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Background Effects */
.chat-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-float 8s ease-in-out infinite;
}

.particle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle-2 {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.particle-3 {
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.particle-4 {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
}

.particle-5 {
    top: 70%;
    left: 50%;
    animation-delay: 3s;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.02) 0%, 
        rgba(118, 75, 162, 0.02) 50%, 
        rgba(102, 126, 234, 0.02) 100%);
    animation: gradient-shift 15s ease-in-out infinite;
}

/* Header Styles */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    position: relative;
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    animation: header-glow 3s ease-in-out infinite;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.button-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.back-button:hover .button-ripple {
    width: 100%;
    height: 100%;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bot-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.bot-avatar:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.avatar-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: avatar-pulse 2s ease-in-out infinite;
}

.bot-details h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status {
    font-size: 0.9rem;
    opacity: 0.9;
}

.status.online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-btn .button-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.header-btn:hover .button-ripple {
    width: 100%;
    height: 100%;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f8f9ff;
    position: relative;
}

.chat-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.chat-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(102, 126, 234, 0.02) 0%, transparent 50%);
    animation: chat-pattern-move 25s ease-in-out infinite;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(102, 126, 234, 0.4);
    font-size: 1.5rem;
    animation: floating-icon-float 8s ease-in-out infinite;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.floating-icon:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

.floating-icon:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 6s;
}

.chat-messages {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Message Styles */
.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.3s ease;
}

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.message-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    animation: message-glow-pulse 3s ease-in-out infinite;
}

.bot-message:hover .message-glow {
    opacity: 0.3;
}

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

.user-message .message-avatar {
    background: #e2e8f0;
    color: #64748b;
}

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

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

.message-text {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    word-wrap: break-word;
}

.bot-message .message-text {
    border-bottom-left-radius: 5px;
    background: white;
}

.user-message .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.typing-dots {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Footer Input Area */
.chat-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.footer-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #667eea 50%, 
        transparent 100%);
    animation: footer-glow 3s ease-in-out infinite;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    background: #f8f9ff;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.input-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.1) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
}

.input-wrapper:focus-within .input-glow {
    left: 100%;
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

#messageInput::placeholder {
    color: #94a3b8;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.send-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.send-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.send-btn:hover .send-glow {
    opacity: 0.3;
}

.action-btn .button-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.action-btn:hover .button-ripple {
    width: 100%;
    height: 100%;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.char-count {
    font-weight: 500;
}

.disclaimer {
    font-style: italic;
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #64748b;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.setting-item select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

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

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

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

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.7;
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes header-glow {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.6;
        transform: translateX(100%);
    }
}

@keyframes avatar-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

@keyframes footer-glow {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

@keyframes chat-pattern-move {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(10px) translateY(-10px);
    }
    50% {
        transform: translateX(-5px) translateY(5px);
    }
    75% {
        transform: translateX(-10px) translateY(-5px);
    }
}

@keyframes floating-icon-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-15px) rotate(5deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) rotate(-3deg);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) rotate(8deg);
        opacity: 0.7;
    }
}

@keyframes message-glow-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-right {
        align-self: flex-end;
    }
    
    .chat-main {
        padding: 1rem;
    }
    
    .chat-footer {
        padding: 1rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .bot-details h2 {
        font-size: 1.2rem;
    }
    
    .header-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .header-btn span {
        display: none;
    }
    
    .message-text {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Dark Theme */
.dark-theme {
    background: #1a1a1a;
    color: #e2e8f0;
}

.dark-theme .chat-container {
    background: #2d2d2d;
}

.dark-theme .chat-main {
    background: #1a1a1a;
}

.dark-theme .message-text {
    background: #3a3a3a;
    color: #e2e8f0;
}

.dark-theme .user-message .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-theme .input-wrapper {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.dark-theme #messageInput {
    color: #e2e8f0;
}

.dark-theme .modal-content {
    background: #2d2d2d;
    color: #e2e8f0;
}

.dark-theme .setting-item select {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e2e8f0;
}
