/* UI/UX Improvements for Auction Radar v30 */

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --info-color: #2980b9;
  --light-bg: #f5f0e8;
  --border-color: #bdc3c7;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --transition-duration: 0.3s;
}

/* ========================================================================
   PROGRESS INDICATOR
   ======================================================================== */

.progress-container {
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--info-color));
  width: 0%;
  transition: width var(--transition-duration) ease;
  border-radius: 4px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  counter-reset: step;
}

.step-indicator li {
  list-style: none;
  flex: 1;
  position: relative;
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
  counter-increment: step;
}

.step-indicator li::before {
  content: counter(step);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: #ecf0f1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-secondary);
}

.step-indicator li.active::before {
  background: var(--secondary-color);
  color: white;
}

.step-indicator li.completed::before {
  background: var(--success-color);
  color: white;
  content: "✓";
}

.step-indicator li.active,
.step-indicator li.completed {
  color: var(--text-primary);
}

.step-indicator li::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 14px;
  width: calc(100% - 30px);
  height: 2px;
  background: #ecf0f1;
  transform: translateX(-50%);
  z-index: -1;
}

.step-indicator li:last-child::after {
  display: none;
}

.step-indicator li.completed::after {
  background: var(--success-color);
}

/* ========================================================================
   RESULT VISUALIZATION
   ======================================================================== */

.result-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.result-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-duration), box-shadow var(--transition-duration);
  border-left: 4px solid var(--secondary-color);
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.result-card.high-risk {
  border-left-color: var(--danger-color);
}

.result-card.medium-risk {
  border-left-color: var(--warning-color);
}

.result-card.low-risk {
  border-left-color: var(--success-color);
}

.result-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 50%;
}

.result-content {
  margin: 15px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Gauge Chart */
.gauge-container {
  text-align: center;
  margin: 15px 0;
}

.gauge-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  font-weight: 500;
}

.gauge {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  height: 20px;
  background: #ecf0f1;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.gauge-segment {
  height: 100%;
  transition: flex-basis var(--transition-duration) ease;
}

.gauge-segment.critical {
  background: var(--danger-color);
}

.gauge-segment.warning {
  background: var(--warning-color);
}

.gauge-segment.success {
  background: var(--success-color);
}

.gauge-value {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: var(--text-primary);
  font-size: 18px;
}

/* Risk Indicator */
.risk-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 5px 5px 5px 0;
  transition: all var(--transition-duration);
}

.risk-badge.high {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.risk-badge.medium {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

.risk-badge.low {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.risk-badge.info {
  background: rgba(41, 128, 185, 0.2);
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

.risk-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ecf0f1;
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 15px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.skeleton {
  background: linear-gradient(90deg, #ecf0f1 25%, #f5f5f5 50%, #ecf0f1 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 12px;
  margin: 10px 0;
  border-radius: 4px;
}

.skeleton-card {
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

/* Tablet (768px) */
@media (max-width: 768px) {
  .result-container {
    grid-template-columns: 1fr;
  }

  .result-card {
    margin: 10px 0;
  }

  .step-indicator li {
    font-size: 12px;
  }

  .step-indicator li::before {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .progress-text {
    font-size: 11px;
  }
}

/* Mobile (375px) */
@media (max-width: 480px) {
  .result-card {
    padding: 15px;
  }

  .result-title {
    font-size: 16px;
  }

  .result-content {
    font-size: 13px;
  }

  .step-indicator li {
    font-size: 10px;
  }

  .step-indicator li::before {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .step-indicator li::after {
    width: calc(100% - 20px);
  }

  .gauge-value {
    font-size: 14px;
  }

  button {
    min-height: 48px;
    padding: 12px 16px !important;
  }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
  .result-card {
    border-width: 2px;
  }

  .result-badge {
    border-width: 2px;
  }

  button {
    border-width: 2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
  }

  .result-card,
  .progress-container {
    background: #2a2a2a;
  }

  .progress-bar {
    background: #404040;
  }

  .step-indicator li::before {
    background: #404040;
  }
}

/* ========================================================================
   ANIMATIONS
   ======================================================================== */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-up {
  animation: slideUp var(--transition-duration) ease-out;
}

.slide-in {
  animation: slideIn var(--transition-duration) ease-out;
}

/* Pulse animation for important updates */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================================================
   FORM IMPROVEMENTS
   ======================================================================== */

.form-group {
  margin: 15px 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition-duration), box-shadow var(--transition-duration);
}

.form-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input.error {
  border-color: var(--danger-color);
}

.form-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger-color);
  margin-top: 5px;
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-duration);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}

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

.btn-primary:hover {
  background: #2980b9;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #999;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #229954;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
  min-height: 48px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  display: block;
}

/* ========================================================================
   TABLES
   ======================================================================== */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table thead {
  background: var(--primary-color);
  color: white;
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #ecf0f1;
  font-size: 14px;
}

.data-table tbody tr:hover {
  background: #f9f9f9;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}
