// ========================================
// 🎯 MENU STYLES - Data Table
// Menu superior, controles e filtros
// ========================================

.table-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem;
  border-radius: 4px;
  margin-bottom: .5rem;
}

@media (max-width: 768px) {
  .table-menu {
    flex-direction: column;
    gap: .75rem;
    align-items: stretch;
    padding: .5rem;
  }
}

.menu-top-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

@media (max-width: 768px) {
  .menu-top-row {
    gap: .75rem;
  }
}

.menu-bottom-row {
  display: none;
}

@media (max-width: 768px) {
  .menu-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: .5rem;
  }
}

@media (min-width: 769px) {
  .table-menu {
    flex-direction: row;
  }
  
  .menu-top-row {
    flex: 1;
    justify-content: flex-start;
  }
  
  .menu-bottom-row {
    display: flex;
    align-items: center;
    gap: .5rem;
  }
}

.menu-left, .menu-right {
  display: flex;
  gap: .5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .menu-left, .menu-right {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: .5rem;
  }
}

.control-button {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .2s ease;
  font-size: .875rem;
  white-space: nowrap;
  position: relative;
}

.control-button:hover {
  background: var(--hover-bg);
}

.control-button.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.control-button.active:hover {
  background: var(--primary-dark);
}

.control-button i {
  font-size: .75rem;
}

// ✨ NOVO: Estilos para filtros avançados
.control-button .filter-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc3545;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

.control-button.advanced-filter-button {
  &.active {
    background: #28a745;
    border-color: #28a745;
    color: white;
  }

  &:hover:not(.active) {
    background: #e8f5e8;
    border-color: #28a745;
    color: #28a745;
  }
}

// ========================================
// 🔍 FILTROS E BUSCA
// ========================================

.filters-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface);
  margin-top: 0.2rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
  flex: 1;

  label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 0.25rem;
  }

  input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(241, 180, 13, 0.1);
  }

  input::placeholder {
    color: var(--text-secondary);
  }
}

.global-filter-container {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;

  input {
    width: 100%;
    padding: 8px 12px 8px 38px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s;

    &:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(241, 180, 13, 0.1);
    }

    &::placeholder {
      color: var(--text-secondary);
    }
  }

  i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 14px;
  }

  /* ✅ NOVO: Mobile otimizado - 80% da largura */
  @media (max-width: 768px) {
    flex: 1;
    min-width: 0;
    max-width: 80%;
    
    input {
      padding: 6px 10px 6px 32px;
      font-size: 14px;
    }
    
    i {
      left: 10px;
      font-size: 12px;
    }
  }
}

// ========================================
// 📱 RESPONSIVIDADE MOBILE - MENU
// ========================================

/* Responsividade específica para o seletor no menu superior */
@media (max-width: 768px) {
  .data-table-container, .table-menu {
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  .table-menu {
    padding: .375rem !important;
  }
  
  .menu-top-row {
    margin-bottom: .25rem;
    gap: .5rem;
  }
  
  .menu-top-row .global-filter-container {
    flex: 1;
    min-width: 160px;
    max-width: none;
  }
  
  .menu-top-row .global-filter-container input {
    height: 36px;
    padding: 8px 12px 8px 38px;
  }
  
  .menu-top-row .filter-toggle {
    min-width: 70px;
    flex-shrink: 0;
    height: 36px;
    padding: .4rem .6rem !important;
    font-size: .85rem !important;
  }
  
  .menu-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: .4rem;
  }
  
  .menu-bottom-row .menu-left {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
  }
  
  .menu-bottom-row .menu-right {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  
  .control-button {
    padding: .35rem .6rem !important;
    font-size: .8rem !important;
    gap: .3rem !important;
    min-width: auto;
    flex-shrink: 0 !important;
    white-space: nowrap;
    height: 36px;
  }
  
  .control-button i {
    font-size: .75rem !important;
  }
  
  .control-button.priority-1 {
    order: 1;
  }
  
  .control-button.priority-2 {
    order: 2;
  }
  
  .control-button.priority-3 {
    order: 3;
  }
  
  .control-button.normal-size {
    padding: .4rem .8rem !important;
    font-size: .85rem !important;
    min-width: 85px !important;
    flex-shrink: 0 !important;
    max-width: none !important;
    height: 36px;
  }
  
  .page-size-selector {
    font-size: .75rem;
    min-width: 50px;
  }
  
  .page-size-selector label {
    display: none;
  }
  
  .page-size-selector select {
    padding: .25rem .4rem;
    font-size: .75rem;
    min-width: 50px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .table-menu {
    padding: .25rem !important;
  }
  
  .menu-top-row {
    gap: .4rem;
    margin-bottom: .2rem;
  }
  
  .menu-top-row .global-filter-container {
    min-width: 130px;
  }
  
  .menu-top-row .global-filter-container input {
    padding: 5px 8px 5px 28px;
    font-size: 13px;
    height: 32px;
  }
  
  .menu-top-row .global-filter-container i {
    left: 8px;
    font-size: 11px;
  }
  
  .menu-top-row .filter-toggle {
    min-width: 60px;
    padding: .3rem .5rem !important;
    font-size: .8rem !important;
    height: 32px;
  }
  
  .menu-bottom-row {
    gap: .3rem;
  }
  
  .menu-bottom-row .menu-left, .menu-bottom-row .menu-right {
    gap: .3rem;
  }
  
  .control-button.priority-3 {
    display: none !important;
  }
  
  .control-button {
    padding: .3rem .5rem !important;
    font-size: .75rem !important;
    height: 32px;
  }
  
  .control-button.normal-size {
    padding: .35rem .6rem !important;
    font-size: .8rem !important;
    min-width: 75px !important;
    height: 32px;
  }
  
  .page-size-selector {
    min-width: 45px;
  }
  
  .page-size-selector select {
    min-width: 45px;
    padding: .2rem .3rem;
    height: 32px;
  }
}

@media (max-width: 360px) {
  .menu-top-row {
    flex-direction: column;
    gap: .25rem;
    margin-bottom: .15rem;
  }
  
  .menu-top-row .global-filter-container {
    width: 100%;
    min-width: 0;
  }
  
  .menu-top-row .global-filter-container input {
    padding: 4px 6px 4px 24px;
    font-size: 12px;
    height: 30px;
  }
  
  .menu-top-row .filter-toggle {
    width: 100%;
    justify-content: center;
    height: 30px;
  }
  
  .menu-bottom-row {
    justify-content: space-evenly;
  }
  
  .menu-bottom-row .menu-left, .menu-bottom-row .menu-right {
    flex: none;
    gap: .25rem;
  }
  
  .control-button {
    padding: .25rem .4rem !important;
    font-size: .7rem !important;
    height: 30px;
  }
  
  .control-button.normal-size {
    padding: .3rem .5rem !important;
    font-size: .75rem !important;
    min-width: 65px !important;
    height: 30px;
  }
}

/* ✅ NOVO: Controle de visibilidade desktop/mobile */
.desktop-text {
  @media (max-width: 768px) {
    display: none; /* ✅ Oculta texto desktop em mobile */
  }
}

.mobile-text {
  display: none; /* ✅ Oculta texto mobile em desktop */
  
  @media (max-width: 768px) {
    display: inline; /* ✅ Mostra texto mobile em mobile */
  }
} 