/* ==========================================================================
   button.css - Universal Google Gemini Button System
   Dooze Clip Generator / Clean, Borderless, Tonal Surfaces
   ========================================================================== */

/* Base button reset & common behavior */
.btn,
.btn-generate,
.btn-primary,
.btn-secondary,
.btn-tonal,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0 !important;
  outline: none;
  border-radius: var(--radius-pill, 999px) !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: background-color var(--duration-fast, 150ms) var(--ease-gemini), transform var(--duration-fast, 150ms) var(--ease-gemini), box-shadow 150ms ease, color 150ms ease;
  box-shadow: none;
  letter-spacing: -0.005em;
  line-height: 1;
}

.btn:active:not(:disabled),
.btn-generate:active:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-tonal:active:not(:disabled),
.btn-ghost:active:not(:disabled) {
  transform: scale(0.96);
}

.btn svg,
.btn-generate svg {
  width: var(--icon-size-sm, 16px);
  height: var(--icon-size-sm, 16px);
  flex-shrink: 0;
  stroke-width: var(--icon-stroke, 1.8px);
}

.btn:disabled,
.btn-generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button (Gemini Celestial Blue) */
.btn-primary,
.btn-generate {
  background-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  height: 38px;
  padding: 0 20px;
  min-width: 124px;
  position: relative;
  overflow: hidden;
}

.btn-primary svg,
.btn-generate svg {
  width: 18px;
  height: 18px;
}

.btn-primary:hover:not(:disabled),
.btn-generate:hover:not(:disabled) {
  background-color: var(--accent-hover, #bacfff);
  box-shadow: 0 4px 16px rgba(168, 199, 250, 0.28);
}

.btn-primary:hover:not(:disabled) .btn-gemini-sparkle,
.btn-generate:hover:not(:disabled) .btn-gemini-sparkle {
  transform: scale(1.18) rotate(15deg);
}

.btn-gemini-sparkle {
  transition: transform 220ms var(--ease-spring);
}

/* Secondary / Tonal Button (Google Soft Tonal) */
.btn-secondary,
.btn-tonal {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  height: 36px;
  padding: 0 16px;
}

.btn-secondary:hover:not(:disabled),
.btn-tonal:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

/* Ghost / Transparent Button */
.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  height: 36px;
  padding: 0 14px;
}

.btn-ghost:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Danger / Destructive Button (Tonal Red) */
.btn-danger {
  background-color: rgba(242, 139, 130, 0.12);
  color: var(--error);
  height: 36px;
  padding: 0 16px;
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(242, 139, 130, 0.22);
  color: #ffb4ab;
}

/* Sizes */
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-md {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 14px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Status loading tombol - Authentic Google Gemini Aurora Generation Animation */
.btn-generate.loading,
.btn.loading {
  background: var(--gemini-aurora-sweep, linear-gradient(90deg, #4285F4 0%, #9B72CB 25%, #D96570 50%, #9B72CB 75%, #4285F4 100%)) !important;
  background-size: 250% 100% !important;
  animation: geminiButtonSweep 2.4s ease-in-out infinite !important;
  box-shadow: 0 0 24px rgba(155, 114, 203, 0.45), 0 4px 16px rgba(66, 133, 244, 0.35) !important;
  color: #ffffff !important;
  cursor: wait;
  opacity: 1;
}

@keyframes geminiButtonSweep {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.pro-btn-loader {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  line-height: 1;
}

.gemini-btn-sparkle-loader {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  animation: geminiSparkleBreathe 1.8s ease-in-out infinite, geminiSparkleSpin 3.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

@keyframes geminiSparkleSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes geminiSparkleBreathe {
  0%, 100% { transform: scale(0.92); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; filter: drop-shadow(0 0 10px #ffffff); }
}

.status-text {
  font-size: 12px;
  color: var(--text-tertiary);
  min-height: 22px;
  text-align: center;
  transition: opacity 150ms ease-out, color 150ms ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.005em;
}

.status-text.is-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 12px;
}

.error-text {
  font-size: 13px;
  color: var(--error);
  text-align: center;
  line-height: 1.5;
  max-width: 620px;
}

.error-text.is-notice {
  color: var(--text-secondary);
}
