/* ================================================================
   WEBAPPTOWN DESIGN SYSTEM - COMPONENTS
   UI Components with Flagship Quality
   ================================================================ */

/* ----------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button - Accent with glow */
.btn-primary {
  background: var(--gradient-accent);
  color: var(--color-text);
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(13, 148, 136, 0.4);
}

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

/* Secondary Button - Ghost */
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-text-muted);
}

/* AI Button - Cyan glow effect */
.btn-ai {
  background: var(--color-primary-light);
  color: var(--color-ai);
  border: 1px solid var(--color-ai);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.btn-ai:hover {
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* Button with Icon */
.btn-icon {
  padding: var(--space-3);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Magnetic Button Effect (enhanced with JS) */
.btn-magnetic {
  will-change: transform;
}

/* Mobile menu toggle button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-base);
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-primary);
    border-left: 1px solid var(--color-border);
    padding: calc(80px + var(--space-6)) var(--space-6) var(--space-6);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    transition: right var(--transition-base);
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-link {
    width: 100%;
    padding: var(--space-3) 0;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }
  
  .nav-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-accent-light);
  }
  
  .nav-link-icon svg {
    width: 12px;
    height: 12px;
    stroke-width: 2;
  }
  
  .nav .btn {
    display: none;
  }
}

/* Nav icons: hidden on desktop only - visible on mobile */
@media (min-width: 769px) {
  .nav-link-icon {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
   CARDS
   ---------------------------------------------------------------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-strong);
}

/* Glass Card */
.card-glass {
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* Elevated Card */
.card-elevated {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
}

.card-elevated:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border-color: var(--color-border-strong);
}

/* Interactive Card (3D tilt effect applied via JS) */
.card-interactive {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: border-color var(--transition-base);
  transform-style: preserve-3d;
  will-change: transform;
}

.card-interactive:hover {
  border-color: var(--color-accent);
}

.card-interactive .card-content {
  transform: translateZ(30px);
}

/* Glow Card */
.card-glow {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card-glow:hover::before {
  opacity: 1;
}

/* ----------------------------------------------------------------
   BADGES
   ---------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* Live Badge with pulse */
.badge-live {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* AI Badge */
.badge-ai {
  background: rgba(34, 211, 238, 0.1);
  color: var(--color-ai);
  border-color: rgba(34, 211, 238, 0.3);
}

/* Accent Badge */
.badge-accent {
  background: rgba(13, 148, 136, 0.1);
  color: var(--color-accent-light);
  border-color: rgba(13, 148, 136, 0.3);
}

/* ----------------------------------------------------------------
   INPUTS
   ---------------------------------------------------------------- */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.input-lg {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* ----------------------------------------------------------------
   NAVIGATION
   ---------------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-4) 0;
  transition: all var(--transition-base);
}

.nav--transparent {
  background: transparent;
}

.nav--solid {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  transition: opacity var(--transition-fast);
}

.nav-logo:hover {
  opacity: 0.9;
}

.nav-logo:hover img {
  box-shadow: 0 0 24px rgba(13, 148, 136, 0.35);
}

.nav-logo img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-md);
  filter: saturate(1.05);
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.15);
  transition: box-shadow var(--transition-fast);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* AI Status Indicator */
.nav-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-ai);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: var(--radius-full);
}

.nav-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-ai);
  border-radius: 50%;
  animation: pulse-live 2s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   SECTION HEADERS
   ---------------------------------------------------------------- */

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent-light);
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--radius-full);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ----------------------------------------------------------------
   DIVIDERS
   ---------------------------------------------------------------- */

.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

.divider-glow {
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-accent) 50%, 
    transparent 100%
  );
  opacity: 0.5;
}

/* ----------------------------------------------------------------
   TOOLTIPS
   ---------------------------------------------------------------- */

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  white-space: nowrap;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   SCROLL PROGRESS
   ---------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-ai);
  z-index: calc(var(--z-sticky) + 1);
  transition: width 50ms linear;
}

/* ----------------------------------------------------------------
   LOADING STATES
   ---------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface) 25%,
    var(--color-surface-elevated) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------------
   CURSOR EFFECTS
   ---------------------------------------------------------------- */

.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity var(--transition-fast);
}

.cursor-glow--ai {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
}
