@import url('variables.css');

/* 1. Global Resets and Document Framework */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100dvh;
  overflow: hidden;
}

/* Scrollbar Custom Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--color-secondary-accent);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-accent);
}

/* Typography Utility Classes */
.text-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.text-mono {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* 2. Split-Screen Identity & Landing Layout (Login) */
.landing-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.landing-left-pane {
  width: 35%;
  min-width: 380px;
  background-color: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
}

.landing-right-pane {
  width: 65%;
  background-color: var(--color-primary-accent);
  background-image: 
    radial-gradient(circle at 30% 20%, rgba(152, 193, 217, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(30, 41, 59, 0.35) 0%, transparent 70%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Clean Mid-Century Geometric Graphics Backdrop on Right Side */
.bg-graphic-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(152, 193, 217, 0.15) 61%, transparent 62%),
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(152, 193, 217, 0.1) 41%, transparent 42%),
    radial-gradient(circle at 50% 50%, transparent 20%, rgba(152, 193, 217, 0.1) 21%, transparent 22%),
    linear-gradient(var(--color-secondary-accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-secondary-accent) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-position: center;
}

.geometric-art-container {
  position: relative;
  width: 420px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Core central dot */
.central-core {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--color-secondary-accent) 70%);
  box-shadow: 0 0 24px rgba(152, 193, 217, 0.6), 0 0 48px rgba(61, 90, 128, 0.4);
  z-index: 10;
  animation: core-pulse 4s ease-in-out infinite;
}

/* Expanding ripple lines */
.central-ripple {
  position: absolute;
  border: 1.5px solid var(--color-secondary-accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.central-ripple-1 {
  animation: ripple 6s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}
.central-ripple-2 {
  animation: ripple 6s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  animation-delay: 3s;
}

/* Rotating Orbits */
.geo-orbit {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.geo-orbit-inner {
  width: 160px;
  height: 160px;
  border: 1.5px dashed var(--color-dark-graphic-ring);
  border-top-color: var(--color-secondary-accent);
  border-bottom-color: var(--color-secondary-accent);
  animation: spin-clockwise 20s linear infinite;
  z-index: 4;
}

.geo-orbit-middle {
  width: 260px;
  height: 260px;
  border: 2px solid transparent;
  border-top-color: var(--color-primary-accent);
  border-bottom-color: var(--color-primary-accent);
  animation: spin-counterclockwise 28s linear infinite;
  z-index: 3;
}

.geo-orbit-outer {
  width: 360px;
  height: 360px;
  border: 1px dotted rgba(152, 193, 217, 0.35);
  z-index: 2;
}

/* Orbiting Nodes (Data Packets) */
.geo-node-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.geo-node-container-1 {
  animation: spin-clockwise 18s linear infinite;
}
.geo-node-container-2 {
  animation: spin-clockwise 25s linear infinite;
}
.geo-node-container-3 {
  animation: spin-counterclockwise 32s linear infinite;
}

.geo-node {
  position: absolute;
  top: -6px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-secondary-accent);
  box-shadow: 0 0 12px var(--color-secondary-accent), 0 0 4px #ffffff;
}

.geo-node-primary {
  background-color: var(--color-primary-accent);
  box-shadow: 0 0 12px var(--color-primary-accent), 0 0 4px #ffffff;
}

.geo-node-container-2 .geo-node {
  top: auto;
  bottom: -6px;
}

.geo-node-container-3 .geo-node {
  left: -6px;
  top: calc(50% - 6px);
}

/* Animations */
@keyframes spin-clockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-counterclockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes core-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 24px rgba(152, 193, 217, 0.6), 0 0 48px rgba(61, 90, 128, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 36px rgba(152, 193, 217, 0.8), 0 0 72px rgba(61, 90, 128, 0.6);
  }
}

@keyframes ripple {
  0% {
    width: 56px;
    height: 56px;
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    width: 56px;
    height: 56px;
    opacity: 0;
    transform: scale(3.5);
  }
}

/* Responsive collapse rules for login screen */
@media (max-width: 767px) {
  body {
    height: auto;
    overflow-y: auto;
  }
  .landing-container {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .landing-left-pane {
    width: 100%;
    min-width: 0;
    border-right: none;
    padding: 2.5rem 1.5rem;
    height: auto;
    min-height: 100dvh;
  }
  .landing-right-pane {
    display: none;
  }
  .portal-scroll-container {
    overflow-y: visible;
  }
}

/* 7. General UI Components (Buttons, inputs, alerts) */
.btn {
  height: var(--interactive-height);
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 200ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary-accent);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #2b3f5c;
}

.btn-secondary {
  background-color: var(--color-bg-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}
.btn-secondary:hover {
  background-color: var(--color-neutral-shaded);
  border-color: var(--color-secondary-accent);
}

.btn-lg-sso {
  width: 100%;
  height: 48px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 0.95rem;
}
.btn-lg-sso:hover {
  border-color: var(--color-primary-accent);
  background-color: var(--color-neutral-shaded);
}

/* Alert panels */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.alert-error {
  background-color: rgba(238, 108, 77, 0.08);
  border-color: rgba(238, 108, 77, 0.2);
  color: #c94f31;
}
.alert-info {
  background-color: rgba(152, 193, 217, 0.08);
  border-color: rgba(152, 193, 217, 0.2);
  color: #2b567d;
}

/* Helper utility styling */
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.mr-auto { margin-right: auto; }
.ml-auto { margin-left: auto; }

/* 8. Portal Dashboard Components */
.portal-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin: 1.5rem 0;
}
.portal-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.portal-section-title:first-of-type {
  margin-top: 0.5rem;
}
.portal-list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.portal-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 150ms ease;
  background-color: var(--color-bg-surface);
}
.portal-item-card:hover {
  border-color: var(--color-primary-accent);
  background-color: var(--color-neutral-shaded);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.portal-item-card:active {
  transform: translateY(0);
}
.portal-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  object-fit: contain;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  padding: 2px;
  flex-shrink: 0;
}
.portal-item-icon-placeholder {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.portal-item-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portal-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.25;
}
.portal-item-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

