@import url('../futuristic-design-system.css');

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  color: var(--bg-primary);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff3366, #cc2952);
  color: var(--bg-primary);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-glow {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  box-shadow: 
    0 0 10px rgba(0, 212, 255, 0.3),
    inset 0 0 10px rgba(0, 212, 255, 0.1);
  animation: glowPulse 2s ease-in-out infinite;
}

.btn-glow:hover:not(:disabled) {
  background: var(--accent-primary);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-lg);
}

.btn-size-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-size-md {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
}

.btn-size-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-with-icon {
  gap: var(--space-2);
}

.btn-with-icon svg {
  width: 1.25em;
  height: 1.25em;
}

.btn-loading {
  pointer-events: none;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card-glitch {
  position: relative;
}

.card-glitch:hover {
  animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

.card-hover-lift {
  transition: all var(--transition-base);
}

.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(0, 212, 255, 0.1);
}

.card-bordered {
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.card-bordered:hover {
  border-color: rgba(0, 212, 255, 0.4);
}

.card-gradient {
  background: linear-gradient(
    135deg, 
    rgba(0, 212, 255, 0.1), 
    rgba(0, 102, 255, 0.05)
  );
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.card-gradient:hover {
  background: linear-gradient(
    135deg, 
    rgba(0, 212, 255, 0.15), 
    rgba(0, 102, 255, 0.1)
  );
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.card-glowing {
  position: relative;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.card-glowing:hover {
  box-shadow: var(--shadow-glow), inset 0 0 30px rgba(0, 212, 255, 0.05);
  border-color: rgba(0, 212, 255, 0.5);
}

.card-glowing::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-primary), transparent);
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card-glowing:hover::before {
  opacity: 1;
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: all var(--transition-base);
}

.input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.input:focus {
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 0 3px rgba(0, 212, 255, 0.1),
    0 0 20px rgba(0, 212, 255, 0.2);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.input-group:focus-within .input-group__label {
  color: var(--accent-primary);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: calc(var(--space-4) * 2);
}

.input-with-icon__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color var(--transition-base);
  pointer-events: none;
}

.input-with-icon:focus-within .input-with-icon__icon {
  color: var(--accent-primary);
}

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

.input-error:focus {
  box-shadow: 
    0 0 0 3px rgba(255, 51, 102, 0.1),
    0 0 20px rgba(255, 51, 102, 0.2);
}

.input-error[aria-invalid="true"] {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.input-success {
  border-color: var(--success);
}

.input-success:focus {
  box-shadow: 
    0 0 0 3px rgba(0, 255, 136, 0.1),
    0 0 20px rgba(0, 255, 136, 0.2);
}

.textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: all var(--transition-base);
  resize: vertical;
}

.textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 0 3px rgba(0, 212, 255, 0.1),
    0 0 20px rgba(0, 212, 255, 0.2);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: var(--space-3) calc(var(--space-4) * 2) var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-base);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23a0a0b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
}

.select:focus {
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 0 3px rgba(0, 212, 255, 0.1),
    0 0 20px rgba(0, 212, 255, 0.2);
}

.select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: var(--space-2);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.checkbox__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  outline: none;
}

.checkbox__input:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.checkbox__input:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox__input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox__input:hover:not(:checked) {
  border-color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.05);
}

.checkbox__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.checkbox:hover .checkbox__label {
  color: var(--text-primary);
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.radio__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  outline: none;
}

.radio__input:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.radio__input:checked {
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.2);
}

.radio__input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.radio__input:hover:not(:checked) {
  border-color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.05);
}

.radio__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.radio:hover .radio__label {
  color: var(--text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-base);
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.badge-primary {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--accent-primary);
}

.badge-primary:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.badge-success {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
  color: var(--success);
}

.badge-success:hover {
  background: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.badge-warning {
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.3);
  color: var(--warning);
}

.badge-warning:hover {
  background: rgba(255, 170, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.badge-danger {
  background: rgba(255, 51, 102, 0.1);
  border-color: rgba(255, 51, 102, 0.3);
  color: var(--error);
}

.badge-danger:hover {
  background: rgba(255, 51, 102, 0.2);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.badge-glowing {
  animation: glowPulse 2s ease-in-out infinite;
}

.badge-neon {
  background: transparent;
  border: 1px solid currentColor;
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  box-shadow: 0 0 10px currentColor, inset 0 0 10px currentColor;
}

.badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

.badge.badge-pill {
  border-radius: var(--radius-full);
}

.badge.badge-rounded {
  border-radius: var(--radius-md);
}

.badge-pulse::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__toggle {
  position: relative;
}

.dropdown__toggle::after {
  content: '';
  margin-left: var(--space-2);
  display: inline-block;
  vertical-align: middle;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition-base);
}

.dropdown__toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-base);
}

.dropdown-menu.dropdown-menu--show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu.dropdown-menu--right {
  right: 0;
  left: auto;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.dropdown-item.dropdown-item--active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
}

.dropdown-item.dropdown-item--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: var(--space-2) 0;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
  max-width: 500px;
  position: relative;
  overflow: hidden;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.toast__message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.toast__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-success .toast__icon {
  color: var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--error);
}

.toast.toast-error .toast__icon {
  color: var(--error);
}

.toast.toast-info {
  border-left: 4px solid var(--info);
}

.toast.toast-info .toast__icon {
  color: var(--info);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast.toast-warning .toast__icon {
  color: var(--warning);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.modal-overlay--show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 212, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: all var(--transition-base);
}

.modal-overlay.modal-overlay--show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content.modal-content--sm {
  max-width: 400px;
}

.modal-content.modal-content--lg {
  max-width: 800px;
}

.modal-content.modal-content--xl {
  max-width: 1000px;
}

.modal-content.modal-content--full {
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.modal__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.modal__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer.modal-footer--center {
  justify-content: center;
}

.modal-footer.modal-footer--space-between {
  justify-content: space-between;
}

@media (max-width: 640px) {
  .btn-size-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }

  .card {
    padding: var(--space-4);
  }

  .input {
    padding: var(--space-3);
  }

  .modal-content {
    border-radius: var(--radius-lg);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--space-4);
  }

  .toast {
    min-width: auto;
    max-width: calc(100vw - var(--space-8));
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
    justify-content: center;
  }

  .input-with-icon .input {
    padding-left: var(--space-4);
  }

  .input-with-icon__icon {
    display: none;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}