/* Invoice icon tooltips - compact width */
.invoice-icon-tooltip [data-tooltip-target="tooltip"] {
  width: auto !important;
  min-width: auto !important;
  white-space: nowrap;
}

/* Flash message animations */
.flash-message {
  animation: flashMessage 6s forwards;
}

/* Billing overview cards - ensure borders are always visible */
.billing-overview-card {
  border: 1px solid #e5e7eb !important; /* gray-200 */
  border-radius: 0.5rem;
  background-color: white;
  transition: all 0.15s ease;
}

.billing-overview-card:hover {
  border-color: #d1d5db !important; /* gray-300 */
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

@keyframes flashMessage {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
  8% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  92% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
}

/* Company role indicators */
.company-field {
  position: relative;
  transition: all 0.3s ease;
  padding: 0.75rem;
  border-radius: 8px;
}

.company-field::after {
  content: attr(data-role);
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 0.75rem;
  padding: 0 8px;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
}

/* Verification badge */
.company-role-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 0.75rem;
  padding: 0 8px;
  border-radius: 12px;
  background: white;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
  color: #dc2626;
  border: 1px solid #dc2626;
  background-color: #fef2f2;
  font-weight: 500;
}

.company-role-badge:hover {
  background-color: #fee2e2;
  border-color: #b91c1c;
  color: #b91c1c;
}

.company-role-badge::before {
  content: "Patvirtinti įmonę";
}

/* Remove the color overrides since we want consistent warning style */
.operation-sales .seller-field .company-role-badge,
.operation-purchases .buyer-field .company-role-badge,
.operation-sales .buyer-field .company-role-badge,
.operation-purchases .seller-field .company-role-badge {
  color: #dc2626;
  border: 1px solid #dc2626;
  background-color: #fef2f2;
}

.operation-sales .seller-field .company-role-badge:hover,
.operation-purchases .buyer-field .company-role-badge:hover,
.operation-sales .buyer-field .company-role-badge:hover,
.operation-purchases .seller-field .company-role-badge:hover {
  background-color: #fee2e2;
  border-color: #b91c1c;
  color: #b91c1c;
}

/* Sales mode */
.operation-sales .seller-field {
  border: 2px solid #78350f;
  background-color: #fafafa;
}

.operation-sales .seller-field::after {
  content: "Jūsų įmonė";
  color: #000000;
  border: 1px solid #78350f;
  display: block;
}

.operation-sales .seller-field[data-verified="false"][data-has-company="true"]::after {
  display: none;
}

.operation-sales .buyer-field {
  border: 2px dashed #e5e7eb;
  background-color: #f8fafc;
}

.operation-sales .buyer-field::after {
  content: "Kita įmonė";
  color: #6b7280;
  border: 1px solid #e5e7eb;
  display: block;
}

.operation-sales .buyer-field[data-verified="false"][data-has-company="true"]::after {
  display: none;
}

/* Purchase mode */
.operation-purchases .buyer-field {
  border: 2px solid #78350f;
  background-color: #fafafa;
}

.operation-purchases .buyer-field::after {
  content: "Jūsų įmonė";
  color: #000000;
  border: 1px solid #78350f;
  display: block;
}

.operation-purchases .buyer-field[data-verified="false"][data-has-company="true"]::after {
  display: none;
}

.operation-purchases .seller-field {
  border: 2px dashed #e5e7eb;
  background-color: #f8fafc;
}

.operation-purchases .seller-field::after {
  content: "Kita įmonė";
  color: #6b7280;
  border: 1px solid #e5e7eb;
  display: block;
}

.operation-purchases .seller-field[data-verified="false"][data-has-company="true"]::after {
  display: none;
}

/* Custom fields inherit parent styling */
.operation-sales .seller-field .custom-field {
  border-left: 3px solid #000000;
}

.operation-purchases .buyer-field .custom-field {
  border-left: 3px solid #000000;
}

/* Transition effects */
.company-field, 
.custom-field {
  transition: all 0.3s ease-in-out;
}


/* Turbo frame transition animations */
turbo-frame[id="custom_fields"] {
  transition: all 0.2s ease-in-out;
}

turbo-frame[id="operation_toggle"] {
  transition: all 0.2s ease-in-out;
}

/* Custom field input animations */
.custom-field input {
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* VAT line animations - only for structural changes, not content updates */
.vat-line {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Operation type toggle animations */
.operation-toggle-btn {
  transition: all 0.2s ease-in-out;
}

/* Simple fade-in animation for content changes */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Removed staggered animations to prevent flickering */


/* Smooth border transitions for company fields */
.seller-field,
.buyer-field {
  transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

/* Badge transitions */
.seller-field::after,
.buyer-field::after {
  transition: border-color 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Company field animations when operation type changes */
.operation-sales .seller-field,
.operation-purchases .buyer-field {
  animation: fadeIn 0.25s ease-out;
}

/* Badges also get fade-in animation */
.operation-sales .seller-field::after,
.operation-purchases .buyer-field::after {
  animation: fadeIn 0.25s ease-out;
}

/* Animation trigger classes */
.fadeIn {
  animation: fadeIn 0.25s ease-out;
}

/* Company field fade-in animation */
.company-field.fadeIn {
  animation: fadeIn 0.25s ease-out;
}

/* Company field badge animation */
.company-field.fadeIn::after {
  animation: fadeIn 0.25s ease-out;
}

/* Dropdown arrow for select elements */
.select-with-arrow {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* Loading animations for billing tabs */
.loading-blur {
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
}

.loading-skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
}

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

.skeleton-text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-text-short {
  height: 1rem;
  width: 66.666667%;
  margin-bottom: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-card {
  height: 5rem;
  width: 100%;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-button {
  height: 2rem;
  width: 6rem;
  border-radius: 0.375rem;
  background-color: #f3f4f6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Integration Interest Modal Styles */
.integration-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  padding: 1rem;
  animation: integrationBackdropIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-modal-backdrop.hidden {
  display: none;
}

@keyframes integrationBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.integration-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: white;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.25);
  animation: integrationModalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

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

@media (max-width: 640px) {
  .integration-modal {
    padding: 40px 32px;
    max-width: calc(100vw - 32px);
  }
}

.integration-modal-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.integration-modal-content.hidden {
  display: none;
}

.integration-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 20px;
  color: white;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px -8px rgba(16, 185, 129, 0.4);
  animation: integrationIconIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes integrationIconIn {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.integration-modal-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.integration-modal-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 32px;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

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

.integration-modal-form {
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.integration-input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.integration-input {
  width: 100%;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.integration-input::placeholder {
  color: #94a3b8;
}

.integration-input:focus {
  background: white;
  border-color: #10b981;
  transform: translateY(-1px);
}

.integration-input-focus-ring {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.integration-input:focus + .integration-input-focus-ring {
  opacity: 0.15;
}

.integration-submit-btn {
  width: 100%;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px -4px rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
}

.integration-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.5);
}

.integration-submit-btn:hover::before {
  opacity: 1;
}

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

.integration-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.integration-btn-arrow {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-submit-btn:hover .integration-btn-arrow {
  transform: translateX(2px);
}

.integration-modal-error {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.integration-modal-error.hidden {
  display: none;
}

.integration-modal-privacy {
  font-size: 13px;
  color: #94a3b8;
  margin: 16px 0 0;
  font-weight: 400;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.integration-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

.integration-modal-close:active {
  transform: scale(0.95);
}

/* Integration Modal Success State */
.integration-success-icon {
  display: inline-flex;
  margin: 0 auto 24px;
  color: #10b981;
}

.integration-success-circle {
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  animation: integrationDrawCircle 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes integrationDrawCircle {
  to { stroke-dashoffset: 0; }
}

.integration-success-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: integrationDrawCheck 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes integrationDrawCheck {
  to { stroke-dashoffset: 0; }
}

/* Integration Modal Loading State */
.integration-btn-loading {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: integrationSpin 0.6s linear infinite;
}

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