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

body {
    font-family: 'Manrope', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    height: 100vh;
    overflow: hidden;
    color: #ffffff;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    will-change: transform;
    transform: translateZ(0);
}

/* Header Styles */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-bottom: 1px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-pic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #8b5cf6;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
}

.profile-pic::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    border-radius: 50%;
    z-index: -1;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details h3 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 16px;
}

.status {
    color: #b0b0b0;
    font-size: 12px;
    margin-bottom: 2px;
    font-weight: 400;
}

.typing-indicator {
    color: #8b5cf6;
    font-size: 11px;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    visibility: hidden;
}

.typing-indicator.show {
    opacity: 1;
    visibility: visible;
}

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

.typing-dot {
    width: 3px;
    height: 3px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite;
}

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

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

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.header-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #333;
    color: #b0b0b0;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions button:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.header-actions button:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* Message Animations */
.message {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInMessage 0.6s ease-out;
    opacity: 0;
    transform: translateY(20px);
    will-change: transform, opacity;
    transform: translateZ(0);
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

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

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

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.message-avatar::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-avatar::before {
    opacity: 1;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
    font-weight: 400;
    line-height: 1.6;
}

.message-html {
    line-height: 1.6;
    color: #ffffff !important;
}

.message-html h1, .message-html h2, .message-html h3, .message-html h4, .message-html h5, .message-html h6 {
    margin: 0 0 12px 0;
    font-weight: 700;
    color: #8b5cf6 !important;
}

.message-html h1 { font-size: 20px; }
.message-html h2 { font-size: 18px; }
.message-html h3 { font-size: 16px; }
.message-html h4 { font-size: 15px; }
.message-html h5 { font-size: 14px; }
.message-html h6 { font-size: 13px; }

.message-html p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #ffffff !important;
}

.message-html p:last-child {
    margin-bottom: 0;
}

.message-html ul, .message-html ol {
    margin: 12px 0;
    padding-left: 20px;
}

.message-html li {
    margin-bottom: 6px;
    line-height: 1.5;
    color: #ffffff !important;
}

.message-html strong, .message-html b {
    font-weight: 700;
    color: #8b5cf6 !important;
}

.message-html em, .message-html i {
    font-style: italic;
    color: #b0b0b0 !important;
}

.message-html blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    font-style: italic;
    color: #ffffff !important;
}

.message-html table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.message-html th, .message-html td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.message-html th {
    background: rgba(139, 92, 246, 0.2);
    font-weight: 700;
    color: #8b5cf6 !important;
}

.message-html tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.message-html code {
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #ffffff !important;
}

.message-html pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-html pre code {
    background: none;
    padding: 0;
    color: #ffffff !important;
}

.message-html a {
    color: #8b5cf6 !important;
    text-decoration: none;
    border-bottom: 1px solid #8b5cf6;
    transition: all 0.3s ease;
}

.message-html a:hover {
    color: #a855f7 !important;
    border-bottom-color: #a855f7;
}

.message-html hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
    margin: 16px 0;
}

.message-html .highlight {
    background: rgba(139, 92, 246, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #ffffff !important;
}

.message-html .tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6 !important;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin: 2px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.message.bot .message-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #ffffff;
    border: 1px solid #333;
    border-bottom-left-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.message-content h4 {
    margin-bottom: 8px;
    font-weight: 600;
    color: #8b5cf6;
}

.message-content p {
    line-height: 1.6;
    margin-bottom: 12px;
    font-weight: 400;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.message-content li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* Slide Preview Enhancements */
.slide-preview {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px dashed #8b5cf6;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    animation: slidePreviewGlow 2s ease-in-out infinite alternate;
}

@keyframes slidePreviewGlow {
    from {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    }
    to {
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    }
}

.slide-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.slide-preview:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border-color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

.slide-preview:hover::before {
    left: 100%;
}

.slide-preview h5 {
    color: #8b5cf6;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
}

.slide-preview p {
    color: #b0b0b0;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* Input Area */
.chat-input-area {
    padding: 16px 24px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-top: 1px solid #333;
    position: sticky;
    bottom: 0;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.chat-input-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
}

/* Button Click Animations */
.quick-reply, .send-btn, .header-actions button {
    transition: all 0.2s ease;
}

.quick-reply:active, .send-btn:active, .header-actions button:active {
    transform: scale(0.95);
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-replies-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1000;
    will-change: transform;
    transform: translateZ(0);
}

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

.quick-replies-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.quick-replies-header:hover::before {
    left: 100%;
}

.quick-replies-header:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.quick-replies-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 14px;
}

.quick-replies-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.quick-replies-toggle i {
    transition: transform 0.3s ease;
}

.quick-replies-toggle.rotated i {
    transform: rotate(180deg);
}

.quick-replies-panel {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.quick-replies-panel.open {
    max-height: 300px;
    opacity: 1;
}

.quick-replies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px;
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
}

.quick-reply {
    padding: 10px 12px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 1px solid #333;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #ffffff;
    text-align: left;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    animation: buttonPulse 3s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    }
}

.quick-reply::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.quick-reply:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.quick-reply:hover::before {
    left: 100%;
}

.quick-reply:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.quick-reply:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.quick-reply.used {
    opacity: 0.5;
    background: #1a1a1a;
    color: #666;
    cursor: not-allowed;
    transform: none;
    border-color: #333;
}

.quick-reply.used:hover {
    background: #1a1a1a;
    color: #666;
    border-color: #333;
    transform: none;
    box-shadow: none;
}

.quick-reply.used::before {
    display: none;
}

/* Scrollbar for quick replies */
.quick-replies-grid::-webkit-scrollbar {
    width: 6px;
}

.quick-replies-grid::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.quick-replies-grid::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.quick-replies-grid::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

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

/* Modal Enhancements */
.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.4s ease-out;
    border: 1px solid #333;
    transform: scale(0.9);
    opacity: 0;
}

.modal-content.show {
    transform: scale(1);
    opacity: 1;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.modal-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 20px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

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

.modal-body {
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
    color: #ffffff;
}

.modal-body h3 {
    color: #8b5cf6;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 18px;
}

.modal-body p {
    line-height: 1.7;
    margin-bottom: 16px;
    color: #e0e0e0;
    font-weight: 400;
}

.modal-body ul, .modal-body ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #e0e0e0;
}

.modal-body .highlight {
    background: rgba(139, 92, 246, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: #8b5cf6;
}

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

@keyframes typing {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .message {
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .message-avatar {
        display: none !important;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .message.user .message-content {
        max-width: 85%;
    }
    
    .message.bot .message-content {
        max-width: 95%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header, .modal-body {
        padding: 20px;
    }
    
    .chat-header, .chat-messages, .chat-input-area {
        padding: 16px;
    }
    
    .chat-messages {
        padding: 12px 8px 0 8px;
        /* Remove excessive padding that creates too much space */
        padding-bottom: 0;
    }
    
    .quick-replies-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .quick-reply {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 44px; /* Better touch target */
    }
    
    .quick-replies-header {
        padding: 16px 20px;
        min-height: 48px; /* Better touch target */
    }
    
    .quick-replies-header h4 {
        font-size: 16px;
    }
    
    /* Fix Safari address bar issue */
    .chat-input-area {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        margin-bottom: env(safe-area-inset-bottom);
        position: sticky;
        bottom: 0;
        z-index: 100;
    }
    
    .quick-replies {
        padding-bottom: env(safe-area-inset-bottom);
        margin-bottom: 16px; /* Extra space to avoid address bar */
    }
    
    .quick-replies-header {
        position: relative;
        z-index: 1000;
        margin-bottom: 8px;
    }
    
    .message-html h1 { font-size: 18px; }
    .message-html h2 { font-size: 16px; }
    .message-html h3 { font-size: 15px; }
    .message-html h4 { font-size: 14px; }
    .message-html h5 { font-size: 13px; }
    .message-html h6 { font-size: 12px; }
    
    .message-html p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .message-html ul, .message-html ol {
        padding-left: 16px;
    }
    
    .message-html li {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Improve header for mobile */
    .chat-header {
        padding: 12px 16px;
    }
    
    .profile-pic {
        width: 40px;
        height: 40px;
    }
    
    .profile-details h3 {
        font-size: 15px;
    }
    
    .status {
        font-size: 11px;
    }
    
    .header-actions button {
        width: 40px;
        height: 40px;
        min-height: 44px; /* Better touch target */
    }
}

@media (max-width: 480px) {
    body {
        /* Remove excessive padding, use sticky footer approach */
        padding-bottom: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .message-content {
        max-width: 95%;
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .message.user .message-content {
        max-width: 90%;
    }
    
    .message.bot .message-content {
        max-width: 98%;
    }
    
    .chat-header, .chat-messages, .chat-input-area {
        padding: 12px;
    }
    
    .chat-messages {
        /* Remove excessive padding that creates too much space */
        padding-bottom: 0;
    }
    
    /* Fix Safari address bar issue with sticky footer */
    .chat-input-area {
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        border-top: 1px solid #333;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        margin-bottom: 0;
    }
    
    .quick-replies {
        padding-bottom: calc(env(safe-area-inset-bottom));
        margin-bottom: 0;
    }
    
    .quick-replies-header {
        margin-bottom: 8px;
        position: relative;
        z-index: 1000;
        padding: 14px 16px;
        min-height: 52px; /* Even better touch target for small screens */
        /* Remove excessive margin */
        margin-bottom: 8px;
    }
    
    .quick-reply {
        padding: 16px 18px;
        font-size: 13px;
        min-height: 48px; /* Better touch target for small screens */
    }
    
    .message-html h1 { font-size: 16px; }
    .message-html h2 { font-size: 15px; }
    .message-html h3 { font-size: 14px; }
    .message-html h4 { font-size: 13px; }
    .message-html h5 { font-size: 12px; }
    .message-html h6 { font-size: 11px; }
    
    .message-html p {
        font-size: 13px;
    }
    
    .message-html li {
        font-size: 13px;
    }
    
    /* Improve header for very small screens */
    .chat-header {
        padding: 10px 12px;
    }
    
    .profile-pic {
        width: 36px;
        height: 36px;
    }
    
    .profile-details h3 {
        font-size: 14px;
    }
    
    .status {
        font-size: 10px;
    }
    
    .header-actions button {
        width: 36px;
        height: 36px;
        min-height: 44px;
    }
    
    /* Improve modal for small screens */
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .modal-header, .modal-body {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
}

/* Extra small screens and landscape orientation */
@media (max-width: 360px) {
    .message-content {
        max-width: 98%;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .quick-reply {
        padding: 14px 16px;
        font-size: 12px;
        min-height: 44px;
    }
    
    .quick-replies-header {
        padding: 12px 14px;
        min-height: 48px;
    }
    
    .quick-replies-header h4 {
        font-size: 14px;
    }
    
    .profile-pic {
        width: 32px;
        height: 32px;
    }
    
    .profile-details h3 {
        font-size: 13px;
    }
    
    .status {
        font-size: 9px;
    }
    
    .chat-messages {
        /* Ensure minimum space above footer */
        padding-bottom: 500px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-container {
        height: 100vh;
    }
    
    .chat-messages {
        max-height: 60vh;
    }
    
    .chat-input-area {
        position: relative;
        padding-bottom: 12px;
    }
    
    .quick-replies {
        margin-bottom: 8px;
    }
    
    .loading-content {
        padding: 20px;
    }
    
    .loading-text h2 {
        font-size: 24px;
    }
    
    .loading-text p {
        font-size: 14px;
    }
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.brand-logo {
    margin-bottom: 30px;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-image {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(139, 92, 246, 0.3));
}

.loading-text {
    margin-bottom: 40px;
}

/* Enhanced Loading Screen */
.loading-text h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.3));
    }
    to {
        filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.6));
    }
}

.loading-text p {
    color: #b0b0b0;
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.spinner-ring {
    width: 12px;
    height: 12px;
    border: 2px solid #333;
    border-top: 2px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
}

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

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

@keyframes accordionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    }
}

/* Hide chat container during loading */
.chat-container {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.chat-container.loaded {
    opacity: 1;
} 

/* Performance optimizations */
.chat-container {
    will-change: transform;
    transform: translateZ(0);
}

.message {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.quick-reply {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize animations for better performance */
@media (prefers-reduced-motion: reduce) {
    .message,
    .quick-reply,
    .quick-replies-header,
    .header-actions button {
        animation: none !important;
        transition: none !important;
    }
    
    .spinner-ring {
        animation: none !important;
    }
    
    .loading-text h2 {
        animation: none !important;
    }
    
    .brand-logo {
        animation: none !important;
    }
} 

/* Mobile-specific accordion visibility fixes */
@media (max-width: 768px) {
    body {
        /* Remove excessive padding, use sticky footer approach */
        padding-bottom: 100px;
        min-height: 100;
        display: flex;
        flex-direction: column;
    }
    
    .chat-container {
        height: 100%;
        margin: 1px;
        border-radius: 0;
        /* Remove excessive padding */
        padding-bottom: 0;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    
    .chat-messages {
        /* Make messages area flexible */
        flex: 1;
        overflow-y: auto;
        /* Remove excessive padding that creates too much space */
        padding-bottom: 0;
    }
    
    .chat-input-area {
        /* Make footer sticky */
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        border-top: 1px solid #333;
        /* Remove excessive padding */
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        margin-bottom: 0;
    }
    
    .quick-replies {
        /* Remove excessive padding */
        padding-bottom: calc(env(safe-area-inset-bottom));
        margin-bottom: 0;
    }
    
    .quick-replies-header {
        position: relative;
        z-index: 1000;
        margin-bottom: 8px;
        /* Remove excessive margin */
        margin-bottom: 8px;
    }
    
    .quick-replies-panel {
        /* Remove excessive padding */
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .quick-replies-grid {
        /* Remove excessive padding */
        margin-bottom: 0;
        padding-bottom: 0;
    }
} 