/**
 * Stripe Connect Embedded Components Styling
 * Custom styles for ReserBee integration with Stripe Connect
 */

/* =============================================================================
   Component Containers
   ============================================================================= */

.stripe-component-wrapper {
  min-height: 200px;
  transition: opacity 0.3s ease;
  padding: 1.25rem;
}

.stripe-component-wrapper:empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stripe-component-container {
  position: relative;
}

/* =============================================================================
   Loading States
   ============================================================================= */

.stripe-component-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-medium);
}

.stripe-component-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--honey);
  border-radius: 50%;
  animation: stripe-spin 0.8s linear infinite;
}

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

/* =============================================================================
   Error States
   ============================================================================= */

.stripe-component-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
  border-radius: 16px;
  border: 1px solid #fecaca;
}

.stripe-component-error .error-icon {
  width: 64px;
  height: 64px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stripe-component-error .error-icon i {
  font-size: 1.75rem;
  color: #ef4444;
}

.stripe-component-error .error-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 0.5rem;
}

.stripe-component-error .error-message {
  font-size: 0.875rem;
  color: #b91c1c;
  margin-bottom: 1.5rem;
  max-width: 300px;
}

.stripe-component-error .retry-btn {
  margin-top: 0.5rem;
}

/* =============================================================================
   Payments Page Header
   ============================================================================= */

.payments-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.payments-header-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payments-header-icon i {
  font-size: 1.75rem;
  color: #9333ea;
}

.payments-header-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.payments-header-content p {
  color: var(--text-medium);
  font-size: 0.9375rem;
}

/* =============================================================================
   Sub-Tab Navigation
   ============================================================================= */

.payments-subtabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-top: 1.5rem;
  padding-bottom: 0;
}

.payments-subtab {
  position: relative;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-medium);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.payments-subtab:hover {
  color: var(--text-dark);
  background: rgba(255, 249, 71, 0.05);
}

.payments-subtab.active {
  color: var(--charcoal);
  font-weight: 600;
  border-bottom-color: var(--honey);
}

.payments-subtab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--honey);
  border-radius: 2px 2px 0 0;
}

.payments-subtab i {
  font-size: 1rem;
  opacity: 0.7;
}

.payments-subtab.active i {
  opacity: 1;
}

/* Tab badge for counts/alerts */
.payments-subtab .tab-badge {
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* =============================================================================
   Tab Content Panels
   ============================================================================= */

.payments-subtab-content {
  padding-top: 1.5rem;
}

.payments-subtab-content.hidden {
  display: none;
}

/* =============================================================================
   Notification Banner Container
   ============================================================================= */

#connect-notification-container {
  margin-bottom: 1.5rem;
}

#connect-notification-container:empty,
#connect-notification-container:has(.stripe-component-wrapper:empty) {
  display: none;
  margin-bottom: 0;
}

/* =============================================================================
   Section Cards
   ============================================================================= */

.stripe-section-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.stripe-section-card:last-child {
  margin-bottom: 0;
}

.stripe-section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.stripe-section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stripe-section-header h3 i {
  color: var(--text-medium);
  font-size: 0.875rem;
}

.stripe-section-body {
  padding: 1.5rem;
}

/* =============================================================================
   Status Indicators
   ============================================================================= */

.connect-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.connect-status-pill.connected {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.connect-status-pill.pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.connect-status-pill.not-connected {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #4b5563;
}

.connect-status-pill i {
  font-size: 0.625rem;
}

/* =============================================================================
   Empty States
   ============================================================================= */

.stripe-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.stripe-empty-state .empty-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff9c4 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.stripe-empty-state .empty-icon i {
  font-size: 2rem;
  color: var(--honey);
}

.stripe-empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.stripe-empty-state p {
  color: var(--text-medium);
  max-width: 320px;
  margin-bottom: 1.5rem;
}

/* =============================================================================
   Grid Layouts
   ============================================================================= */

.stripe-grid {
  display: grid;
  gap: 1.5rem;
}

.stripe-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .stripe-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Responsive Adjustments
   ============================================================================= */

@media (max-width: 768px) {
  .payments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .payments-header-icon {
    width: 48px;
    height: 48px;
  }

  .payments-header-icon i {
    font-size: 1.25rem;
  }

  .payments-header-content h2 {
    font-size: 1.5rem;
  }

  .payments-subtabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .payments-subtabs::-webkit-scrollbar {
    display: none;
  }

  .payments-subtab {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }

  .payments-subtab span {
    display: none;
  }

  .payments-subtab i {
    margin-right: 0;
  }

  .stripe-section-body {
    padding: 1rem;
  }

  .stripe-component-loading,
  .stripe-component-error {
    padding: 2rem 1rem;
  }
}

/* =============================================================================
   Transition Effects
   ============================================================================= */

.payments-subtab-content {
  animation: fadeIn 0.3s ease;
}

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

/* Stripe component mount animation */
.stripe-component-wrapper > * {
  animation: componentMount 0.4s ease;
}

@keyframes componentMount {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =============================================================================
   Payments Page - Premium Fintech Design
   ============================================================================= */

.payments-page {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero Card */
.payments-hero-card {
  position: relative;
  background: linear-gradient(135deg, #0b0b0b 0%, #1a1a1a 50%, #252525 100%);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 20px 40px -8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 249, 71, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 249, 71, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 30%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 2.5rem 1.5rem;
  gap: 1.5rem;
}

.hero-left {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.hero-icon-wrapper {
  position: relative;
  flex-shrink: 0;
}

.hero-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--honey) 0%, #FFE947 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(255, 249, 71, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: rotate(-3deg);
  transition: transform 0.3s ease;
}

.hero-icon:hover {
  transform: rotate(0deg) scale(1.05);
}

.hero-icon i {
  font-size: 1.75rem;
  color: var(--charcoal);
}

.hero-icon-glow {
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(255, 249, 71, 0.2) 0%, transparent 70%);
  border-radius: 20px;
  pointer-events: none;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.hero-text h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.hero-text p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  font-weight: 400;
}

.hero-right {
  flex-shrink: 0;
}

.connect-status-wrapper {
  padding-top: 0.25rem;
}

/* Premium Status Pills (dark theme variant) */
.payments-hero-card .connect-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: normal;
}

.payments-hero-card .connect-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: status-pulse 2s ease-in-out infinite;
}

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

.payments-hero-card .connect-status-pill.connected {
  background: rgba(28, 255, 138, 0.15);
  color: #1cff8a;
  border: 1px solid rgba(28, 255, 138, 0.3);
}

.payments-hero-card .connect-status-pill.connected .status-dot {
  background: #1cff8a;
  box-shadow: 0 0 8px rgba(28, 255, 138, 0.5);
}

.payments-hero-card .connect-status-pill.pending {
  background: rgba(255, 249, 71, 0.15);
  color: var(--honey);
  border: 1px solid rgba(255, 249, 71, 0.3);
}

.payments-hero-card .connect-status-pill.pending .status-dot {
  background: var(--honey);
  box-shadow: 0 0 8px rgba(255, 249, 71, 0.5);
}

.payments-hero-card .connect-status-pill.not-connected {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.payments-hero-card .connect-status-pill.not-connected .status-dot {
  background: rgba(255, 255, 255, 0.5);
}

/* Status Actions Container */
.connect-status-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dashboard-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-link i {
  font-size: 0.75rem;
}

/* Empty State for New Clients */
.stripe-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.stripe-empty-state .empty-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f0f0ff 0%, #e8e8ff 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.stripe-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.stripe-empty-state p {
  font-size: 0.9375rem;
  color: var(--text-medium);
  max-width: 320px;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
