/* ========================================
   CAPSULE CORP INTERNAL APP CATALOG
   Dragon Ball Z Tech Portal Edition
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Exo+2:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  /* Ki Energy Colors */
  --ki-orange: #ff6b35;
  --ki-yellow: #ffd93d;
  --ki-gold: #f4a020;
  --ki-blue: #00d4ff;
  --ki-purple: #a855f7;
  --ki-green: #22c55e;

  /* Background */
  --bg-void: #050810;
  --bg-dark: #0a0f1a;
  --bg-panel: #111827;
  --bg-card: rgba(17, 24, 39, 0.95);

  /* Text */
  --text-bright: #ffffff;
  --text-primary: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;

  /* Accents */
  --border: rgba(255, 107, 53, 0.2);
  --border-bright: rgba(255, 107, 53, 0.5);

  /* Glows */
  --glow-orange: rgba(255, 107, 53, 0.4);
  --glow-yellow: rgba(255, 217, 61, 0.3);
  --glow-blue: rgba(0, 212, 255, 0.4);
  --glow-purple: rgba(168, 85, 247, 0.4);
  --glow-green: rgba(34, 197, 94, 0.4);

  /* Fonts */
  --font-display: 'Orbitron', monospace;
  --font-body: 'Exo 2', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;

  /* Clip Paths */
  --clip-corner: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  --clip-badge: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

/* Animations */
@keyframes energyPulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--glow-orange), 0 0 40px transparent;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px var(--glow-orange), 0 0 60px var(--glow-yellow);
    transform: scale(1.01);
  }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes iconRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--ki-orange); opacity: 0.3; }
  50% { border-color: var(--ki-yellow); opacity: 0.6; }
}

@keyframes scanLine {
  0% { top: -10%; }
  100% { top: 110%; }
}

@keyframes textShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes warningPulse {
  0%, 100% { background-color: rgba(220, 38, 38, 0.9); }
  50% { background-color: rgba(185, 28, 28, 0.9); }
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Grid Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 107, 53, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 107, 53, 0.02) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(255, 107, 53, 0.08) 0%, transparent 50%);
  background-size: 60px 60px, 60px 60px, 100% 100%;
  pointer-events: none;
  z-index: 0;
}

/* Energy Orb Decoration */
body::after {
  content: '';
  position: fixed;
  top: 20%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: energyPulse 6s ease-in-out infinite;
}

/* ========================================
   INTERNAL BANNER - Warning Header
   ======================================== */
.internal-banner {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-transform: uppercase;
  position: relative;
  z-index: 100;
  animation: warningPulse 2s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

.internal-banner::before,
.internal-banner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0px,
    transparent 10px,
    rgba(0, 0, 0, 0.1) 10px,
    rgba(0, 0, 0, 0.1) 20px
  );
}

.internal-banner::before { left: 0; }
.internal-banner::after { right: 0; }

.banner-icon {
  font-size: 1.2rem;
  animation: energyPulse 1s ease-in-out infinite;
}

/* ========================================
   HEADER - Portal Title
   ======================================== */
.header {
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-dark) 100%);
  padding: 60px 20px 50px;
  text-align: center;
  border-bottom: 3px solid var(--ki-orange);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

/* Speed Lines Background */
.header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 5deg,
    rgba(255, 107, 53, 0.02) 5deg 10deg
  );
  animation: iconRotate 120s linear infinite;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ki-orange), var(--ki-yellow), var(--ki-orange), transparent);
  box-shadow: 0 0 30px var(--glow-orange);
}

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  position: relative;
}

.logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 0 25px var(--glow-blue));
  transition: all 0.4s ease;
  animation: cardFloat 4s ease-in-out infinite;
}

.logo-img:hover {
  filter: drop-shadow(0 0 40px var(--ki-blue)) brightness(1.2);
  transform: scale(1.1);
}

.logo-img.logo-sm {
  width: 50px;
  height: 50px;
  animation: none;
}

.header h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text-bright), var(--ki-orange), var(--ki-yellow), var(--ki-orange));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 6s linear infinite;
  position: relative;
}

.tagline {
  font-family: var(--font-display);
  color: var(--ki-blue);
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--glow-blue);
  position: relative;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
  flex: 1;
  padding: 60px 20px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ========================================
   APP GRID
   ======================================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 35px;
}

/* ========================================
   APP CARDS - Ki-Powered Cards
   ======================================== */
.app-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  clip-path: var(--clip-corner);
  padding: 40px 35px;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Corner Accents */
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 107, 53, 0.08) 50%);
  transition: all 0.4s ease;
}

/* Scan Line Effect */
.app-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: -10%;
  width: 100%;
  height: 20%;
  background: linear-gradient(180deg, transparent, rgba(255, 217, 61, 0.03), transparent);
  transition: top 0.6s ease;
}

.app-card:hover {
  border-color: var(--ki-orange);
  background: rgba(30, 41, 59, 0.98);
  transform: translateY(-12px) scale(1.02);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 40px var(--glow-orange),
    inset 0 0 40px rgba(255, 107, 53, 0.03);
}

.app-card:hover::before {
  background: linear-gradient(135deg, transparent 50%, var(--ki-orange) 50%);
  width: 100px;
  height: 100px;
}

.app-card:hover::after {
  top: 110%;
}

/* ========================================
   APP ICONS - Energy Orbs
   ======================================== */
.app-icon {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  transition: all 0.4s ease;
}

/* Icon Glow Ring */
.app-icon::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid;
  border-radius: 24px;
  opacity: 0.3;
  animation: borderGlow 3s ease-in-out infinite;
}

.app-icon svg {
  width: 44px;
  height: 44px;
  transition: all 0.3s ease;
}

.app-card:hover .app-icon {
  transform: scale(1.1) rotate(5deg);
}

.app-card:hover .app-icon svg {
  filter: drop-shadow(0 0 10px currentColor);
}

/* Store Icon - Green Energy */
.store-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow:
    0 8px 30px var(--glow-green),
    inset 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.store-icon::before {
  border-color: var(--ki-green);
}

/* API Icon - Gold Energy */
.api-icon {
  background: linear-gradient(135deg, var(--ki-gold), #d97706);
  color: white;
  box-shadow:
    0 8px 30px rgba(244, 160, 32, 0.4),
    inset 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.api-icon::before {
  border-color: var(--ki-gold);
}

/* Gravity Icon - Purple Energy */
.gravity-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow:
    0 8px 30px var(--glow-purple),
    inset 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.gravity-icon::before {
  border-color: var(--ki-purple);
}

/* ========================================
   APP CARD CONTENT
   ======================================== */
.app-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: var(--text-bright);
  transition: all 0.3s ease;
}

.app-card:hover h2 {
  color: var(--ki-orange);
  text-shadow: 0 0 20px var(--glow-orange);
}

.app-card p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 30px;
  flex: 1;
}

/* ========================================
   APP BUTTON - Launch Button
   ======================================== */
.app-btn {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  border: 2px solid var(--ki-orange);
  color: var(--ki-orange);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  clip-path: var(--clip-badge);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.app-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
  transition: left 0.5s ease;
}

.app-card:hover .app-btn {
  background: linear-gradient(135deg, var(--ki-orange), var(--ki-gold));
  color: var(--bg-dark);
  box-shadow: 0 4px 20px var(--glow-orange);
  transform: translateY(-2px);
}

.app-card:hover .app-btn::before {
  left: 100%;
}

/* ========================================
   FOOTER - Portal Footer
   ======================================== */
.footer {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-panel) 100%);
  padding: 40px 20px;
  text-align: center;
  border-top: 3px solid var(--ki-orange);
  position: relative;
  z-index: 10;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ki-orange), var(--ki-yellow), var(--ki-orange), transparent);
  box-shadow: 0 0 30px var(--glow-orange);
}

.footer-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.footer-logo .logo-img {
  animation: none;
  filter: drop-shadow(0 0 15px var(--glow-blue));
}

.footer p {
  font-family: var(--font-display);
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.footer-badge {
  display: inline-block;
  padding: 10px 24px;
  background: rgba(220, 38, 38, 0.15);
  border: 2px solid #dc2626;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fca5a5;
  clip-path: var(--clip-badge);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
  transition: all 0.3s ease;
}

.footer-badge:hover {
  background: rgba(220, 38, 38, 0.25);
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .header {
    padding: 40px 20px 35px;
  }

  .header h1 {
    font-size: 2rem;
    letter-spacing: 2px;
  }

  .logo-img {
    width: 80px;
    height: 80px;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .app-card {
    padding: 30px 25px;
  }

  .app-icon {
    width: 75px;
    height: 75px;
  }

  .app-icon svg {
    width: 36px;
    height: 36px;
  }

  .app-card h2 {
    font-size: 1.3rem;
  }

  .internal-banner {
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 10px 15px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.85rem;
    letter-spacing: 2px;
  }

  .app-btn {
    padding: 12px 24px;
    font-size: 0.8rem;
  }
}
