/* ============================================
   DarChat Customer Dashboard - Styles
   ============================================ */

:root {
    --brand-50: #f0fdfa;
    --brand-100: #ccfbf1;
    --brand-200: #99f6e4;
    --brand-300: #5eead4;
    --brand-400: #2dd4bf;
    --brand-500: #14b8a6;
    --brand-600: #0d9488;
    --brand-700: #0f766e;
    --brand-800: #115e59;
    --brand-900: #134e4a;
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: radial-gradient(circle at top, #ecfeff 0%, #f8fafc 45%, #f1f5f9 100%);
}

/* Sidebar */
.sidebar {
    transition: width 0.3s ease;
    position: relative;
    z-index: 30;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.message-bubble { max-width: 80%; }
.loading { animation: pulse 1.5s infinite; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--brand-50);
    color: var(--brand-700);
}
.badge-telegram     { background: #e0f2fe; color: #0369a1; }
.badge-whatsapp     { background: #dcfce7; color: #15803d; }
.badge-widget       { background: #fef3c7; color: #b45309; }
.badge-admin        { background: #ede9fe; color: #6d28d9; }
.badge-system       { background: #e2e8f0; color: #475569; }
.badge-connected    { background: #dcfce7; color: #15803d; }
.badge-disconnected { background: #f1f5f9; color: #64748b; }
.badge-warning      { background: #fef3c7; color: #b45309; }
.badge-error        { background: #fee2e2; color: #dc2626; }
.badge-disabled     { background: #f1f5f9; color: #94a3b8; }

/* Tailwind overrides for brand palette */
.bg-indigo-900 { background-color: var(--ink-900) !important; }
.bg-indigo-800 { background-color: var(--ink-800) !important; }
.bg-indigo-700 { background-color: var(--brand-700) !important; }
.bg-indigo-600 { background-color: var(--brand-600) !important; }
.bg-indigo-500 { background-color: var(--brand-500) !important; }
.bg-indigo-100 { background-color: var(--brand-100) !important; }
.bg-indigo-50  { background-color: var(--brand-50) !important; }
.text-indigo-600 { color: var(--brand-600) !important; }
.text-indigo-500 { color: var(--brand-500) !important; }
.text-indigo-400 { color: var(--brand-400) !important; }
.text-indigo-300 { color: var(--brand-300) !important; }
.text-indigo-200 { color: var(--brand-200) !important; }
.text-indigo-100 { color: var(--brand-100) !important; }
.border-indigo-500 { border-color: var(--brand-500) !important; }
.border-indigo-200 { border-color: var(--brand-200) !important; }
.hover\:bg-indigo-700:hover { background-color: var(--brand-700) !important; }
.hover\:bg-indigo-800:hover { background-color: var(--ink-800) !important; }
.hover\:text-indigo-600:hover { color: var(--brand-600) !important; }
.focus\:ring-indigo-500:focus { --tw-ring-color: var(--brand-500) !important; }

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

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast-success { background: #059669; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2563eb; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 260px !important;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar.open + .sidebar-overlay {
        display: block;
    }
    .sidebar .nav-text { display: inline; }
    .sidebar .sidebar-header-text { display: block; }
    .mobile-menu-btn { display: flex; }

    /* conversation panel: stack vertically on mobile */
    #conversationsSection .flex.space-x-4 {
        flex-direction: column;
        height: auto;
    }
    #conversationsSection .flex.space-x-4 > div {
        width: 100% !important;
        max-height: 50vh;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 60px !important; }
    .sidebar .nav-text { display: none; }
    .sidebar .sidebar-header-text { display: none; }
}

/* Scrollbar styling */
.overflow-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}
.overflow-auto::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}
.overflow-auto::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.overflow-auto::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
