/* Auth Modal */
[data-modal="auth"] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Show modal when opened by JS */
[data-modal="auth"][style*="display: flex"],
[data-modal="auth"][style*="display:flex"] {
  display: flex !important;
}

[data-modal-action="close"] {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

[data-auth-tab] {
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

[data-auth-tab].tb-active {
  border-bottom-color: #007bff;
}

[data-auth-tab-content] {
  display: none;
}

[data-auth-tab-content].tb-active {
  display: block;
}

[data-form] {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

[data-field] {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

/* Fix browser autofill dark background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active,
.input.cc-text-color-dark:-webkit-autofill,
.input.cc-text-color-dark:-webkit-autofill:hover,
.input.cc-text-color-dark:-webkit-autofill:focus,
.input.cc-text-color-dark:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #000000 !important;
  caret-color: #000000 !important;
  background-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

/* Keep black border on focus for dark theme inputs */
.input.cc-text-color-dark:focus,
.input.cc-text-color-dark:active {
  border-color: #000000 !important;
  outline: none !important;
}

[data-form] button[type="submit"] {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

[data-form] button[type="submit"]:hover {
  background: #0056b3;
}

[data-action="reset-password"] {
  text-align: center;
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  display: block;
  margin-top: 10px;
}

/* Google Sign-In Button Container */
[data-google-signin] {
  min-height: 44px;
  width: 100%;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Loading Spinner */
.tb-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: tb-spin 1s ease-in-out infinite;
  margin-right: 8px;
}

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

.tb-loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Hero Section Skeleton Loading */
.tb-loading-skeleton {
  position: relative;
  pointer-events: none;
}

.tb-loading-skeleton::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: tb-skeleton-shimmer 1.5s ease-in-out infinite;
  z-index: 1;
  border-radius: 8px;
}

@keyframes tb-skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.tb-loading-skeleton [data-hero-title],
.tb-loading-skeleton [data-hero-description],
.tb-loading-skeleton [data-hero-button-text] {
  color: transparent !important;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

/* Purchase Modal */
[data-modal="purchase"] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

/* Show modal when opened by JS */
[data-modal="purchase"][style*="display: flex"],
[data-modal="purchase"][style*="display:flex"] {
  display: flex !important;
}

/* Password Recovery Modal */
[data-modal="password-recovery"] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1002;
}

/* Show modal when opened by JS */
[data-modal="password-recovery"][style*="display: flex"],
[data-modal="password-recovery"][style*="display:flex"] {
  display: flex !important;
}

[data-purchase-type] {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s ease;
}

[data-purchase-type]:hover {
  background: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Google Sign-In Button Mobile Fix - Center the button */
  [data-google-signin] {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* Accessibility: Focus trap for modals */
[data-modal] {
  outline: none;
}

/* Close button hover state */
[data-modal-action="close"]:hover {
  opacity: 0.7;
}

/* Smooth transitions */
[data-modal] {
  transition: opacity 0.2s ease-in-out;
}

[data-modal][style*="display: none"] {
  opacity: 0;
  pointer-events: none;
}

[data-modal][style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

[data-show-after-load="true"] {
  display: none;  /* ✅ JavaScript can now override */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in, visibility 0.4s ease-in;
}