/* --- NEC Brand Identity Framework --- */
:root {
  --nec-blue: #005CB9;
  --nec-dark: #003882;
  --nec-gray: #F4F7F9;
  --text-main: #1A1A1A;
  --text-secondary: #4A4A4A;
  --border-color: #E5E7EB;
  --white: #FFFFFF;
  --danger: #DC2626;
  --radius-sm: 4px;
}

*, *::before, *::after { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--white);
  line-height: 1.6;
  transition: background-image 0.5s ease;
}

/* --- Authentication Background States --- */
.login-bg { 
  background: linear-gradient(135deg, var(--nec-dark) 0%, var(--nec-blue) 100%); 
}

.portal-bg { 
  background-color: var(--white); 
}

/* --- Centered Login Gate --- */
.gate {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center; /* Vertical Center */
  justify-content: center; /* Horizontal Center */
  padding: 20px;
}

.gate-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.gate-card h2 {
  font-size: 24px;
  color: var(--nec-blue);
  margin-bottom: 12px;
}

.gate-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

#gate-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

#gate-form button {
  background: var(--nec-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

#gate-form button:hover {
  background: var(--nec-dark);
}

.gate-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 18px;
  margin-top: 5px;
}

/* --- Global Header & Multi-Page Nav --- */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nec-logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--nec-blue);
  letter-spacing: -1px;
}

.vertical-divider {
  height: 24px;
  width: 1px;
  background: #CCC;
}

.portal-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.nav {
  display: flex;
  gap: 5px;
}

.nav-link { 
  text-decoration: none; 
  color: var(--text-main); 
  font-size: 13px; 
  font-weight: 600; 
  padding: 10px 18px; 
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active { 
  color: var(--nec-blue); 
  background: var(--nec-gray); 
}

.nav-logout { 
  color: var(--danger) !important; 
  margin-left: 15px; 
  border-left: 1px solid var(--border-color);
  padding-left: 25px;
}

/* --- Layout Components --- */
.hero {
  background: var(--nec-gray);
  padding: 80px 20px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.hero h1 {
  color: var(--nec-blue);
  font-size: 36px;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

.hero p {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  font-size: 18px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px;
}

/* --- Innovation 2x2 Grid (NEW REQUIREMENT) --- */
.innovation-2x2-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2x2 Requirement */
  gap: 40px;
  max-width: 950px;
  margin: 0 auto;
}

.innovation-card {
  background: var(--white);
  padding: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center; /* Centralize Pictures & Content */
  text-align: center;
  transition: all 0.3s ease;
}

.innovation-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border-color: var(--nec-blue);
  transform: translateY(-4px);
}

.inn-image-wrapper {
  width: 100%;
  height: 220px;
  display: flex;
  justify-content: center; /* Centers image horizontally */
  align-items: center;     /* Centers image vertically */
  margin-bottom: 25px;
}

.central-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Ensures photo isn't cut off */
  display: block;
}

.inn-content h3 {
  color: var(--nec-blue);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.inn-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 340px;
  margin: 0 auto;
}

/* --- Knowledge Hub / Blog Styles --- */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;
}

.blog-card:hover { border-color: var(--nec-blue); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.blog-image {
  height: 200px;
  background: #EEE;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blog-image img { width: 100%; height: 100%; object-fit: cover; }

.blog-content { padding: 24px; }
.blog-content h4 { font-size: 18px; margin-bottom: 10px; color: var(--nec-blue); }

/* --- Modals --- */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); }
.modal-body { position: relative; background: var(--white); width: 100%; max-width: 900px; border-radius: var(--radius-sm); overflow: hidden; }
.modal-video { width: 100%; display: block; }

/* --- Footer --- */
.footer {
  padding: 40px 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--nec-gray);
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
  .innovation-2x2-grid { grid-template-columns: 1fr; } /* Stack for mobile */
  .header-container { flex-direction: column; gap: 15px; }
}

.hidden { display: none !important; }

/* --- Embedded Training Segments --- */
.training-segment {
  padding-top: 40px;
  padding-bottom: 40px;
  max-width: 900px; /* Constrains width so it's easy to read/watch */
  margin: 0 auto;
}

.segment-title {
  color: var(--nec-blue);
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 10px;
}

.segment-desc {
  color: var(--text-secondary);
  margin-bottom: 25px;
  font-size: 16px;
}

/* Adds a subtle NEC-gray frame around the embedded content */
.media-wrapper {
  background: var(--nec-gray);
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.embedded-video {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  background: #000; /* Fallback background for video */
}

.embedded-pdf {
  width: 100%;
  height: 75vh; /* Responsive height based on user's screen */
  min-height: 500px;
  border: none;
  border-radius: var(--radius-sm);
  display: block;
}

.segment-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  max-width: 900px;
  margin: 0 auto;
}