/* Reusable components: buttons, cards, badges */

.generate-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 0 rgba(0,0,0,0);
}

.generate-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px var(--primary-glow),
        0 2px 4px rgba(0,0,0,0.05);
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.2),
        0 0 0 1px rgba(15, 23, 42, 0.7);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow:
        0 0 0 1px rgba(148, 163, 184, 0.7);
}

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(249, 250, 251, 0.8);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.generate-btn.loading .btn-text {
    display: none;
}

.generate-btn.loading .btn-loader {
    display: inline-block;
}

.copy-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.select-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.select-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-1px);
    color: #ffffff;
}

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

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.niche-badge {
    background: rgba(139, 92, 246, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    color: #a78bfa;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.generation-counter {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.confirmation-card {
    max-width: 400px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Shiny Button Effect */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 5%;
  inherits: false;
}

@property --gradient-shine {
  syntax: "<color>";
  initial-value: white;
  inherits: false;
}

.shiny-btn {
  --shiny-cta-fg: #ffffff;
  --shiny-cta-highlight: rgba(255, 255, 255, 0.9);
  --shiny-cta-highlight-subtle: rgba(255, 255, 255, 0.5);
  
  --animation: gradient-angle linear infinite;
  --duration: 3s;
  --shadow-size: 2px;
  --transition: 800ms cubic-bezier(0.25, 1, 0.5, 1);
  
  /* App Theme Gradient + Shiny Border logic */
  background: 
    linear-gradient(135deg, #6366f1 0%, #a855f7 100%) padding-box,
    conic-gradient(
      from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
      transparent,
      var(--shiny-cta-highlight) var(--gradient-percent),
      var(--shiny-cta-highlight-subtle) calc(var(--gradient-percent) * 2),
      var(--shiny-cta-highlight) calc(var(--gradient-percent) * 3),
      transparent calc(var(--gradient-percent) * 4)
    ) border-box !important;
    
  border: 1px solid transparent !important;
  border-radius: 999px;
  color: var(--shiny-cta-fg);
  position: relative;
  isolation: isolate;
  overflow: hidden; /* Changed to hidden to contain effects */
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
  transition: var(--transition);
  transition-property: --gradient-angle-offset, --gradient-percent, --gradient-shine, transform, box-shadow;
}

/* Dots pattern */
.shiny-btn::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  translate: -50% -50%;
  z-index: -1;
  
  --size: calc(100% - var(--shadow-size) * 3);
  --position: 2px;
  --space: calc(var(--position) * 2);
  width: var(--size);
  height: var(--size);
  background: radial-gradient(
    circle at var(--position) var(--position),
    rgba(255,255,255,0.2) calc(var(--position) / 4),
    transparent 0
  ) padding-box;
  background-size: var(--space) var(--space);
  background-repeat: space;
  mask-image: conic-gradient(
    from calc(var(--gradient-angle) + 45deg),
    black,
    transparent 10% 90%,
    black
  );
  border-radius: inherit;
  opacity: 0.4;
  animation: inherit;
}

/* Inner shimmer */
.shiny-btn::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  --animation: shimmer linear infinite;
  background: linear-gradient(
    -50deg,
    transparent,
    rgba(255,255,255,0.1),
    transparent
  );
  mask-image: radial-gradient(circle at bottom, transparent 40%, black);
  opacity: 0.6;
  animation: inherit;
}

/* Animations */
.shiny-btn,
.shiny-btn::before,
.shiny-btn::after {
  animation: var(--animation) var(--duration),
    var(--animation) calc(var(--duration) / 0.4) reverse paused;
  animation-composition: add;
}

.shiny-btn:hover {
  --gradient-percent: 20%;
  --gradient-angle-offset: 95deg;
  --gradient-shine: var(--shiny-cta-highlight-subtle);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.shiny-btn:is(:hover, :focus-visible),
.shiny-btn:is(:hover, :focus-visible)::before,
.shiny-btn:is(:hover, :focus-visible)::after {
  animation-play-state: running;
}

.shiny-btn span, 
.shiny-btn svg {
    z-index: 1;
    position: relative;
}

@keyframes gradient-angle {
  to { --gradient-angle: 360deg; }
}

@keyframes shimmer {
  to { rotate: 360deg; }
}

