/* ===== PREMIUM TOOLBAR ===== */
.premium-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.history-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: all 0.2s;
  font-family: inherit;
  flex: 1;
  justify-content: center;
}

.history-toggle:hover {
  background: var(--purple-50);
  border-color: var(--purple);
  color: var(--purple);
}

.history-badge {
  background: var(--purple);
  color: var(--white);
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ===== HISTORY PANEL ===== */
.history-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.history-panel.visible {
  max-height: 500px;
  overflow-y: auto;
}

.history-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.history-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
}

.history-clear-btn {
  font-size: 0.75rem;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-family: inherit;
  border-radius: 4px;
  transition: all 0.2s;
}

.history-clear-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

.history-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.2s;
  gap: 0.75rem;
}

.history-item:hover {
  background: var(--purple-50);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item-main {
  flex: 1;
  min-width: 0;
}

.history-obal {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-details {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.history-item-price {
  text-align: right;
  flex-shrink: 0;
}

.history-total {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--purple);
  display: block;
}

.history-date {
  font-size: 0.7rem;
  color: var(--gray-400);
}

.history-delete {
  background: none;
  border: none;
  color: var(--gray-300);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.2s;
}

.history-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* ===== COMPARISON BAR ===== */
.comparison-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 2px solid var(--purple);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  padding: 0.75rem 1rem;
  display: none;
  z-index: 1500;
  align-items: center;
  gap: 0.75rem;
}

.comparison-bar.visible {
  display: flex;
}

.compare-chips {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.compare-chip {
  background: var(--purple-50);
  border: 1px solid var(--purple);
  color: var(--purple);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.compare-chip button {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.compare-chip button:hover {
  color: #ef4444;
}

.compare-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.compare-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}

.compare-btn-primary {
  background: var(--purple);
  color: var(--white);
}

.compare-btn-primary:hover {
  background: var(--purple-dark);
}

.compare-btn-clear {
  background: var(--gray-100);
  color: var(--gray-500);
}

.compare-btn-clear:hover {
  background: var(--gray-200);
}

/* ===== COMPARISON MODAL ===== */
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 400px;
}

.compare-table th {
  background: var(--purple);
  color: var(--white);
  padding: 0.75rem 0.6rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.compare-table th:first-child {
  text-align: left;
  background: var(--gray-700);
}

.compare-table th.cheapest {
  background: var(--green);
}

.compare-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--gray-200);
  text-align: center;
  font-size: 0.8rem;
}

.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.compare-table tbody tr:hover {
  background: var(--gray-50);
}

.compare-table tr.highlight-row {
  background: var(--purple-50);
}

.compare-table tr.highlight-row:hover {
  background: rgba(82,37,131,0.12);
}

.compare-table tr.highlight-row td {
  font-weight: 700;
}

.cheapest-val {
  color: var(--green-dark) !important;
  font-weight: 700 !important;
}

.cheapest-badge {
  display: inline-block;
  background: var(--white);
  color: var(--green-dark);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 0.15rem;
}

/* ===== COST BREAKDOWN ===== */
.cost-breakdown {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: none;
}

.breakdown-title {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 0.6rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.breakdown-label {
  font-size: 0.72rem;
  width: 55px;
  opacity: 0.8;
  flex-shrink: 0;
}

.breakdown-bar-wrap {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 3px;
}

.breakdown-value {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

.breakdown-value small {
  opacity: 0.7;
  font-weight: 400;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: var(--white);
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== EXTRA RESULT BUTTONS ===== */
.result-extra-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.result-extra-actions .btn-sm {
  flex: 1;
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.result-extra-actions .btn-sm:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.35);
}

/* Body padding when comparison bar is visible */
body.has-comparison-bar {
  padding-bottom: 70px;
}
