/**
 * Connect Instruments LLC - Corporate Split Gateway (index2.html)
 * High-Performance Responsive Architecture for Web, Tablet, and Mobile
 * - Left Side: Fleet Management & GPS Tracking (#10B981)
 * - Right Side: Industrial Automation (#008FCB)
 */

:root {
  --ci-blue: #008FCB;
  --ci-blue-dark: #006fa0;
  --ci-blue-glow: rgba(0, 143, 203, 0.45);
  --ci-blue-subtle: rgba(0, 143, 203, 0.15);
  --ci-red: #D92332;
  --ci-red-dark: #b51b27;
  --ci-red-glow: rgba(217, 35, 50, 0.45);
  --ci-red-subtle: rgba(217, 35, 50, 0.15);
  --ci-navy: #102A43;
  --ci-navy-dark: #07131f;
  --ci-navy-light: #162c46;
  --ci-white: #ffffff;
  --ci-text-muted: #94a3b8;
  --ci-header-h: 105px;
  --ci-footer-h: 46px;
  --ci-transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base Viewport Normalization */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Poppins", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--ci-navy-dark);
  color: var(--ci-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==============================================================================
   1. FIXED CORPORATE HEADER
============================================================================== */
.split-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ci-header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

.split-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.split-logo img {
  height: clamp(68px, 6.5vw, 92px);
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
  transition: transform 0.3s ease;
}

.split-logo:hover img {
  transform: scale(1.03);
}

.split-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.split-header-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.split-header-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 14px);
  flex-shrink: 0;
}

.split-header-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px clamp(10px, 1.2vw, 16px);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: var(--ci-transition);
  white-space: nowrap;
  min-height: 38px;
}

.split-header-btn.btn-complaint {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.split-header-btn.btn-complaint:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.split-header-btn.btn-live {
  background: rgba(0, 143, 203, 0.18);
  border: 1px solid rgba(0, 143, 203, 0.4);
  color: #38bdf8;
}

.split-header-btn.btn-live:hover {
  background: var(--ci-blue);
  color: #ffffff;
  border-color: var(--ci-blue);
  transform: translateY(-1px);
}

.split-header-btn.btn-phone {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
}

.split-header-btn.btn-phone:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

/* ==============================================================================
   2. MAIN SPLIT PORTAL (DESKTOP DEFAULT)
============================================================================== */
.split-portal {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  overflow: hidden;
  background-color: var(--ci-navy-dark);
}

/* Center Dividing Line & Badge */
.split-center-divider {
  position: absolute;
  top: var(--ci-header-h);
  bottom: var(--ci-footer-h);
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.25) 15%, rgba(255, 255, 255, 0.25) 85%, transparent 100%);
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.split-center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  background: rgba(7, 19, 31, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.4s ease;
}

/* Half Panel */
.split-side {
  position: relative;
  flex: 1 1 50%;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(var(--ci-header-h) + 20px) clamp(24px, 4vw, 60px) calc(var(--ci-footer-h) + 20px) clamp(24px, 4vw, 60px);
  text-decoration: none;
  color: var(--ci-white);
  overflow: hidden;
  transition: flex 0.65s cubic-bezier(0.2, 0.9, 0.3, 1), width 0.65s cubic-bezier(0.2, 0.9, 0.3, 1);
  cursor: pointer;
  outline: none;
}

.split-side:focus-visible {
  box-shadow: inset 0 0 0 3px var(--ci-white);
}

/* Background image layers */
.split-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

.split-side.fleet .split-bg {
  background-image: url('../img/bg-gps-satellite.webp');
}

.split-side.automation .split-bg {
  background-image: url('../img/bg-scada-automation.webp');
}

/* Layered Gradients */
.split-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  transition: background 0.5s ease;
}

.split-side.fleet .split-overlay {
  background: linear-gradient(135deg, rgba(7, 19, 31, 0.93) 0%, rgba(16, 42, 67, 0.85) 50%, rgba(217, 35, 50, 0.35) 100%);
}

.split-side.automation .split-overlay {
  background: linear-gradient(225deg, rgba(7, 19, 31, 0.93) 0%, rgba(16, 42, 67, 0.85) 50%, rgba(0, 143, 203, 0.35) 100%);
}

/* Hover Expansion: 75% for hovered side, 25% for other side (Desktop only) */
@media (hover: hover) and (min-width: 992px) {
  .split-portal:hover .split-side {
    flex: 1 1 25%;
    width: 25%;
  }

  .split-side:hover {
    flex: 3 1 75% !important;
    width: 75% !important;
  }

  /* Fade out center line and badge during 75/25 expansion */
  .split-portal:hover .split-center-divider,
  .split-portal:hover .split-center-badge {
    opacity: 0;
    pointer-events: none;
  }

  .split-side:hover .split-bg {
    transform: scale(1.06);
  }

  .split-side.fleet:hover .split-overlay {
    background: linear-gradient(135deg, rgba(7, 19, 31, 0.86) 0%, rgba(16, 42, 67, 0.76) 45%, rgba(217, 35, 50, 0.45) 100%);
  }

  .split-side.automation:hover .split-overlay {
    background: linear-gradient(225deg, rgba(7, 19, 31, 0.86) 0%, rgba(16, 42, 67, 0.76) 45%, rgba(0, 143, 203, 0.45) 100%);
  }

  /* Shrunken side (25%) graceful styling */
  .split-portal:hover .split-side:not(:hover) .split-content {
    opacity: 0.68;
    transform: scale(0.93);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .split-portal:hover .split-side:not(:hover) .split-title {
    font-size: clamp(1.4rem, 2vw, 1.9rem);
  }

  .split-portal:hover .split-side:not(:hover) .split-tagline {
    font-size: 12.5px;
    opacity: 0.75;
  }

  /* Expanded side (75%) enhanced styling */
  .split-side:hover .split-content {
    max-width: 660px;
    transform: translateY(-8px) scale(1.02);
  }

  .split-side:hover .split-title {
    font-size: clamp(2.3rem, 3.6vw, 3.2rem);
  }

  .split-side:hover .split-cta-btn {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .split-side:hover .split-cta-btn i {
    transform: translateX(4px);
  }
}

/* Side Content Card */
.split-content {
  position: relative;
  z-index: 10;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease;
}

/* Pill Badge */
.split-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  align-self: flex-start;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.split-side.fleet .split-pill {
  background: rgba(217, 35, 50, 0.2);
  border: 1px solid rgba(217, 35, 50, 0.5);
  color: #fca5a5;
}

.split-side.automation .split-pill {
  background: rgba(0, 143, 203, 0.2);
  border: 1px solid rgba(0, 143, 203, 0.5);
  color: #38bdf8;
}

/* Title */
.split-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
  color: var(--ci-white);
}

.split-side.fleet .split-title span {
  color: #ff4d4f;
}

.split-side.automation .split-title span {
  color: #38bdf8;
}

/* Subtitle Tagline - Always constant and visible */
.split-tagline {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Feature Check Tags - Hidden by default, animated in when mouse enters that side */
.split-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  transform: translateY(14px);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              margin-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animate Tags in smoothly when mouse cursor hovers this side */
.split-side:hover .split-tags {
  opacity: 1;
  max-height: 140px;
  margin-bottom: 24px;
  transform: translateY(0);
  pointer-events: auto;
}

.split-tag-item {
  font-size: clamp(11.5px, 0.95vw, 12.5px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px;
  border-radius: 6px;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--ci-transition);
}

.split-side.fleet .split-tag-item i {
  color: var(--ci-red);
}

.split-side.automation .split-tag-item i {
  color: var(--ci-blue);
}

/* Enter Action Button */
.split-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(11px, 1.2vw, 14px) clamp(18px, 1.8vw, 26px);
  border-radius: 10px;
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 14.5px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: var(--ci-transition);
  align-self: flex-start;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  min-height: 44px;
}

.split-side.fleet .split-cta-btn {
  background: var(--ci-red);
  color: var(--ci-white);
  border: 1px solid var(--ci-red);
}

.split-side.fleet:hover .split-cta-btn {
  background: var(--ci-red-dark);
  border-color: var(--ci-red-dark);
  box-shadow: 0 8px 24px var(--ci-red-glow);
}

.split-side.automation .split-cta-btn {
  background: var(--ci-blue);
  color: var(--ci-white);
  border: 1px solid var(--ci-blue);
}

.split-side.automation:hover .split-cta-btn {
  background: var(--ci-blue-dark);
  border-color: var(--ci-blue-dark);
  box-shadow: 0 8px 24px var(--ci-blue-glow);
}

.split-cta-btn i {
  font-size: 17px;
  transition: transform 0.3s ease;
}

/* ==============================================================================
   3. FIXED CORPORATE FOOTER
============================================================================== */
.split-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--ci-footer-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  background: rgba(7, 19, 31, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: #94a3b8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.split-footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.split-footer a:hover {
  color: var(--ci-white);
}

/* ==============================================================================
   4. RESPONSIVE BREAKPOINTS (TABLETS & MOBILE)
============================================================================== */

/* Tablet Landscape & Compact Laptops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .split-side {
    padding: 85px 32px 55px 32px;
  }
  .split-tags .split-tag-item:nth-child(n+5) {
    display: none;
  }
}

/* Tablet Portrait & Large Phones (768px - 991.98px) */
@media (max-width: 991.98px) {
  :root {
    --ci-header-h: 88px;
    --ci-footer-h: auto;
  }

  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .split-logo img {
    height: 68px;
  }

  .split-header-badge {
    display: none;
  }

  .split-center-divider,
  .split-center-badge {
    display: none;
  }

  .split-portal {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-top: var(--ci-header-h);
    overflow: visible;
  }

  .split-side {
    width: 100%;
    min-height: 48vh;
    padding: 40px 30px;
    justify-content: center;
  }

  .split-content {
    max-width: 600px;
  }

  .split-tags {
    opacity: 1;
    max-height: none;
    transform: none;
    margin-bottom: 20px;
    pointer-events: auto;
  }

  .split-footer {
    position: static;
    padding: 14px 20px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 12px;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 767.98px) {
  :root {
    --ci-header-h: 74px;
  }

  .split-header {
    padding: 0 14px;
  }

  .split-logo img {
    height: clamp(50px, 12vw, 62px);
  }

  .split-header-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
    border-radius: 6px;
  }

  .split-header-btn.btn-phone span {
    font-size: 11.5px;
  }

  .split-side {
    min-height: auto;
    padding: 34px 18px;
  }

  .split-content {
    max-width: 100%;
  }

  .split-title {
    font-size: 1.55rem;
    margin-bottom: 6px;
  }

  .split-tagline {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .split-tags {
    gap: 6px;
    margin-bottom: 16px;
  }

  .split-tag-item {
    font-size: 11px;
    padding: 3px 8px;
  }

  .split-cta-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 13.5px;
    border-radius: 8px;
  }
}

/* Small Handhelds (< 420px) */
@media (max-width: 419.98px) {
  .split-header-btn span {
    display: none;
  }

  .split-header-btn {
    padding: 8px 10px;
  }

  .split-header-btn.btn-phone span {
    display: inline;
    font-size: 11px;
  }

  .split-title {
    font-size: 1.4rem;
  }

  .split-tags .split-tag-item:nth-child(n+5) {
    display: none;
  }
}
