/* ============================================
   Entity List - Shared Styles
   Modern and consistent styles for all entity list pages
   ============================================ */

// ============================================
// Container Principal
// ============================================
.page-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; // 24px - gap entre page-header, filters-panel e table-card
  padding: 0;
}

// ============================================
// Page Header
// ============================================
.page-header {
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    
    // Left side - Icon + Text
    .header-left {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      flex: 1;
      
      .header-icon {
        font-size: 2.5rem;
        color: var(--p-primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
      }
      
      .header-text {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        
        .page-title {
          margin: 0;
          font-size: 1.75rem;
          font-weight: 700;
          line-height: 1.2;
          color: var(--p-text-color);
          letter-spacing: -0.02em;
        }
        
        .page-subtitle {
          margin: 0;
          font-size: 0.875rem;
          font-weight: 400;
          line-height: 1.4;
          color: var(--p-text-muted-color);
        }
      }
    }
    
    // Right side - Actions
    .header-actions {
      display: flex;
      gap: 0.75rem;
      align-items: center;
    }
  }
}

// ============================================
// Filters Panel
// ============================================
.filters-panel {
  // Custom Header
  .p-panel-header {
    padding: 1rem 1.25rem;
    background: var(--p-card-background);
    border-bottom: 1px solid var(--p-content-border-color);
    
    .panel-header-content {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      font-size: 1rem;
      font-weight: 600;
      color: var(--p-text-color);
      
      i {
        font-size: 1.125rem;
        color: var(--p-primary-color);
      }
      
      .panel-title {
        font-size: 1rem;
        font-weight: 600;
      }
    }
    
    .p-panel-header-icon {
      color: var(--p-text-muted-color);
      transition: all 0.2s ease;
      
      &:hover {
        color: var(--p-primary-color);
      }
    }
  }
  
  // Content
  .p-panel-content {
    padding: 1.5rem;
    background: var(--p-card-background);
  }
  
  // Custom Footer
  .p-panel-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--p-content-border-color);
    
    .panel-footer-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 0.75rem;
    }
  }
}

// ============================================
// Table Card
// ============================================
.table-card {
  // Remove padding do body do card
  .p-card-body {
    padding: 0;
  }
  
  // Custom Header
  .p-card-header {
    padding: 1rem 1.25rem;
    background: var(--p-card-background);
    border-bottom: 1px solid var(--p-content-border-color);
    
    .card-header-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1.5rem;
      
      // Left side - Info
      .header-info {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        flex: 1;
        
        .results-count {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          font-size: 0.875rem;
          font-weight: 500;
          color: var(--p-text-color);
          
          i {
            font-size: 1rem;
            color: var(--p-primary-color);
          }
        }
        
        .selected-count {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          padding: 0.5rem 0.875rem;
          background: var(--p-primary-color);
          color: var(--p-primary-contrast-color);
          border-radius: var(--p-content-border-radius);
          font-size: 0.875rem;
          font-weight: 600;
          animation: slideIn 0.3s ease;
          
          i {
            font-size: 0.875rem;
          }
          
          .clear-selection-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.125rem;
            height: 1.125rem;
            padding: 0;
            margin-left: 0.25rem;
            background: var(--p-primary-600);
            border: none;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            
            i {
              font-size: 0.625rem;
              color: var(--p-primary-contrast-color);
            }
            
            &:hover {
              background: var(--p-primary-700);
              transform: scale(1.1);
            }
          }
        }
      }
      
      // Right side - Actions
      .header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
      }
    }
  }
}

// ============================================
// Animations
// ============================================
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

// ============================================
// Empty State
// ============================================
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 1.5rem;
  
  .empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    background: var(--p-surface-100);
    border-radius: 50%;
    animation: fadeInScale 0.5s ease;
    
    i {
      font-size: 2.5rem;
      color: var(--p-text-muted-color);
    }
  }
  
  .empty-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 28rem;
    
    .empty-title {
      margin: 0;
      font-size: 1.25rem;
      font-weight: 600;
      color: var(--p-text-color);
      line-height: 1.4;
    }
    
    .empty-description {
      margin: 0;
      font-size: 0.9375rem;
      font-weight: 400;
      color: var(--p-text-muted-color);
      line-height: 1.6;
    }
  }
}

// ============================================
// Responsive Design
// ============================================
@media (max-width: 768px) {
  // Page Header - Mobile
  .page-header {
    .header-content {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
      
      .header-left {
        width: 100%;
        
        .header-icon {
          font-size: 2rem;
        }
        
        .header-text {
          .page-title {
            font-size: 1.5rem;
          }
          
          .page-subtitle {
            font-size: 0.8125rem;
          }
        }
      }
      
      .header-actions {
        width: 100%;
        
        .p-button {
          flex: 1;
        }
      }
    }
  }
  
  // Filters Panel - Mobile
  .filters-panel {
    .p-panel-footer {
      .panel-footer-actions {
        flex-direction: column-reverse;
        
        .p-button {
          width: 100%;
        }
      }
    }
  }
  
  // Table Card - Mobile
  .table-card {
    .p-card-header {
      .card-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        
        .header-info {
          width: 100%;
          flex-direction: column;
          align-items: flex-start;
          gap: 0.75rem;
        }
        
        .header-actions {
          width: 100%;
          
          .p-button {
            flex: 1;
          }
        }
      }
    }
  }
}
