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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 50%, #7f1d1d 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Animated background elements */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Chat Container */
.chat-container {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(145deg, #ffffff 0%, #fefefe 100%);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.chat-container.minimized {
    height: 80px;
    transform: none;
    border-radius: 0 0 20px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.chat-container:hover {
    transform: none;
    box-shadow: none;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    flex-shrink: 0;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.assistant-info {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.assistant-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.assistant-avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 4s linear infinite;
}

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

.assistant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Woman avatar placeholder */
.woman-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fdbcb4 0%, #f4a5a5 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.woman-avatar::before {
    content: '👩';
    font-size: 1.2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.assistant-details h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.assistant-details p {
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 8px;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

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

.header-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.minimize-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.minimize-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fefefe 0%, #f8fafc 100%);
    position: relative;
    min-height: 0;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
}

.message {
    display: flex;
    margin-bottom: 25px;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 15px;
    position: relative;
    overflow: hidden;
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(31, 41, 55, 0.3);
}

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

.message-content p {
    background: white;
    padding: 18px 22px;
    border-radius: 22px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.assistant-message .message-content p {
    border-bottom-left-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
}

.user-message .message-content p {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 
        0 4px 15px rgba(220, 38, 38, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

/* Service Options */
.service-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.service-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    padding: 12px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    color: #374151;
    position: relative;
    overflow: hidden;
}

.service-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    transition: left 0.5s ease;
}

.service-btn:hover {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.service-btn:hover::before {
    left: 100%;
}

.service-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid rgba(220, 38, 38, 0.1);
    position: relative;
    flex-shrink: 0;
}

.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.2), transparent);
}

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

#message-input {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid #e5e7eb;
    border-radius: 30px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

#message-input:focus {
    border-color: #dc2626;
    box-shadow: 
        0 0 0 4px rgba(220, 38, 38, 0.1),
        0 4px 20px rgba(220, 38, 38, 0.15);
    transform: translateY(-2px);
}

#message-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

#send-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
    position: relative;
    overflow: hidden;
}

#send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

#send-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

#send-btn:hover::before {
    width: 100%;
    height: 100%;
}

#send-btn:active {
    transform: scale(0.95);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

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

.typing-dots span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
}

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

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

/* Floating Chat Button */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 
        0 15px 35px rgba(220, 38, 38, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.floating-chat-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 6s linear infinite;
}

.floating-chat-btn:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(220, 38, 38, 0.5),
        0 10px 25px rgba(0, 0, 0, 0.3);
}

.floating-chat-btn:active {
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-header {
        padding: 15px 20px;
        min-height: 70px;
    }
    
    .assistant-avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .woman-avatar {
        font-size: 20px;
    }
    
    .woman-avatar::before {
        font-size: 1em;
    }
    
    .assistant-details h3 {
        font-size: 18px;
    }
    
    .assistant-details p {
        font-size: 13px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        margin-bottom: 20px;
    }
    
    .message-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 0 12px;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .message-content p {
        padding: 15px 18px;
        font-size: 14px;
    }
    
    .service-options {
        gap: 8px;
        margin-top: 15px;
    }
    
    .service-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    #message-input {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    #send-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .floating-chat-btn {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 12px 15px;
        min-height: 65px;
    }
    
    .assistant-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .woman-avatar {
        font-size: 18px;
    }
    
    .woman-avatar::before {
        font-size: 0.9em;
    }
    
    .assistant-details h3 {
        font-size: 16px;
    }
    
    .assistant-details p {
        font-size: 12px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message {
        margin-bottom: 15px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
        margin: 0 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-content p {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .service-options {
        gap: 6px;
        margin-top: 12px;
    }
    
    .service-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .chat-input-container {
        padding: 12px;
    }
    
    #message-input {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    #send-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .floating-chat-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Prevent zoom on input focus */
    input[type="text"], textarea {
        font-size: 16px;
    }
    
    /* Better touch targets */
    .service-btn, #send-btn, .minimize-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Better spacing for mobile */
    .message {
        margin-bottom: 18px;
    }
    
    .message-content p {
        line-height: 1.5;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-header {
        padding: 10px 15px;
        min-height: 60px;
    }
    
    .assistant-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(220, 38, 38, 0.3);
    border-radius: 50%;
    border-top-color: #dc2626;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.success-checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    position: relative;
    animation: checkmark 0.6s ease-in-out;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}