/**
 * Quick Cart Analytics — Admin Styles
 *
 * Styles for the Analytics tab inside the Quick Cart settings page.
 * Follows the same design tokens and component patterns already established
 * in admin.css (colors, spacing, border-radius, form-table layout).
 *
 * @package Quick_Cart
 * @since   1.1.0
 */

/* ==========================================================================
   Date Range Filter
   ========================================================================== */

.quickcart-analytics-date-filter {
    margin-bottom: 24px;
}

.quickcart-analytics-date-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quickcart-analytics-date-row label {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.quickcart-analytics-date-row input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quickcart-analytics-date-row input[type="date"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* ==========================================================================
   Summary Cards
   ========================================================================== */

.quickcart-analytics-cards {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
    gap: 16px;
    margin-top: 20px;
}

.quickcart-analytics-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.quickcart-analytics-card:hover {
    box-shadow: 0 4px 12px rgba( 34, 113, 177, 0.1 );
    transform: translateY( -2px );
}

/* Icon circle */
.quickcart-analytics-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f0f6fc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quickcart-analytics-card-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2271b1;
}

/* Card text */
.quickcart-analytics-card-body {
    min-width: 0; /* Allows text to truncate if needed. */
}

.quickcart-analytics-card-count {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.quickcart-analytics-card-label {
    font-size: 13px;
    color: #646970;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Daily Breakdown Table
   ========================================================================== */

.quickcart-analytics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.quickcart-analytics-table thead {
    background: #f6f7f7;
}

.quickcart-analytics-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #dcdcde;
}

.quickcart-analytics-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f1;
    color: #1d2327;
    font-size: 13px;
}

/* First column (date) gets a slightly bolder weight for scannability. */
.quickcart-analytics-table td:first-child {
    font-weight: 600;
    color: #2271b1;
}

/* Numeric columns are right-aligned for easier scanning. */
.quickcart-analytics-table th:not( :first-child ),
.quickcart-analytics-table td:not( :first-child ) {
    text-align: right;
}

/* Alternate row shading for readability on long tables. */
.quickcart-analytics-table tbody tr:nth-child( even ) {
    background: #fafbfc;
}

.quickcart-analytics-table tbody tr:hover {
    background: #f0f6fc;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media ( max-width: 782px ) {
    .quickcart-analytics-cards {
        grid-template-columns: 1fr 1fr;
    }

    .quickcart-analytics-date-row {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Make the table horizontally scrollable on very small screens. */
    .quickcart-section {
        overflow-x: auto;
    }

    .quickcart-analytics-table {
        min-width: 500px;
    }
}

@media ( max-width: 480px ) {
    .quickcart-analytics-cards {
        grid-template-columns: 1fr;
    }
}
