/* 
 * Custom Premium Design Tokens & Overrides - Chat da Nuvem (Estilo Premium)
 */

:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #0053ff;
    --primary-gradient: linear-gradient(135deg, #0053ff 0%, #3b82f6 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --font-family: 'Outfit', sans-serif;
    --sidebar-width: 260px;
    --active-nav-bg: rgba(0, 83, 255, 0.08);
    --active-nav-color: #0053ff;
    --chat-inbound-bg: #e2e8f0;
    --chat-inbound-text: #0f172a;
    --chat-outbound-bg: #0053ff;
    --chat-outbound-text: #ffffff;
}

.dark-mode {
    --bg-color: #0b0f19;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #090d16;
    --card-bg: #131a26;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --active-nav-bg: rgba(59, 130, 246, 0.15);
    --active-nav-color: #60a5fa;
    --chat-inbound-bg: #1e293b;
    --chat-inbound-text: #f8fafc;
    --chat-outbound-bg: #3b82f6;
    --chat-outbound-text: #ffffff;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glassmorphism/Premium containers */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

/* Custom Navigation */
.navbar-custom {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding-top: 76px;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 12px 20px;
    border-radius: 12px;
    margin: 4px 16px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: var(--active-nav-bg);
    color: var(--active-nav-color);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding-top: 96px;
    padding-right: 28px;
    padding-left: 28px;
    min-height: calc(100vh - 96px);
}

/* Chat Layout - Three Columns */
.chat-container {
    height: calc(100vh - 126px);
    display: flex;
    overflow: hidden;
    gap: 20px;
}

.chat-col-1 {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-col-2 {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-col-3 {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Conversations List */
.conversation-list {
    overflow-y: auto;
    flex: 1;
}

.conversation-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    margin: 6px 12px;
}

.conversation-item:hover {
    background: rgba(0, 83, 255, 0.04);
}

.dark-mode .conversation-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.conversation-item.active {
    background: var(--active-nav-bg);
    border-left: 4px solid var(--primary-color);
    color: var(--active-nav-color);
}

/* Messages area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .messages-area {
    background: rgba(0, 0, 0, 0.2);
}

.message-bubble {
    max-width: 70%;
    margin-bottom: 16px;
    padding: 12px 18px;
    border-radius: 16px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.message-inbound {
    background-color: var(--chat-inbound-bg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--chat-inbound-text);
}

.message-outbound {
    background: var(--primary-gradient);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: var(--chat-outbound-text);
}

.message-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

.message-outbound .message-meta {
    color: rgba(255, 255, 255, 0.7);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Interactive elements */
.btn-premium {
    background: var(--primary-gradient);
    border: none;
    color: white !important;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 83, 255, 0.3);
}

.btn-premium:active {
    transform: translateY(0);
}

/* Forms override */
.form-control, .form-select {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 83, 255, 0.15);
}

/* Simulator Phone mock */
.simulator-phone {
    max-width: 380px;
    height: 680px;
    border: 12px solid #1e293b;
    border-radius: 36px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.dark-mode .simulator-phone {
    border-color: #334155;
}

.phone-header {
    background: #1e293b;
    padding: 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Tables style */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(0, 83, 255, 0.02);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.01);
    color: var(--text-color);
    border-color: var(--border-color);
}

.dark-mode .table {
    --bs-table-hover-bg: rgba(255, 255, 255, 0.02);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.01);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
}

/* Cards KPI styling */
.card-kpi {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Dark mode toggle switch button */
.theme-switch-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.theme-switch-btn:hover {
    color: var(--primary-color);
}
