/* Custom Tailwind CSS Styles for ipapi.is App */

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-track {
    background: #171717;
  }

  ::-webkit-scrollbar-thumb {
    background: #404040;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #525252;
  }
}

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Focus styles */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
  ring-color: #0ea5e9;
}

/* Shiny subscription input */
.shiny-sub {
  border: 1px solid rgba(0, 204, 102, 0.65) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0 12px rgba(0, 204, 102, 0.5) !important;
  background: linear-gradient(135deg, rgba(102, 204, 153, 0.1) 0%, rgba(102, 204, 153, 0.05) 100%) !important;
}

/* Quota full warning */
.quota-full {
  border: 1px solid rgba(239, 68, 68, 0.65) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%) !important;
}

/* Pulsing animation for subscription highlight */
@keyframes pulse-brand {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 12px rgba(14, 165, 233, 0);
  }
}

.is-pulsing {
  animation: pulse-brand 0.8s ease-in-out infinite;
  border-color: #0ea5e9 !important;
}

/* Code block styles - minimal padding */
pre {
  background: #171717;
  border-radius: 0.5rem;
  padding: 0.7rem 0.85rem !important;
  overflow-x: auto;
  margin: 0;
}

pre code,
pre code.hljs {
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem !important;
  line-height: 1.4 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Force smaller code font in generated code and response sections */
#generated-code,
#response-output {
  font-size: 0.8rem !important;
  line-height: 1.4 !important;
  padding: 0 !important;
}

/* Slightly larger section headings */
h2.text-xl {
  font-size: 1.35rem !important;
}

h2.text-lg {
  font-size: 1.2rem !important;
}

h3.text-lg {
  font-size: 1.15rem !important;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  .card-hover:hover {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  }
}

/* Button loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Gradient backgrounds */
.gradient-brand {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
}

.gradient-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Glass effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark) {
  .glass {
    background: rgba(23, 23, 23, 0.85);
  }
}

/* Toast notifications */
.toast-enter {
  animation: toast-in 0.3s ease-out forwards;
}

.toast-exit {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-1rem);
  }
}

/* Chart container styles */
.chart-container {
  position: relative;
  height: 400px;
}

/* Indicator dot animation */
.indicator-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Select dropdown custom styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Tab styles */
.tab-item {
  position: relative;
  padding-bottom: 0.75rem;
}

.tab-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.tab-item.active::after {
  background: #0ea5e9;
}

.tab-item.active {
  color: #0ea5e9;
}

/* Input with icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.input-with-icon input,
.input-with-icon select {
  padding-left: 2.75rem;
}

/* Smaller input and text field fonts */
input,
select,
textarea {
  font-size: 0.8125rem !important;
  /* 13px */
}

input::placeholder,
textarea::placeholder {
  font-size: 0.8125rem !important;
}

/* Make larger inputs like OTP amount still readable but not oversized */
input[type="number"],
input.text-2xl {
  font-size: 1.25rem !important;
  /* Keep slightly larger for amount inputs */
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-brand {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

@media (prefers-color-scheme: dark) {
  .badge-brand {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
  }

  .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
  }

  .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
  }

  .badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }
}

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

@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(90deg, #262626 25%, #404040 50%, #262626 75%);
    background-size: 200% 100%;
  }
}

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

  100% {
    background-position: -200% 0;
  }
}