/**
 * Estilos do Stock Add-on - DPS
 * 
 * CSS responsivo para o módulo de estoque de insumos.
 * Segue o padrão visual moderno do sistema DPS (dps-surface, dps-section-title).
 * 
 * Breakpoints:
 * - 1024px: Tablet grande
 * - 768px: Tablet
 * - 640px: Mobile
 * - 480px: Mobile pequeno
 * 
 * @package Desi_Pet_Shower_Stock
 * @since 1.1.0
 * @since 1.2.0 Refatorado para seguir padrão moderno do sistema.
 */

/* ==========================================================================
   1. Layout Principal e Header
   ========================================================================== */

#dps-section-estoque .dps-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

#dps-section-estoque .dps-section-title__icon {
    font-size: 28px;
}

#dps-section-estoque .dps-section-header__subtitle {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* ==========================================================================
   1b. Layout Empilhado (Cards verticais)
   ========================================================================== */

.dps-stock-stacked {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Surfaces/Cards específicos do estoque */
#dps-section-estoque .dps-surface {
    margin-bottom: 0;
}

#dps-section-estoque .dps-surface__title {
    margin-bottom: 8px;
}

#dps-section-estoque .dps-surface__description {
    margin-bottom: 16px;
}

/* ==========================================================================
   1c. Estatísticas Inline
   ========================================================================== */

#dps-section-estoque .dps-inline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

#dps-section-estoque .dps-inline-stats--panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

#dps-section-estoque .dps-inline-stats li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

#dps-section-estoque .dps-inline-stats__label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#dps-section-estoque .dps-inline-stats__label small {
    color: #6b7280;
    font-size: 12px;
}

#dps-section-estoque .dps-inline-stats__value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

#dps-section-estoque .dps-status-badge--scheduled {
    background: #eff6ff;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

#dps-section-estoque .dps-status-badge--paid {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

#dps-section-estoque .dps-status-badge--pending {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   1d. Ações
   ========================================================================== */

#dps-section-estoque .dps-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#dps-section-estoque .dps-actions--stacked {
    margin-top: 8px;
}

/* ==========================================================================
   2. Lista de Itens Críticos
   ========================================================================== */

.dps-stock-critical-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dps-stock-critical-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #fbbf24;
    border-radius: 8px;
}

.dps-stock-critical-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dps-stock-critical-item__info strong {
    color: #1f2937;
    font-size: 14px;
}

.dps-stock-critical-item__qty {
    color: #92400e;
    font-size: 13px;
}

/* ==========================================================================
   2b. Toolbar de Filtros
   ========================================================================== */

.dps-stock-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

/* ==========================================================================
   3. Cards de Resumo (deprecated)
   
   NOTA DE MIGRAÇÃO:
   - Estas classes foram substituídas por .dps-surface e .dps-inline-stats a partir da v1.2.0
   - Mantidas apenas para retrocompatibilidade com customizações de temas
   - Remoção prevista para v2.0.0
   - Use .dps-surface--info com .dps-inline-stats para novos desenvolvimentos
   ========================================================================== */

.dps-stock-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dps-stock-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.dps-stock-card--warning {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.dps-stock-card--success {
    border-left: 4px solid #10b981;
}

.dps-stock-card--info {
    border-left: 4px solid #0ea5e9;
}

.dps-stock-card__value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.dps-stock-card--warning .dps-stock-card__value {
    color: #f59e0b;
}

.dps-stock-card--success .dps-stock-card__value {
    color: #10b981;
}

.dps-stock-card__label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* ==========================================================================
   4. Alerta de Estoque Baixo
   ========================================================================== */

.dps-stock-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #92400e;
    font-weight: 600;
}

.dps-stock-alert .dashicons {
    flex-shrink: 0;
}

/* ==========================================================================
   5. Tabela de Estoque
   ========================================================================== */

.dps-stock-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.dps-stock-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.dps-stock-table thead {
    background: #f9fafb;
}

.dps-stock-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.dps-stock-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.dps-stock-table tbody tr:last-child td {
    border-bottom: none;
}

.dps-stock-table tbody tr:hover {
    background: #f9fafb;
}

.dps-stock-table tr.dps-stock-row--low {
    background: #fffbeb;
}

.dps-stock-table tr.dps-stock-row--low:hover {
    background: #fef3c7;
}

/* Status Badge */
.dps-stock-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.dps-stock-status--ok {
    background: #d1fae5;
    color: #065f46;
}

.dps-stock-status--low {
    background: #fef3c7;
    color: #92400e;
}

/* Quantidade baixa */
.dps-stock-qty--low {
    color: #dc2626;
    font-weight: 600;
}

/* ==========================================================================
   6. Estado Vazio
   ========================================================================== */

.dps-stock-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.dps-stock-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d1d5db;
    display: block;
    margin: 0 auto 12px;
}

.dps-stock-empty p {
    margin: 0 0 16px;
}

/* ==========================================================================
   7. Paginação
   ========================================================================== */

.dps-stock-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.dps-stock-pagination-info {
    color: #6b7280;
    font-size: 14px;
}

.dps-stock-pagination-buttons {
    display: flex;
    gap: 8px;
}

/* Data de alerta */
.dps-stock-alert-date {
    color: #6b7280;
    font-size: 11px;
}

/* ==========================================================================
   8. Responsividade
   ========================================================================== */

/* Tablet (768px) */
@media (max-width: 768px) {
    #dps-section-estoque .dps-section-title {
        font-size: 20px;
    }
    
    #dps-section-estoque .dps-inline-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #dps-section-estoque .dps-inline-stats__value {
        font-size: 24px;
    }
    
    .dps-stock-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dps-stock-card__value {
        font-size: 24px;
    }
    
    .dps-stock-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dps-stock-actions .button {
        justify-content: center;
    }
    
    /* Ocultar colunas menos importantes */
    .dps-stock-table th.dps-col-unit,
    .dps-stock-table td.dps-col-unit {
        display: none;
    }
    
    .dps-stock-critical-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .dps-stock-critical-item .button {
        width: 100%;
        text-align: center;
    }
}

/* Mobile (640px) - Tabela vira cards */
@media (max-width: 640px) {
    #dps-section-estoque .dps-inline-stats {
        grid-template-columns: 1fr;
    }
    
    #dps-section-estoque .dps-actions {
        flex-direction: column;
    }
    
    #dps-section-estoque .dps-actions .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .dps-stock-summary {
        grid-template-columns: 1fr;
    }
    
    .dps-stock-table-wrapper {
        border: none;
        overflow: visible;
    }
    
    .dps-stock-table {
        min-width: 0;
    }
    
    .dps-stock-table thead {
        display: none;
    }
    
    .dps-stock-table tbody {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .dps-stock-table tr {
        display: flex;
        flex-direction: column;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 16px;
        background: #ffffff;
    }
    
    .dps-stock-table tr.dps-stock-row--low {
        border-left: 4px solid #f59e0b;
    }
    
    .dps-stock-table td {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 8px;
        padding: 8px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .dps-stock-table td:last-child {
        border-bottom: none;
    }
    
    .dps-stock-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 12px;
        letter-spacing: 0.05em;
    }
    
    /* Mostrar colunas ocultas no mobile como dados nos cards */
    .dps-stock-table td.dps-col-unit {
        display: grid;
    }
    
    .dps-stock-table td.dps-col-actions {
        grid-template-columns: 1fr;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid #e5e7eb;
    }
    
    .dps-stock-table td.dps-col-actions::before {
        display: none;
    }
    
    .dps-stock-table td.dps-col-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    /* Alerta mais compacto */
    .dps-stock-alert {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .dps-stock-pagination {
        flex-direction: column;
        gap: 8px;
    }
}

/* Mobile pequeno (480px) */
@media (max-width: 480px) {
    #dps-section-estoque .dps-section-title {
        font-size: 18px;
        flex-wrap: wrap;
    }
    
    #dps-section-estoque .dps-section-title__icon {
        font-size: 22px;
    }
    
    #dps-section-estoque .dps-inline-stats__value {
        font-size: 22px;
    }
    
    .dps-stock-card {
        padding: 16px;
    }
    
    .dps-stock-card__value {
        font-size: 22px;
    }
    
    .dps-stock-table td {
        grid-template-columns: 100px 1fr;
        font-size: 13px;
    }
    
    .dps-stock-table td::before {
        font-size: 11px;
    }
    
    .dps-stock-pagination-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .dps-stock-pagination-buttons .button {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   9. Botões Modernos - Estilo Consistente
   ========================================================================== */

/* Botão principal para ações do Stock */
.dps-stock-btn-primary,
#dps-section-estoque .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
    text-shadow: none;
}

.dps-stock-btn-primary:hover,
#dps-section-estoque .button-primary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.dps-stock-btn-primary:active,
#dps-section-estoque .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.2);
}

/* Botão secundário - Estilo Moderno Elegante */
.dps-stock-btn-secondary,
#dps-section-estoque .button-secondary,
.dps-stock-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dps-stock-btn-secondary:hover,
#dps-section-estoque .button-secondary:hover,
.dps-stock-actions .button:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #334155;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.dps-stock-btn-secondary:active,
#dps-section-estoque .button-secondary:active,
.dps-stock-actions .button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Ícone dentro do botão */
.dps-stock-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
}
