/**
 * Estilos Frontend - Widget Elementor CRM Clientes
 * 
 * @author Dante Testa
 * @link https://dantetesta.com.br
 * @since 1.1.0
 * @modified 2026-02-05 08:52:00
 */

/* Container Principal */
.crm-clientes-wrapper {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.crm-clientes-wrapper * {
    box-sizing: border-box;
}

/* Layout com Sidebar */
.crm-layout-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.crm-layout-sidebar .crm-content-area {
    flex: 1;
    min-width: 0;
}

.crm-layout-sidebar .crm-filters-sidebar {
    flex-shrink: 0;
}

.crm-sidebar-left {
    flex-direction: row;
}

.crm-sidebar-right {
    flex-direction: row-reverse;
}

/* Grid de Clientes */
.crm-clientes-grid {
    display: grid;
    gap: 20px;
}

.crm-clientes-grid.columns-1 {
    grid-template-columns: 1fr;
}

.crm-clientes-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.crm-clientes-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.crm-clientes-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Card do Cliente */
.crm-cliente-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.crm-cliente-nome {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 12px;
    line-height: 1.3;
}

.crm-cliente-email,
.crm-cliente-telefone {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.crm-label {
    color: #666666;
    font-weight: 500;
}

.crm-value {
    color: #333333;
}

.crm-cliente-status {
    margin-top: 12px;
}

.crm-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-status-badge.status-ativo {
    background-color: #4CAF50;
    color: #ffffff;
}

.crm-status-badge.status-inativo {
    background-color: #f44336;
    color: #ffffff;
}

.crm-cliente-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.crm-categoria-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Filtros */
.crm-filters-container {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.crm-filters-topbar {
    margin-bottom: 30px;
}

.crm-filters-topbar .crm-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
}

.crm-filters-topbar .crm-filter-group {
    flex: 1;
    min-width: 180px;
}

.crm-filters-topbar .crm-filter-actions {
    display: flex;
    gap: 10px;
}

.crm-filters-sidebar .crm-filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.crm-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.crm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #666666;
}

.crm-filter-group input,
.crm-filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.crm-filter-group input:focus,
.crm-filter-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.crm-filter-group input::placeholder {
    color: #999999;
}

.crm-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.crm-filter-submit,
.crm-filter-clear {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.crm-filter-submit {
    background-color: #2196F3;
    color: #ffffff;
}

.crm-filter-submit:hover {
    background-color: #1976D2;
}

.crm-filter-clear {
    background-color: #e0e0e0;
    color: #666666;
}

.crm-filter-clear:hover {
    background-color: #bdbdbd;
}

/* Paginação */
.crm-pagination-wrapper {
    margin-top: 30px;
}

.crm-pagination-wrapper.pagination-left {
    text-align: left;
}

.crm-pagination-wrapper.pagination-center {
    text-align: center;
}

.crm-pagination-wrapper.pagination-right {
    text-align: right;
}

.crm-pagination {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.crm-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.crm-page-link:hover:not(.crm-page-active) {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #2196F3;
}

.crm-page-link.crm-page-active {
    background-color: #2196F3;
    border-color: #2196F3;
    color: #ffffff;
}

.crm-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    color: #666666;
}

.crm-prev,
.crm-next {
    padding: 8px 16px;
}

/* Sem Resultados */
.crm-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666666;
    font-size: 16px;
}

/* Loading */
.crm-loading {
    position: relative;
    pointer-events: none;
}

.crm-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.crm-loading .crm-clientes-grid::before {
    content: 'Carregando...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #666666;
    z-index: 11;
}

/* Responsivo */
@media (max-width: 1024px) {
    .crm-clientes-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .crm-clientes-grid.columns-3,
    .crm-clientes-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .crm-layout-sidebar {
        flex-direction: column;
    }
    
    .crm-layout-sidebar .crm-filters-sidebar {
        width: 100% !important;
        order: -1;
    }
    
    .crm-filters-topbar .crm-filter-form {
        flex-direction: column;
    }
    
    .crm-filters-topbar .crm-filter-group {
        min-width: 100%;
    }
    
    .crm-filter-actions {
        width: 100%;
    }
    
    .crm-filter-submit,
    .crm-filter-clear {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .crm-clientes-grid.columns-2,
    .crm-clientes-grid.columns-3,
    .crm-clientes-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .crm-cliente-card {
        padding: 15px;
    }
    
    .crm-cliente-nome {
        font-size: 16px;
    }
    
    .crm-pagination {
        justify-content: center;
    }
    
    .crm-prev,
    .crm-next {
        padding: 8px 10px;
        font-size: 12px;
    }
}
