/* =============================================
   FestivalWishHub.in — AI Wish Generator Styles
   Matches existing glassmorphism theme
   ============================================= */

/* ── Section Container ───────────────────── */
.ai-wish-section {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.ai-wish-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.ai-wish-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent2));
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Header ──────────────────────────────── */
.ai-wish-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ai-wish-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.ai-wish-header h3 .ai-sparkle {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-wish-header p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Tabs ─────────────────────────────────── */
.ai-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.ai-tab-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--transition);
}

.ai-tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  color: #000 !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Fallback if gradient doesn't render on some browsers */
@supports not (background: linear-gradient(red, blue)) {
  .ai-tab-btn.active {
    background-color: var(--primary) !important;
  }
}

.ai-tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Controls ─────────────────────────────── */
.ai-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-control-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ai-control-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  min-width: 70px;
  white-space: nowrap;
}

/* Language toggle */
.ai-lang-group,
.ai-tone-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ai-lang-btn,
.ai-tone-btn {
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--transition);
}

.ai-lang-btn.active,
.ai-tone-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.ai-lang-btn:hover:not(.active),
.ai-tone-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

/* Name input */
.ai-name-input {
  flex: 1;
  min-width: 150px;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.25s;
}

.ai-name-input:focus {
  border-color: var(--primary);
}

.ai-name-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Relation select */
.ai-relation-select {
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.ai-relation-select option {
  background: #1a1a3a;
  color: #fff;
}

/* ── Personalize Panel ───────────────────── */
.ai-personalize-panel {
  display: none;
}

.ai-original-wish {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
}

.ai-original-wish:focus {
  border-color: var(--primary);
}

.ai-original-wish::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.ai-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.3rem;
}

/* ── Generate Button ─────────────────────── */
.ai-generate-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  background-color: var(--primary) !important;
  color: #000 !important;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--transition);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.ai-generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.ai-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* ── Counter ─────────────────────────────── */
.ai-counter {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.6rem;
}

/* ── Spinner ─────────────────────────────── */
.ai-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.ai-spinner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 5px;
  animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.ai-spinner-dot:nth-child(3) { animation-delay: 0s; }

@keyframes aiBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Result Area ─────────────────────────── */
.ai-result {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(255, 215, 0, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius-sm);
}

.ai-result-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

.ai-wish-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #fff;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 60px;
}

/* ── Result Action Buttons ───────────────── */
.ai-result-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.ai-action-btn {
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--transition);
}

.ai-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

.ai-action-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  border: none;
  font-weight: 700;
}

.ai-action-btn.primary:hover {
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ai-action-btn.whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
  font-weight: 600;
}

.ai-action-btn.whatsapp:hover {
  background: #1ebe5d;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* ── Card Section ────────────────────────── */
.ai-card-section {
  display: none;
  margin-top: 1.5rem;
}

.ai-card-section h4 {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.ai-template-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ai-tpl-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.ai-tpl-btn.active {
  background: rgba(255, 215, 0, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.ai-tpl-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.ai-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.ai-canvas-wrapper canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ai-card-name-input {
  width: 100%;
  max-width: 400px;
  margin: 0.75rem auto 0;
  display: block;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: var(--font);
  font-size: 0.82rem;
  outline: none;
  text-align: center;
}

.ai-card-name-input:focus {
  border-color: var(--primary);
}

.ai-card-name-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.ai-card-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ── Personalize Button (on wish cards) ──── */
.btn-personalize {
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(200, 150, 255, 0.3);
  border-radius: 10px;
  background: rgba(200, 150, 255, 0.08);
  color: var(--accent2);
  font-family: var(--font);
  min-height: 44px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--transition);
}

.btn-personalize:hover {
  background: rgba(200, 150, 255, 0.18);
  border-color: var(--accent2);
  transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
  .ai-wish-card {
    padding: 1.25rem;
  }

  .ai-wish-header h3 {
    font-size: 1.15rem;
  }

  .ai-control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-control-label {
    min-width: auto;
  }

  .ai-lang-group,
  .ai-tone-group {
    justify-content: flex-start;
  }

  .ai-tab-btn {
    font-size: 0.78rem;
    padding: 0.55rem 0.5rem;
  }

  .ai-result-actions {
    flex-direction: column;
  }

  .ai-action-btn {
    text-align: center;
  }

  .ai-card-actions {
    flex-direction: column;
    align-items: center;
  }

  .ai-template-bar {
    justify-content: center;
  }
}
