/* AI Cost Calculator - Custom Styles */

/* ============================================
   BASE STYLES
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   FOCUS STATES
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #b6f09c;
  outline-offset: 2px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

input[type="number"],
input[type="text"],
select {
  background: #0B0F14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  width: 100%;
  transition: all 0.2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.03);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Select dropdown styling */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

select option {
  background: #111827;
  color: white;
  padding: 0.5rem;
}

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

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

.animate-spin {
  animation: spin 1s linear infinite;
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

/* Result value animation */
@keyframes countUp {
  from {
    opacity: 0.5;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-updated {
  animation: countUp 0.2s ease-out;
}

/* ============================================
   CARD EFFECTS
   ============================================ */

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
}

/* ============================================
   TABLE STYLES
   ============================================ */

table {
  border-collapse: collapse;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Cheapest row highlight */
.row-cheapest {
  background: rgba(34, 197, 94, 0.08) !important;
}

.row-cheapest td {
  color: #b6f09c;
}

.row-cheapest .savings-badge {
  background: #b6f09c;
  color: #0B0F14;
  font-weight: 600;
}

/* ============================================
   BADGES
   ============================================ */

.savings-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.savings-positive {
  background: rgba(34, 197, 94, 0.15);
  color: #b6f09c;
}

.savings-negative {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.savings-neutral {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.875rem;
  z-index: 50;
  animation: fadeIn 0.3s ease;
}

.toast-success {
  background: #b6f09c;
}

.toast-error {
  background: #ef4444;
}

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

@media (max-width: 1024px) {
  .grid-cols-1 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }

  .savings-badge {
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glow effects for cards */
.glow-green {
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.15);
}

.glow-blue {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
}

.glow-purple {
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.15);
}

/* Text selection */
::selection {
  background: rgba(34, 197, 94, 0.3);
  color: white;
}
