/* /assets/css/features/segment_filter_style.css */
/* Modern Segment Filter Styling - Consistent across all dashboards */

/* Filter wrapper for tooltip support */
.filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

/* Modern Dropdown Styling */
.segment-filter,
.dashboard-date-filter {
    min-width: 150px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--myceo-text-primary);
    background-color: var(--myceo-surface-1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* HOVER STATE - Subtle highlight (matches Revenue dashboard) */
.segment-filter:hover,
.dashboard-date-filter:hover {
    border-color: var(--myceo-accent-blue);
    box-shadow: 0 2px 4px rgba(10, 36, 87, 0.1);
}

/* FOCUS STATE */
.segment-filter:focus,
.dashboard-date-filter:focus {
    outline: none;
    border-color: var(--myceo-accent-blue);
    box-shadow: 0 0 0 3px rgba(10, 36, 87, 0.1);
}

/* Adjust segment filter for longer text */
.segment-filter {
    min-width: 200px;
}

/* Disabled state */
.segment-filter:disabled,
.dashboard-date-filter:disabled {
    opacity: 0.5;
    cursor:not-allowed;
    background-color: var(--myceo-surface-1);
}

/* Container for retention graph controls */
.retention-graph-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
  padding: 5px 0;
}

/* Year range controls */
.year-range-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Year select container */
.year-select-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Year select dropdown with modern styling */
.year-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--myceo-text-primary);
  background-color: var(--myceo-surface-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 90px;
}

.year-select:hover {
  border-color: var(--myceo-accent-blue);
  box-shadow: 0 2px 4px rgba(10, 36, 87, 0.1);
}

.year-select:focus {
  outline: none;
  border-color: var(--myceo-accent-blue);
  box-shadow: 0 0 0 3px rgba(10, 36, 87, 0.1);
}

/* Segment filter container */
.segment-filter-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Segment options container */
.segment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Individual segment option with modern pill styling */
.segment-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  background-color: var(--myceo-surface-1);
  border: 1.5px solid var(--myceo-border-mid);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--myceo-text-secondary);
}

.segment-option:hover {
  background-color: var(--myceo-surface-1);
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Checkbox styling */
.segment-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* Segment color indicators */
.segment-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}

/* Active segment option */
.segment-option.active {
  background-color: var(--myceo-surface-2);
  border-color: var(--myceo-accent-blue);
  color: var(--myceo-text-primary);
  font-weight: 600;
}

.segment-option.active:hover {
  background-color: #0d2f70;
  border-color: #0d2f70;
}

/* Color coding for different segments */
.segment-option input[value="all"] + .segment-color {
  background-color: var(--myceo-accent-blue); /* Gold */
}

.segment-option input[value="new"] + .segment-color {
  background-color: var(--myceo-accent-blue);   /* was #3768be, upstream brand */
}

.segment-option input[value="recurring"] + .segment-color {
  background-color: #2e8540; /* Green */
}

.segment-option input[value="vip"] + .segment-color {
  background-color: #762ca7; /* Purple */
}

.segment-option input[value="lapsed"] + .segment-color {
  background-color: #d83b01; /* Red-orange */
}

/* Info tooltip positioning fix for segment filters */
.segment-filter-wrapper .info-icon {
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

/* Ensure dropdowns are above other elements */
.segment-filter-wrapper,
.year-select-container {
  z-index: 5;
  position: relative;
}

/* Animation for focus state */
.segment-filter:focus,
.dashboard-date-filter:focus,
.year-select:focus {
  animation:focus-pulse 0.2s ease-out;
}

@keyframes focus-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(10, 36, 87, 0.1);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(10, 36, 87, 0.1);
  }
}

/* Smooth transitions for all interactive elements */
.segment-filter,
.dashboard-date-filter,
.year-select,
.segment-option {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Additional modern select styling for consistency */
select.segment-filter option,
select.dashboard-date-filter option,
select.year-select option {
  padding: 8px;
  background-color: var(--myceo-surface-1);
  color: var(--myceo-text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .retention-graph-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .year-range-controls, 
  .segment-filter-container {
    width: 100%;
  }
  
  .segment-options {
    margin-top: 5px;
    width: 100%;
  }
  
  .segment-filter,
  .dashboard-date-filter,
  .year-select {
    width: 100%;
    min-width: unset;
  }
  
  .segment-option {
    flex: 1 1 calc(50% - 5px);
    min-width: 120px;
    justify-content: center;
  }
  
  .segment-filter-wrapper {
    width: 100%;
  }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 992px) {
  .segment-filter {
    min-width: 160px;
  }
  
  .year-select {
    min-width: 80px;
  }
}
/* ── Mobile (VERITAS-102 phase 2): filters go full-width so they stay
   tappable instead of shrinking side by side ─────────────────────── */
@media (max-width: 520px) {
    .filter-wrapper { flex: 1 1 100%; }
    .segment-filter,
    .dashboard-date-filter { width: 100%; min-width: 0; box-sizing: border-box; }
}
