/* WA Gateway CRM Design System - Light Mode */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #f8fafc; /* Slate 50 - Background utama */
    --bg-card: #ffffff; /* Putih bersih untuk card */
    --border-card: #e2e8f0; /* Slate 200 - Border halus */
    --primary-gradient: linear-gradient(135deg, #1e40af, #3b82f6); /* Tema biru utama */
    --accent-gradient: linear-gradient(135deg, #f97316, #fb923c); /* Aksen orange */
    --text-main: #0f172a; /* Slate 900 - Teks utama */
    --text-muted: #64748b; /* Slate 500 - Teks sekunder */
    --accent-blue: #3b82f6;
    --accent-orange: #f97316;
    --accent-teal: #0d9488;
    --accent-purple: #8b5cf6;
    --danger-red: #ef4444;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Glassmorphism Cards (Premium Light Mode) */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.08);
}

/* Custom Scrollbar - Global (Light) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.2);
}

/* Sidebar Scrollbar (Dark Blue) */
.main-sidebar .sidebar::-webkit-scrollbar {
    width: 3px;
}
.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(141, 162, 251, 0.25);
    border-radius: 4px;
}
.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(141, 162, 251, 0.45);
}

/* Brand logo glow animation */
@keyframes brandGlow {
    0%, 100% { box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4); }
    50%       { box-shadow: 0 3px 16px rgba(59, 130, 246, 0.7); }
}
.brand-image-container {
    animation: brandGlow 3s ease-in-out infinite;
}

/* AdminLTE Light Overrides */
.content-wrapper {
    background-color: var(--bg-dark) !important;
}

.main-sidebar {
    background-color: #132247 !important;
    border-right: none !important;
}

.brand-link {
    border-bottom: none !important;
    background-color: #132247 !important;
}

.main-header {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-card) !important;
}

/* User Profile Section (UBold Style) */
.user-profile-sidebar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%), #1d2b56;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 15px 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-profile-sidebar::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.user-profile-sidebar::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.user-profile-sidebar img {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    transition: transform 0.2s ease;
}

.user-profile-sidebar img:hover {
    transform: scale(1.05);
}

.user-profile-sidebar .position-relative span {
    border-color: #1d2b56 !important;
}

.user-profile-sidebar .profile-settings-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a5b4fc !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 8px;
    z-index: 2;
}

.user-profile-sidebar .profile-settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
}

/* Hide user profile + footer when sidebar is collapsed */
.sidebar-collapse .user-profile-sidebar {
    display: none !important;
}
.sidebar-collapse .sidebar-footer {
    display: none !important;
}

/* Sidebar navigation links (UBold Style) */
.main-sidebar .nav-sidebar .nav-item .nav-link {
    color: #b4c6ef !important;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 10px 14px !important;
    border-radius: 6px;
    margin: 3px 12px !important;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.main-sidebar .nav-sidebar .nav-item .nav-link i.nav-icon {
    color: #8da2fb !important;
    font-size: 0.95rem;
    margin-right: 12px !important;
    width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

/* Navigation link hover state */
.main-sidebar .nav-sidebar .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

.main-sidebar .nav-sidebar .nav-item .nav-link:hover i.nav-icon {
    color: #ffffff !important;
}

/* Navigation link active state */
.main-sidebar .nav-sidebar .nav-item .nav-link.active {
    background-color: #203162 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: none !important;
    border-left: 3px solid #f97316 !important;
    padding-left: 11px !important;
}

.main-sidebar .nav-sidebar .nav-item .nav-link.active i.nav-icon {
    color: #fb923c !important;
}

/* Sidebar navigation section header styling */
.main-sidebar .nav-sidebar .nav-header {
    background: transparent !important;
    color: #899bc6 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    padding: 18px 20px 8px 20px !important;
    margin-top: 5px;
}

/* Button Stylings */
.btn-primary-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-accent-gradient {
    background: var(--accent-gradient);
    border: none;
    color: white !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-accent-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

/* Live Chat Interface Styling */
.chat-window {
    height: calc(100vh - 120px);
    display: flex;
    overflow: hidden;
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.6);
}

.chat-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
}

.chat-info-area {
    width: 300px;
    border-left: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.6);
    overflow-y: auto;
}

/* Bubble Message Chat */
.chat-msg-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #efeae2;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    background-attachment: fixed;
}

.msg-bubble {
    max-width: 70%;
    margin-bottom: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    line-height: 1.5;
    animation: slideIn 0.2s ease-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.msg-incoming {
    background-color: #f1f5f9;
    color: #0f172a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.msg-outgoing {
    background: var(--primary-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.msg-bot {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    color: white;
    align-self: center;
    text-align: center;
    margin: 16px auto;
    border-radius: 12px;
    font-size: 0.9rem;
    max-width: 50%;
}

.msg-time {
    font-size: 0.7rem;
    color: rgba(15, 23, 42, 0.4);
    text-align: right;
    margin-top: 4px;
}

.msg-outgoing .msg-time {
    color: rgba(255, 255, 255, 0.6);
}

.msg-status {
    font-size: 0.7rem;
    margin-left: 4px;
}

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

/* Chat Input Bar */
.chat-input-bar {
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Drawflow Editor Customization */
#drawflow {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border-card);
    background: #f8fafc;
    background-image: radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 0);
    background-size: 20px 20px;
    border-radius: 12px;
}

.drawflow .drawflow-node {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: #0f172a;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.1);
}

.drawflow .drawflow-node:hover {
    border-color: #3b82f6;
}

.drawflow .drawflow-node.selected {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.drawflow .drawflow-node .title {
    background: rgba(59, 130, 246, 0.08);
    color: #1e40af;
    font-weight: bold;
    border-bottom: 1px solid var(--border-card);
}

/* Widgets Dashboard */
.info-box-custom {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.05);
}

.info-box-custom .info-box-icon {
    font-size: 2.2rem;
    padding: 12px;
    border-radius: 12px;
    margin-right: 16px;
}

.bg-icon-blue {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.bg-icon-teal {
    background: rgba(20, 184, 166, 0.08);
    color: #0d9488;
}

.bg-icon-purple {
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
}

/* Global Bootstrap Dark Mode Overrides for Light Mode conversion */
.table-dark {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.table-dark th, .table-dark td {
    border-color: #e2e8f0 !important;
}

.table-dark thead th {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.table-dark tbody tr:hover {
    background-color: #f8fafc !important;
}

.card.bg-dark, .card-dark, .modal-content.bg-dark, .modal-content.glass-card {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

.modal-header, .modal-footer {
    border-color: #e2e8f0 !important;
    background-color: #f8fafc !important;
}

.form-control.bg-dark {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.form-control.bg-dark:focus {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

.card-header.bg-dark, .card-footer.bg-dark {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

.card-title.text-white, .modal-title.text-white, .card-header .text-white {
    color: #0f172a !important;
    font-weight: 600;
}

.text-white-50 {
    color: #64748b !important;
}

/* Settings & Nav tab formatting */
.nav-tabs .nav-link {
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: #2563eb;
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #1e40af !important;
    background: transparent !important;
    border-bottom: 2px solid #f97316 !important; /* Aksen orange */
    font-weight: 600;
}

/* Custom switch for toggles */
.custom-control-input:checked ~ .custom-control-label::before {
    border-color: #f97316 !important;
    background-color: #f97316 !important;
}
