/**
 * Admin statistics page styles
 *
 * @package BooChat_Connect
 */

.boochat-connect-statistics-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.boochat-connect-statistics-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.boochat-connect-statistics-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.boochat-connect-statistics-card {
    background: #fff;
    padding: 24px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-top: 0;
    border-radius: 0;
}

.boochat-connect-statistics-card h2 {
    margin-top: 0;
    font-size: 20px;
    color: #1d2327;
    font-weight: 600;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
}

.boochat-connect-statistics-card p {
    color: #646970;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.boochat-connect-statistics-section {
    margin: 30px 0;
}

.boochat-connect-statistics-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.boochat-connect-statistics-box {
    background: #f0f0f1;
    padding: 20px;
    border-radius: 0;
    min-width: 180px;
}

.boochat-connect-statistics-box-label {
    font-weight: bold;
    margin-bottom: 10px;
}

.boochat-connect-statistics-box-value {
    font-size: 32px;
    font-weight: bold;
    color: #2271b1;
}

.boochat-connect-statistics-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 20px 0;
}

.boochat-connect-statistics-filter-group {
    display: flex;
    flex-direction: column;
}

.boochat-connect-statistics-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.boochat-connect-statistics-filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    height: 38px;
    box-sizing: border-box;
}

.boochat-connect-statistics-filter-group .button {
    padding: 8px 20px;
    height: 38px;
    margin-top: 22px;
}

.boochat-connect-statistics-chart-container {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 0;
    margin-top: 15px;
}

.boochat-connect-statistics-chart {
    max-height: 400px;
}


/* Conversation History Styles */
.boochat-connect-conversations-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 20px 0;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f1;
}

.boochat-connect-filter-label {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    margin: 0;
}

.boochat-connect-filter-select {
    padding: 6px 24px 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3338;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%22%20stroke%3D%22%23646970%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 16px;
    appearance: none;
    cursor: pointer;
    min-width: 80px;
}

.boochat-connect-filter-select:hover {
    border-color: #2271b1;
}

.boochat-connect-filter-select:focus {
    border-color: #2271b1;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 1px #2271b1;
}

.boochat-connect-conversations-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    padding-right: 5px;
}

.boochat-connect-conversations-container::-webkit-scrollbar {
    width: 8px;
}

.boochat-connect-conversations-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.boochat-connect-conversations-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.boochat-connect-conversations-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.boochat-connect-conversations-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.boochat-connect-conversations-table thead th {
    text-align: left;
    padding: 12px;
    background: #f9f9f9;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f1;
    color: #1d2327;
}

.boochat-connect-conversations-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
}

.boochat-connect-session-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.boochat-connect-session-row:hover {
    background: #f0f0f1;
}

.boochat-connect-session-row.expanded {
    background: #f0f6fc;
}

.boochat-connect-messages-row {
    background: #f9f9f9;
}

.boochat-connect-expand-icon {
    display: inline-block;
    font-size: 12px;
    color: #646970;
    transition: transform 0.3s ease;
}

.boochat-connect-conversation-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.boochat-connect-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f1;
    flex-wrap: wrap;
    gap: 10px;
    background: #f9f9f9;
    border-radius: 0;
    transition: background-color 0.2s;
}

.boochat-connect-conversation-header:hover {
    background: #f0f0f1;
}

.boochat-connect-accordion-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    font-size: 10px;
    color: #646970;
}

.boochat-connect-conversation-session {
    font-size: 14px;
    color: #1d2327;
}

.boochat-connect-conversation-session strong {
    color: #646970;
}

.boochat-connect-conversation-meta {
    font-size: 12px;
    color: #646970;
}

.boochat-connect-conversation-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: #fff;
    border-radius: 0;
}

.boochat-connect-message {
    padding: 8px 10px;
    border-radius: 0;
    border-left: 3px solid;
}

.boochat-connect-message-user {
    background: #f0f6fc;
    border-left-color: #2271b1;
}

.boochat-connect-message-robot {
    background: #f0f0f1;
    border-left-color: #646970;
}

.boochat-connect-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
}

.boochat-connect-message-type {
    font-weight: 600;
    color: #1d2327;
}

.boochat-connect-message-time {
    color: #646970;
}

.boochat-connect-message-content {
    color: #1d2327;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
}

.boochat-connect-conversations-pagination {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 0;
}


.boochat-connect-statistics-message {
    margin: 15px 0;
    animation: slideDown 0.3s ease-out;
}

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

