/* ============================================
   UNIFIED BUTTONS & FILTERS SYSTEM
   Consistent spacing, padding, and design across all views
   ============================================ */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Button Spacing */
  --btn-padding-sm: 8px 12px;
  --btn-padding-md: 10px 16px;
  --btn-padding-lg: 12px 20px;
  
  /* Button Gaps */
  --btn-gap-sm: 8px;
  --btn-gap-md: 12px;
  --btn-gap-lg: 16px;
  
  /* Button Heights */
  --btn-height-sm: 32px;
  --btn-height-md: 40px;
  --btn-height-lg: 44px;
  
  /* Border Radius */
  --btn-radius: 24px;
  --btn-radius-sm: 20px;
  
  /* Transitions */
  --btn-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   VIEW HEADERS
   ============================================ */
.view-header {
  padding: 16px 24px !important;
  margin-bottom: 0 !important;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--btn-gap-md);
}

.view-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--btn-gap-md);
}

/* ============================================
   HEADER ACTION BUTTONS
   (Discover, Create Tender, Messages)
   ============================================ */
.discover-button-header {
  display: flex;
  align-items: center;
  gap: var(--btn-gap-sm);
  padding: var(--btn-padding-md);
  min-height: var(--btn-height-md);
  background: rgba(52, 199, 89, 0.1);
  border: none;
  border-radius: var(--btn-radius);
  color: var(--brokerly-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--btn-transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.discover-button-header:hover {
  background: rgba(52, 199, 89, 0.15);
  transform: translateY(-1px);
}

.discover-button-header:active {
  transform: translateY(0);
}

.discover-button-header:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.discover-button-header svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.discover-button-header span {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1;
}

/* ============================================
   PROFILE BUTTONS
   ============================================ */
.profile-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--btn-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-button:hover {
  transform: scale(1.05);
}

.profile-button:active {
  transform: scale(0.95);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 122, 255, 0.15);
}

.profile-initial {
  font-size: 17px;
  font-weight: 600;
  color: var(--brokerly-primary);
}

/* ============================================
   FILTER SECTIONS
   ============================================ */
.filters-section {
  padding: 0 24px 16px 24px;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.filters-section::-webkit-scrollbar {
  display: none;
}

.filters-section {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.time-filters,
.tender-filters {
  display: flex;
  gap: var(--btn-gap-md);
  padding: 0;
  min-width: min-content;
}

/* ============================================
   FILTER BUTTONS
   ============================================ */
.filter-button,
.filter-pill {
  flex-shrink: 0;
  padding: var(--btn-padding-md);
  min-height: var(--btn-height-md);
  background: var(--modern-card-background);
  color: var(--brokerly-text-primary);
  border: none;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--btn-transition);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  line-height: 1.2;
}

.filter-button:hover,
.filter-pill:hover {
  background: var(--brokerly-primary-light);
  color: var(--brokerly-primary);
  transform: translateY(-1px);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-button.active,
.filter-pill.active {
  background: var(--brokerly-primary);
  color: white;
  box-shadow: 
    0 2px 8px rgba(0, 122, 255, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-button.active:hover,
.filter-pill.active:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 3px 10px rgba(0, 122, 255, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.1);
}

.filter-button:active,
.filter-pill:active {
  transform: translateY(0);
}

/* ============================================
   PERIOD BUTTONS (Money View)
   Note: Main styles are in components.css
   These are just fallback/supplementary styles
   ============================================ */

/* ============================================
   ACTION FILTERS (Actions View)
   ============================================ */
.action-filters {
  display: flex;
  gap: var(--btn-gap-md);
  padding: 0;
}

.action-filter {
  flex-shrink: 0;
  padding: var(--btn-padding-md);
  min-height: var(--btn-height-md);
  background: var(--modern-card-background);
  color: var(--brokerly-text-primary);
  border: none;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--btn-transition);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  line-height: 1.2;
}

.action-filter:hover {
  background: var(--brokerly-primary-light);
  color: var(--brokerly-primary);
  transform: translateY(-1px);
}

.action-filter.active {
  background: var(--brokerly-primary);
  color: white;
  box-shadow: 
    0 2px 8px rgba(0, 122, 255, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.action-filter:active {
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Mobile */
@media (max-width: 767px) {
  .view-header {
    padding: 12px 16px !important;
  }
  
  .filters-section {
    padding: 0 16px 12px 16px;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .discover-button-header {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
  }
  
  .discover-button-header svg {
    width: 14px;
    height: 14px;
  }
  
  .filter-button,
  .filter-pill,
  .action-filter {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
  }
  
  /* period-button styles are in components.css */
  
  .time-filters,
  .tender-filters,
  .action-filters {
    gap: 8px;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .view-header {
    padding: 14px 20px !important;
  }
  
  .filters-section {
    padding: 0 20px 14px 20px;
  }
}

/* Desktop and larger */
@media (min-width: 1024px) {
  .view-header {
    padding: 16px 24px !important;
  }
  
  .filters-section {
    padding: 0 24px 16px 24px;
  }
  
  /* Subtle hover lift on desktop */
  .filter-button:hover,
  .filter-pill:hover,
  .action-filter:hover {
    box-shadow: 
      0 3px 8px rgba(0, 0, 0, 0.08),
      0 1px 4px rgba(0, 0, 0, 0.1);
  }
  
  /* period-button hover styles are in components.css */
}

/* ============================================
   TOUCH DEVICE ADJUSTMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  .filter-button,
  .filter-pill,
  .action-filter,
  .discover-button-header {
    min-height: 44px; /* iOS touch target */
    padding: 12px 16px;
  }
  
  /* period-button touch styles are in components.css */
  
  .profile-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .profile-avatar {
    width: 44px;
    height: 44px;
  }
  
  /* Remove transform on touch to avoid jank */
  .filter-button:hover,
  .filter-pill:hover,
  .action-filter:hover,
  .discover-button-header:hover {
    transform: none;
  }
  
  /* period-button touch hover is in components.css */
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
.filter-button:focus-visible,
.filter-pill:focus-visible,
.action-filter:focus-visible,
.discover-button-header:focus-visible,
.profile-button:focus-visible {
  outline: 2px solid var(--brokerly-primary);
  outline-offset: 2px;
}

/* period-button focus styles are in components.css */
.period-button:focus-visible {
  outline: 2px solid var(--brokerly-primary);
  outline-offset: 2px;
}

/* ============================================
   DISABLED STATES
   ============================================ */
.filter-button:disabled,
.filter-pill:disabled,
.action-filter:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.filter-button:disabled:hover,
.filter-pill:disabled:hover,
.action-filter:disabled:hover {
  background: var(--modern-card-background);
  color: var(--brokerly-text-primary);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

/* period-button disabled styles are in components.css */
.period-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.period-button:disabled:hover {
  background: var(--modern-card-background);
  color: var(--brokerly-text-primary);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.06);
}


