:root {
  --bg: #020617;
  --card: #0f172a;
  --border: rgba(139,92,246,0.2);
  --primary: #a78bfa;
  --secondary: #ec4899;
  --accent: #6366f1;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --glow-primary: rgba(167,139,250,0.6);
  --glow-secondary: rgba(236,72,153,0.6);
}

body {
  background: radial-gradient(circle at top, #1e0836, #020617);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

.ais-container {
  max-width: 1100px;
  margin: 60px auto;
  padding: 48px 40px;
  background: rgba(15, 23, 42, 0.45);           /* Glassmorphism base */
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.ais-header-wrapper {
  text-align: center;
  margin-bottom: 56px;
}

/* Animated gradient flow on header */
.ais-header {
  font-size: 3.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent), var(--secondary));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 12px;
  animation: gradientFlow 10s ease infinite;
}

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

.ais-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0;
}

.ais-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 56px;
  background: rgba(15,23,42,0.35);
  padding: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.ais-tab-btn {
  padding: 16px 48px;
  border-radius: 999px;
  background: rgba(30,41,59,0.4);
  color: #cbd5e1;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(139,92,246,0.3);
  transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.ais-tab-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 
    0 0 20px var(--glow-primary),
    0 0 40px var(--glow-secondary),
    inset 0 0 10px rgba(167,139,250,0.2);
  border-color: var(--glow-primary);
}

.ais-tab-btn.active {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 0 35px var(--glow-secondary);
  animation: breathingGlow 3s ease-in-out infinite;
}

.ais-tab-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.8s ease;
}

.ais-tab-btn:hover::before {
  left: 150%;
}

@keyframes breathingGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(167,139,250,0.3); }
  50% { box-shadow: 0 0 45px rgba(236,72,153,0.6); }
}

.ais-tab-content { display: none; }
.ais-tab-content.active { display: block; }

.ais-analyzer-section,
.ais-advisor-section {
  max-width: 720px;
  margin: 0 auto;
}

#ais-company {
  width: 100%;
  padding: 18px 24px;
  font-size: 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(30,41,59,0.6);
  color: white;
  margin-bottom: 24px;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
}

#ais-suggestions {
  background: rgba(30,41,59,0.7);
  border-radius: 16px;
  border: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 32px;
  list-style: none;
  padding: 0;
  backdrop-filter: blur(10px);
}

#ais-suggestions li {
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

#ais-suggestions li:hover {
  background: rgba(167,139,250,0.18);
}

.ais-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.ais-form-grid input,
.ais-form-grid select {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(30,41,59,0.6);
  color: white;
  font-size: 1.05rem;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
}

.ais-primary-btn {
  width: 100%;
  padding: 16px 40px;
  font-size: 1.18rem;
  font-weight: 800;
  min-height: 56px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
  background-size: 200% 200%;
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(236,72,153,0.35);
  transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  overflow: hidden;
  animation: gradientFlowBtn 12s ease infinite;
}

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

.ais-primary-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 
    0 0 25px var(--glow-secondary),
    0 0 50px var(--glow-primary),
    inset 0 0 12px rgba(255,255,255,0.15);
  border-color: var(--glow-primary);
}

.ais-primary-btn:active {
  animation: buttonPulse 0.4s ease-out;
}

@keyframes buttonPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(236,72,153,0.7); }
  50% { transform: scale(0.96); }
  100% { transform: scale(1); box-shadow: 0 0 0 20px rgba(236,72,153,0); }
}

.ais-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
}

.ais-asset-btn {
  padding: 16px 40px;
  min-width: 160px;
  background: rgba(30,41,59,0.5);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.ais-asset-btn.active {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: white;
  transform: scale(1.08);
  box-shadow: 0 0 35px var(--glow-secondary);
}

.ais-asset-btn.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(30,41,59,0.35);
}

.ais-asset-btn.locked::after {
  content: "\f023";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: #cbd5e1;
  opacity: 0.9;
  pointer-events: none;
}

.ais-asset-btn:hover:not(.locked) {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 
    0 0 25px var(--glow-primary),
    0 0 50px var(--glow-secondary),
    inset 0 0 10px rgba(167,139,250,0.2);
}

.ais-result-area {
  margin-top: 40px;
}

.ais-result-card {
  background: rgba(15,23,42,0.45);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.37);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  animation: fadeIn 0.7s ease-out;
}

.ais-result-card h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  font-size: 2.1rem;
}

.ais-formatted {
  line-height: 1.8;
}

.ais-formatted h3,
.ais-formatted h4 {
  color: var(--primary);
  margin: 36px 0 18px;
  font-size: 1.5rem;
}

.ais-formatted p {
  margin: 20px 0;
}

.ais-formatted ul {
  list-style: none;
  padding: 0;
}

.ais-formatted li {
  margin: 16px 0;
  padding-left: 32px;
  position: relative;
  font-size: 1.1rem;
}

.ais-formatted li::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  position: absolute;
  left: 0;
  color: var(--success);
  font-size: 1.4rem;
}

.ais-formatted table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 1rem;
}

.ais-formatted th,
.ais-formatted td {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.ais-formatted th {
  background: rgba(167,139,250,0.1);
  font-weight: 700;
}

.ais-score-container {
  background: rgba(0,0,0,0.4);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}

.ais-score-label {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.ais-score-bar-wrapper {
  height: 20px;
  background: #334155;
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0;
}

.ais-score-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ais-info {
  text-align: center;
  font-size: 1.1rem;
  color: #60a5fa;
  margin-bottom: 16px;
  font-weight: 600;
  padding: 12px;
  background: rgba(96,165,250,0.1);
  border-radius: 12px;
}

.ais-error,
.ais-loading {
  text-align: center;
  padding: 40px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--danger);
}

.ais-loading i {
  margin-right: 12px;
  animation: spin 1.2s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .ais-tabs { flex-direction: column; gap: 12px; padding: 12px; }
  .ais-assets { flex-direction: column; }
  .ais-form-grid { grid-template-columns: 1fr; }
  .ais-container { margin: 40px 16px; padding: 32px 20px; }
  .ais-primary-btn { padding: 16px 30px; font-size: 1.1rem; }
}