/* Import fonts first */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@500;600;700;800;900&display=swap');

/* Tailwind directives */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Poppins', var(--font-sans);
  --cosmo-bg-0: #050308;
  --cosmo-bg-1: #0b0b1a;
  --cosmo-bg-2: #0f1630;
  --cosmo-surface: rgba(255, 255, 255, 0.04);
  --cosmo-glass: rgba(255, 255, 255, 0.06);
  --cosmo-accent-1: #7c5cff;
  --cosmo-accent-2: #00e5c9;
  --cosmo-accent-3: #ff6b6b;
  --cosmo-text: #e6eef8;
  --cosmo-muted: #98a0b3;
  --cosmo-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --cosmo-duration-sm: 160ms;
  --cosmo-duration-md: 280ms;
  --cosmo-radius: 12px;
}

/* Base styles */
@layer base {
  body {
    @apply antialiased text-gray-100 bg-gradient-to-br from-gray-900 to-gray-800;
    font-family: var(--font-sans);
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    @apply font-bold;
  }
}

/* Component styles */
@layer components {
  .glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }
  
  .gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, #93c5fd, #a78bfa);
  }
  
  .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .btn-primary {
    background: linear-gradient(to right, #3b82f6, #4f46e5);
  }
  
  .btn-primary:hover {
    background: linear-gradient(to right, #2563eb, #4338ca);
  }
  
  .btn-accent {
    background: linear-gradient(to right, #8b5cf6, #7c3aed);
  }
  
  .btn-accent:hover {
    background: linear-gradient(to right, #7c3aed, #6d28d9);
  }
}

/* CosmoTech Design Tokens and base styles */
:root{
  /* Palette */
  --cosmo-bg-0: #050308;
  --cosmo-bg-1: #0b0b1a;
  --cosmo-bg-2: #0f1630;
  --cosmo-surface: rgba(255,255,255,0.04);
  --cosmo-glass: rgba(255,255,255,0.06);

  --cosmo-accent-1: #7c5cff; /* purple */
  --cosmo-accent-2: #00e5c9; /* teal */
  --cosmo-accent-3: #ff6b6b; /* coral */

  --cosmo-text: #e6eef8;
  --cosmo-muted: #98a0b3;

  /* Motion */
  --cosmo-ease: cubic-bezier(.2,.9,.2,1);
  --cosmo-duration-sm: 160ms;
  --cosmo-duration-md: 280ms;
  --cosmo-radius: 12px;
}

/* Global page */
html,body,#root{
  height:100%;
}
body{
  margin:0;
  font-family: var(--font-sans);
  background: radial-gradient(1200px 600px at 10% 10%, rgba(124,92,255,0.12), transparent 6%),
              radial-gradient(1000px 500px at 90% 90%, rgba(0,229,201,0.06), transparent 6%),
              linear-gradient(180deg, var(--cosmo-bg-1), var(--cosmo-bg-2));
  color:var(--cosmo-text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Hero / Landing typography */
.hero-title{
  font-family: var(--font-heading);
  font-weight:800;
  font-size:clamp(1.9rem, 4.5vw, 2.5rem);
  line-height:1.02;
  margin:0 0 6px 0;
  letter-spacing:-0.6px;
  color:var(--cosmo-text);
  text-shadow: 0 6px 20px rgba(2,6,23,0.6);
}

.hero-subtitle{
  color:var(--cosmo-muted);
  font-size:clamp(0.95rem, 1.6vw, 1.05rem);
  margin-top:6px;
}

.hero-card{
  max-width:560px;
  margin:40px auto;
  padding:20px;
}

.card-title{
  text-align:center;
  margin-bottom:12px;
  font-weight:700;
  font-size:1.05rem;
}

.role-button{
  padding:16px;
  font-size:1.125rem;
  font-weight:700;
  border-radius:12px;
}

.btn-primary{ box-shadow: 0 12px 36px rgba(124,92,255,0.12); }

.btn-accent{ box-shadow: 0 12px 36px rgba(0,229,201,0.08); }

.hero-footer{ text-align:center; color:var(--cosmo-muted); margin-top:20px; }

/* Animated CosmoTech background (subtle motion) */
.cosmo-background {
  position:fixed; inset:0; pointer-events:none; z-index:-1; overflow:hidden;
}
.cosmo-bg-layer {
  position:absolute; width:160%; height:160%; left:-30%; top:-30%; background-repeat:no-repeat; background-size:cover; opacity:0.35; transform-origin:center;
  animation:cosmoBgFloat 20s linear infinite;
}
.cosmo-bg-layer.layer-1{ background: radial-gradient(800px 400px at 10% 10%, rgba(124,92,255,0.14), transparent 30%); animation-duration:28s; }
.cosmo-bg-layer.layer-2{ background: radial-gradient(700px 350px at 90% 90%, rgba(0,229,201,0.08), transparent 30%); animation-duration:36s; transform:rotate(30deg); }

@keyframes cosmoBgFloat{ 0%{ transform:translateY(0) rotate(0deg);} 50%{ transform:translateY(-6%) rotate(1deg);} 100%{ transform:translateY(0) rotate(0deg);} }

/* Floating particles (subtle) */
.cosmo-particles{ position:absolute; inset:0; background-image:radial-gradient(circle at 10% 20%, rgba(255,255,255,0.02) 0 2px, transparent 2px), radial-gradient(circle at 80% 80%, rgba(255,255,255,0.01) 0 1px, transparent 1px); opacity:0.6; mix-blend-mode:screen; filter:blur(8px); }

/* Icon button helpers */
.icon { width:18px; height:18px; display:inline-block; vertical-align:middle; flex:0 0 18px; }
.btn .icon { margin-right:8px; opacity:0.95; }
/* Ensure inline SVGs used as icons keep their aspect and don't expand to container width */
svg.icon, .icon > svg { width: 1.125rem !important; height: 1.125rem !important; display: inline-block; vertical-align: middle; }

/* Prevent large/scaled SVGs appearing inside cards or form areas (safety net) */
.cosmo-card svg { max-width: 2.25rem; max-height: 2.25rem; width: auto; height: auto; }
.textarea + svg, .cosmo-card .large-svg, .cosmo-card .hero-svg { max-width: 6rem; max-height: 6rem; }

/* Tooltip */
.tooltip-wrapper{ position:relative; display:inline-block; }
.tooltip-wrapper .tooltip {
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); background:rgba(2,6,23,0.9); color:var(--cosmo-text); padding:6px 8px; border-radius:8px; font-size:12px; white-space:nowrap; opacity:0; pointer-events:none; transition:all 180ms var(--cosmo-ease); box-shadow:0 6px 18px rgba(2,6,23,0.6);
}
.tooltip-wrapper:hover .tooltip, .tooltip-wrapper:focus-within .tooltip{ opacity:1; transform:translateX(-50%) translateY(-6px); }

/* Glass card */
.cosmo-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px) saturate(120%);
  border-radius: var(--cosmo-radius);
  padding:16px;
  box-shadow: 0 6px 24px rgba(2,6,23,0.6);
}

.cosmo-card h2{
  font-weight:600;
  margin:0 0 8px 0;
  padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,0.04);
}

/* Buttons */
button {
  font-family: inherit;
}

.btn {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid transparent;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color:var(--cosmo-text);
  cursor:pointer;
  transition:all var(--cosmo-duration-sm) var(--cosmo-ease);
}

.btn:active{ transform:translateY(1px); }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }

.btn-primary{
  background: linear-gradient(90deg, var(--cosmo-accent-1), #9967ff 50%);
  border: 1px solid rgba(124,92,255,0.25);
  box-shadow: 0 6px 18px rgba(124,92,255,0.07);
}

.btn-ghost{
  background: transparent;
  border: 1px solid rgba(255,255,255,0.04);
}

.btn-accent{
  background: linear-gradient(90deg, var(--cosmo-accent-2), #00d6b3);
  border:1px solid rgba(0,229,201,0.12);
}

/* Small utilities */
.container{ max-width:1120px; margin:0 auto; padding:16px; }
.header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.grid{ display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:1000px){ .grid{ grid-template-columns:2fr 1fr; } }

.badge{
  padding:6px 8px; border-radius:999px; background:rgba(255,255,255,0.03); color:var(--cosmo-muted); font-weight:600; font-size:13px;
}

/* Video container styling */
.video-wrap{ position:relative; border-radius:10px; overflow:hidden; background:black; }
.video-wrap video{ width:100%; height:100%; object-fit:contain; display:block; }

/* Forms */
.textarea{ width:100%; min-height:120px; padding:10px; border-radius:8px; background:rgba(0,0,0,0.25); border:1px solid rgba(255,255,255,0.04); color:var(--cosmo-text); }

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
}

/* small subtle animations */
.fade-in{ animation:cosmoFade var(--cosmo-duration-md) var(--cosmo-ease) both; }
@keyframes cosmoFade{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none;} }
