/* WarpChat Dashboard Styles */

:root {
    --primary-color: #e74266;
    --primary-hover: #cf3c5c;
    --secondary-color: #80BA5F;
    --dark-color: #101330;
    --sidebar-bg: #1a1d2e;
    --sidebar-text: #b8bcc8;
    --sidebar-active: #ffffff;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

/* Dashboard Layout */
.dashboard-container {
    min-height: 100vh;
    padding: 0;
}

.dashboard-sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    padding: 0;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.account-selector {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-selector .form-label {
    color: var(--sidebar-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.account-selector .form-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.account-selector .form-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(231, 66, 102, 0.25);
}

.account-selector .form-select option {
    background-color: var(--sidebar-bg);
    color: #fff;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: var(--sidebar-active);
    background: rgba(231, 66, 102, 0.15);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link svg {
    flex-shrink: 0;
}

.account-info {
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.account-info h6 {
    color: var(--sidebar-text);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.account-info p {
    color: #fff;
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.account-info p strong {
    color: var(--sidebar-text);
    font-weight: 500;
}

/* Main Content */
.dashboard-main {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 2rem;
}

.dashboard-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* No Account Selected */
.no-account-selected {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 3rem;
    text-align: center;
}

.no-account-selected h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.stat-card-success .stat-icon {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.stat-card-info .stat-icon {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
}

.stat-card-warning .stat-icon {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Dashboard Cards */
.dashboard-card {
    background: #fff;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.dashboard-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

.dashboard-card .card-header h5 {
    display: flex;
    align-items: center;
    color: var(--dark-color);
    font-weight: 600;
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

/* Config Cards */
.config-card .config-body {
    max-height: 400px;
    overflow-y: auto;
}

.config-card .accordion-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

.config-card .accordion-item:last-child {
    border-bottom: none;
}

.config-card .accordion-button {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
    box-shadow: none;
}

.config-card .accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background: transparent;
}

.config-card .accordion-button::after {
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
}

.config-card .accordion-body {
    padding: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.config-card .table {
    margin: 0;
}

.config-card .table th {
    border-top: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

.config-card .table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Action Cards */
.action-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    border: 1px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.action-card:hover {
    border-color: var(--primary-color);
}

.action-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.action-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.action-badges .badge {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.action-details p {
    color: #6c757d;
}

/* Chart Container */
#conversationsChart,
#messageDistributionChart {
    min-height: 250px;
}

/* Recent Conversations Table */
.dashboard-card .table-hover tbody tr:hover {
    background-color: rgba(231, 66, 102, 0.05);
}

.dashboard-card .table code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Scrollbar Styling */
.config-body::-webkit-scrollbar {
    width: 6px;
}

.config-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.config-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.config-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .dashboard-sidebar {
        position: relative;
        min-height: auto;
    }
    
    .dashboard-main {
        min-height: auto;
        padding: 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .dashboard-main {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.25rem;
    }
}

/* Conversation Modal */
#conversationModal .modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

#conversationModal .modal-title {
    margin-bottom: 0.25rem;
}

#conversationModal .modal-body {
    padding: 0;
    background: #f8f9fa;
}

#conversationModal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
}

/* Conversation Thread */
.conversation-thread {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.conversation-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
}

.conversation-message-user {
    align-self: flex-end;
    background: #198754;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.conversation-message-agent {
    align-self: flex-start;
    background: #fff;
    color: var(--dark-color);
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.message-role {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conversation-message-user .message-role {
    color: rgba(255, 255, 255, 0.85);
}

.conversation-message-agent .message-role {
    color: var(--primary-color);
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-content {
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content a {
    text-decoration: underline;
    word-break: break-all;
}

.conversation-message-user .message-content {
    color: #fff;
}

.conversation-message-user .message-content a {
    color: #fff;
}

.conversation-message-agent .message-content a {
    color: var(--primary-color);
}

/* Conversations table container */
.conversations-table-container {
    max-height: 500px;
    overflow-y: auto;
}

.conversations-table-container .table {
    margin-bottom: 0;
}

.conversations-table-container .table thead {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.conversations-table-container .table thead th {
    border-top: none;
}

/* View button styling */
.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
