body {
    font-family: 'Inter', sans-serif;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s, border-color 0.3s;
}

.dark .glass-panel {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
    transition: all 0.3s ease;
}

.dark .glass-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.glass-input:focus {
    background: #ffffff;
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.dark .glass-input:focus {
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.glass-input::placeholder {
    color: #94a3b8;
}

.dark .glass-input::placeholder {
    color: #64748b;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Animations for background blobs */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
    animation: blob 7s infinite;
}
.animation-delay-2000 {
    animation-delay: 2s;
}
.animation-delay-4000 {
    animation-delay: 4s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9; 
}
.dark ::-webkit-scrollbar-track {
    background: #0f172a; 
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155; 
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569; 
}

.glow-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.glow-btn:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.dark .glow-btn:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Table styling */
table {
    border-collapse: separate;
    border-spacing: 0;
}
th, td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.dark th, .dark td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal animation */
.modal-overlay {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
}
.dark .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* Chat & Calling Styles */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-window.hidden {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 0.95rem;
    margin-bottom: 8px;
    position: relative;
    line-height: 1.4;
}

.chat-bubble.sent {
    background: #6366f1;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.dark .chat-bubble.received {
    background: #334155;
    color: white;
}

/* Advanced Chat Features */
.chat-bubble {
    cursor: pointer;
    transition: transform 0.2s;
}
.chat-bubble:active { transform: scale(0.98); }

.reply-context {
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #6366f1;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    max-width: 100%;
}
.dark .reply-context { background: rgba(255, 255, 255, 0.1); }

.message-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 3000;
    min-width: 160px;
    overflow: hidden;
    padding: 4px;
}
.dark .message-menu { background: #1e293b; color: white; border: 1px solid rgba(255,255,255,0.1); }

.menu-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.menu-item:hover { background: #f1f5f9; }
.dark .menu-item:hover { background: #334155; }
.menu-item.danger { color: #ef4444; }

.reaction-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.dark .reaction-bar { border-color: rgba(255,255,255,0.1); }
.react-btn {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.react-btn:hover { transform: scale(1.3); }

.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    position: absolute;
    bottom: -12px;
    left: 8px;
    background: white;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}
.sent .msg-reactions { left: auto; right: 8px; }
.dark .msg-reactions { background: #334155; border: 1px solid rgba(255,255,255,0.1); }

.reply-preview-container {
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dark .reply-preview-container { background: #1e293b; border-color: rgba(255,255,255,0.1); }

@media (max-width: 480px) {
    .chat-window {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 80px;
    }
}
