/* Login page specific styles */

/* Card animation on load */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: slideInUp 0.5s ease-out;
}

/* Tab Navigation Styles */
.tab-navigation {
  position: relative;
}

.tab-button {
  position: relative;
  background: transparent;
  color: var(--grey-2);
  border: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-button:hover:not(.active) {
  color: var(--grey-1);
  background: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tab-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Tab Panel Transitions */
.tab-panels {
  position: relative;
  overflow: hidden;
}

.tab-panel {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease-out;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

.tab-panel.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

.tab-panel[hidden] {
  display: none !important;
}

/* Smooth height transition for panels */
.tab-panels {
  transition: height 0.3s ease-out;
}

/* Form input focus effects */
.input:focus,
.select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  border-color: var(--primary);
}

/* Button states */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(242, 81, 70, 0.25);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading state for buttons */
.btn .loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.btn.loading .button-text {
  visibility: hidden;
}

/* Error alert animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert-error {
  animation: shake 0.5s ease-in-out;
}

/* Token viewer styling */
#tokenViewer .mockup-code {
  background: var(--grey-1);
}

#tokenViewer pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Link hover effects */
.link {
  position: relative;
  transition: all 0.2s ease;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .card-body {
    padding: 0;
  }
  
  .tab-button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  .tab-panel {
    min-height: 280px;
  }
}

/* Form field transitions */
.form-control {
  transition: all 0.3s ease;
}

/* Select dropdown styling */
.select {
  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;
}

/* Focus visible improvements */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Loading spinner centering */
.loading {
  margin: 0 auto;
}

/* Divider styling */
.divider {
  opacity: 0.1;
}

/* Alert improvements */
.alert {
  border-radius: 0.5rem;
  animation: slideInUp 0.3s ease-out;
}

/* Prevent layout shift */
.min-h-\[300px\] {
  min-height: 300px;
}

/* Smooth color transitions */
* {
  transition-property: color, background-color, border-color;
  transition-duration: 200ms;
  transition-timing-function: ease-out;
}

/* Override for elements that need different transitions */
.tab-panel,
.btn,
.card {
  transition-property: all;
}

/* Keyboard navigation indicators */
.tab-button:focus-visible::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tab-button.active {
    border: 2px solid currentColor;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

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