/* ==========================================================================
   Statistics & Calls Filter Panel - Modern Responsive Component
   ========================================================================== */

.stats-filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
    padding: 16px 20px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary, #1e293b);
}

/* Individual Filter Item Group */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Field Label */
.filter-group-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    text-transform: none;
    letter-spacing: 0.2px;
    user-select: none;
}

/* Select / Dropdown Wrapper */
.filter-select-wrapper {
    position: relative;
    width: 260px;
    max-width: 100%;
}

.filter-select {
    width: 100%;
    height: 38px;
    padding: 6px 36px 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    background-color: var(--bg-color, #ffffff);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.filter-select:hover {
    border-color: #94a3b8;
}

.filter-select:focus, .filter-select.active {
    border-color: #0d9488 !important; /* Teal green accent */
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.filter-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.filter-select-wrapper:focus-within .filter-select-arrow {
    color: #0d9488;
}

/* Date & Time Input Inline Row */
.filter-datetime-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input Icon Wrapper */
.filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input-icon {
    position: absolute;
    left: 10px;
    color: #64748b;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.filter-date-input,
.filter-time-input {
    height: 38px;
    padding: 6px 10px 6px 32px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    background-color: var(--bg-color, #ffffff);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.filter-date-input {
    width: 145px;
}

.filter-time-input {
    width: 125px;
    padding-left: 30px;
    padding-right: 6px;
}

.filter-date-input:hover,
.filter-time-input:hover {
    border-color: #94a3b8;
}

.filter-date-input:focus,
.filter-time-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Preset Buttons Group */
.filter-preset-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-dark, #f8fafc);
    padding: 3px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
}

.filter-btn-preset {
    height: 32px;
    padding: 0 14px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary, #475569);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.filter-btn-preset:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

.filter-btn-preset.active {
    background: #0d9488; /* Active Teal */
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.25);
}

/* Apply / Refresh Action Button */
.filter-action-btn {
    height: 38px;
    padding: 0 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #0d9488;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
}

.filter-action-btn:hover {
    background-color: #0f766e;
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.3);
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .stats-filter-panel {
        gap: 14px 16px;
        padding: 14px 16px;
    }
    .filter-select-wrapper {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .stats-filter-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-select-wrapper {
        width: 100%;
    }
    .filter-datetime-row {
        width: 100%;
    }
    .filter-date-input {
        flex: 1;
        width: auto;
    }
    .filter-time-input {
        width: 110px;
    }
    .filter-preset-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .filter-btn-preset {
        flex: 1;
        text-align: center;
    }
}
