/* 
 * WETEC Design System for Datagate 3 Portal
 * Color palette, typography, responsive grid, animations and interactive effects.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  /* Colors */
  --navy: #233671;
  --navy-deep: #18244d;
  --green: #247b49;
  --red: #c92128;
  --ink: #16203c;
  --body: #46536a;
  --muted: #758196;
  --line: #dfe7f2;
  --line-strong: #c7d4e7;
  --soft: #f4f7fb;
  --soft-blue: #eaf1fd;
  --white: #fff;
  
  /* Fonts & Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Radii & Layouts */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --max-width: 1200px;
  --header-h: 76px;
  
  /* Motion & Animations */
  --motion-ease: cubic-bezier(.22, .61, .36, 1);
  --shadow: 0 10px 30px -15px rgba(22, 32, 60, 0.15);
  --shadow-hover: 0 24px 50px -20px rgba(22, 32, 60, 0.25);
}

@property --wetec-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes wetec-border-spin {
  to {
    --wetec-angle: 360deg;
  }
}

@keyframes float-spark {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(15deg);
    opacity: 0.75;
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  color: var(--body);
  font-family: var(--font-sans);
  background: 
    radial-gradient(circle at 86% -12%, rgba(36, 123, 73, 0.12), transparent 28rem),
    radial-gradient(circle at -10% 8%, rgba(35, 54, 113, 0.12), transparent 30rem),
    #fbfcfe;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.22s ease;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(223, 231, 242, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px -10px rgba(22, 32, 60, 0.05);
}

.header-inner {
  max-width: var(--max-width);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 40px;
  width: auto;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}

.brand-title span {
  color: var(--green);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s, background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  border: 2px solid transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--white);
  background: linear-gradient(var(--navy), var(--navy)) padding-box, 
              linear-gradient(var(--navy), var(--navy)) border-box;
  border: 2px solid transparent;
}

.btn-primary:hover {
  background: linear-gradient(var(--navy), var(--navy)) padding-box, 
              conic-gradient(from var(--wetec-angle), var(--red), var(--green), var(--navy), var(--red)) border-box;
  animation: wetec-border-spin 2.4s linear infinite;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(35, 54, 113, 0.4);
}

.btn-secondary {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(35, 54, 113, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.kicker {
  color: var(--green);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 900;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 32ch;
  position: relative;
}

.hero-title-gradient {
  background: linear-gradient(100deg, var(--navy) 0%, #2f6fd1 22%, var(--green) 42%, #2f6fd1 62%, var(--navy) 82%, #2f6fd1 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine-text 6s linear infinite;
}

@keyframes shine-text {
  to {
    background-position: 200% center;
  }
}

.sparkle-icon {
  width: 24px;
  height: 24px;
  color: #2f6fd1;
  animation: float-spark 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--body);
  max-width: 60ch;
  margin: 0 auto;
}

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 400px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Styles */
.app-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.42s var(--motion-ease), box-shadow 0.42s var(--motion-ease), border-color 0.42s var(--motion-ease);
  box-shadow: var(--shadow);
}

.app-card:hover {
  transform: translateY(-6px) scale(1.005);
  box-shadow: var(--shadow-hover);
  border-color: rgba(35, 54, 113, 0.15);
}

/* Card Glow Effect */
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--navy), var(--green));
  opacity: 0.8;
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s var(--motion-ease);
}

.app-card:hover .app-icon-wrapper {
  background: var(--soft-blue);
  transform: scale(1.05);
}

.app-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}

.app-title span {
  font-weight: 500;
  color: var(--green);
}

.app-desc {
  font-size: 0.9375rem;
  color: var(--body);
  line-height: 1.6;
  flex: 1;
}

.app-action {
  margin-top: auto;
  align-self: flex-start;
}

.btn-arrow {
  transition: transform 0.22s var(--motion-ease);
}

.app-card:hover .btn-arrow {
  transform: translateX(4px);
}

/* Disabled/Unavailable State */
.app-card.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.app-card.disabled::before {
  background: var(--muted);
}

.app-card.disabled .btn {
  background: var(--soft);
  color: var(--muted);
  border-color: transparent;
  cursor: default;
}

/* Footer Redesign */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 60px 20px 30px;
  margin-top: 60px;
}

.footer-top {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
}

.footer-brand img {
  height: 44px;
  width: auto;
  align-self: flex-start;
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--body);
  line-height: 1.6;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-contact h4 {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--body);
}

.contact-item svg {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-separator {
  max-width: var(--max-width);
  height: 1px;
  background: var(--line);
  margin: 0 auto 20px;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.22s ease;
}

.footer-links a:hover {
  color: var(--navy);
}

.version-text {
  font-family: monospace;
}

