/* ============================================
   DAMTEC GPS - Login Page v2
   Layout redesign 2026
   Video + Banner on top, Grid below + Lightbox
   ============================================ */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #0d1117;
  overflow: hidden;
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
#login-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ============================================
   LEFT PANEL
   ============================================ */
#left-panel {
  flex: 1 1 0;
  background: #0d1117;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* --- Topbar --- */
#topbar {
  background: #16213e;
  color: #e0e8f0;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #0f3460;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

#topbar .topbar-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #4fc3f7, #0277bd);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* --- Banner thông báo chạy chữ --- */
#banner {
  background: linear-gradient(90deg, #0f2944 0%, #1a3a5c 40%, #0f2944 100%);
  border-bottom: 2px solid #1a6fa8;
  border-top: 2px solid #1a6fa8;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(41, 182, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#banner-inner {
  display: flex;
  align-items: center;
  height: 38px;
  overflow: hidden;
}

.banner-tag {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 20px 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
}

.banner-ticker-wrap {
  flex: 1;
  overflow: hidden;
  padding: 0 12px;
}

.banner-ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 18s linear infinite;
  color: #e0f0ff;
  font-size: 13px;
  font-weight: 500;
}

.banner-ticker strong {
  color: #4fc3f7;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.6);
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* --- Video Area --- */
#video-area {
  flex: 0 0 320px;
  padding: 4px;
  background: #0d1117;
  min-height: 0;
}

#video-area video {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #111;
}

/* --- Image Grid 3x2 --- */
#media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  flex: 1 1 0;
  padding: 3px;
  background: #0d1117;
  min-height: 0;
}

#media-grid .grid-item {
  overflow: hidden;
  border-radius: 5px;
  background: #1a2030;
  position: relative;
  min-height: 0;
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
}

#media-grid .grid-item:hover {
  transform: scale(1.03);
  box-shadow: 0 0 0 2px #29b6f6, 0 4px 20px rgba(41, 182, 246, 0.3);
  z-index: 2;
}

#media-grid .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

#media-grid .grid-item .label-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: #fff;
  font-size: 11px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  padding: 16px 8px 5px;
  pointer-events: none;
}

/* --- Footer --- */
#footer {
  background: #16213e;
  color: #556677;
  text-align: center;
  padding: 5px;
  font-size: 11px;
  flex-shrink: 0;
}

/* ============================================
   RIGHT PANEL - Login Form
   ============================================ */
#right-panel {
  flex: 0 0 360px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.13);
  overflow-y: auto;
}

/* --- Logo Area --- */
#logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

#logo-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #4fc3f7 0%, #0277bd 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(2, 119, 189, 0.30);
}

#logo-text .brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
}

#logo-text .brand-sub {
  font-size: 10.5px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}

/* --- Form Title --- */
#form-title {
  font-size: 23px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 5px;
}

#form-subtitle {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 26px;
}

/* --- Input Groups --- */
.input-group {
  position: relative;
  margin-bottom: 14px;
}

.input-group input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #e4e8ee;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #f8f9fb;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  border-color: #29b6f6;
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.13);
  background: #fff;
}

.input-group input::placeholder {
  color: #c0c8d4;
}

.input-group .inp-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b8c4;
  font-size: 14px;
  pointer-events: none;
  line-height: 1;
}

/* --- Login Button --- */
#login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, #29b6f6 0%, #0277bd 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(2, 119, 189, 0.25);
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.1s;
}

#login-btn:hover {
  opacity: 0.93;
  box-shadow: 0 6px 18px rgba(2, 119, 189, 0.35);
  transform: translateY(-1px);
}

#login-btn:active {
  transform: translateY(0);
}

/* --- Hotline Info --- */
#hotline {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
  color: #666;
  line-height: 2;
}

#hotline .phone {
  color: #0277bd;
  font-weight: 700;
}

/* ============================================
   LIGHTBOX
   ============================================ */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
}

#lightbox-overlay.active {
  display: flex;
  animation: lb-fadein 0.25s ease;
}

@keyframes lb-fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Close button */
#lb-close {
  position: absolute;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#lb-close:hover {
  opacity: 1;
  transform: rotate(90deg);
  background: rgba(231, 76, 60, 0.6);
}

/* Counter */
#lb-counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 500;
}

/* Image wrap */
#lb-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 82vw;
  max-height: 80vh;
}

#lb-img {
  max-width: 78vw;
  max-height: 76vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  object-fit: contain;
  display: block;
  animation: lb-zoomin 0.3s cubic-bezier(.22, .68, 0, 1.2);
}

@keyframes lb-zoomin {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Nav buttons */
.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.lb-nav-btn:hover {
  background: rgba(41, 182, 246, 0.45);
  transform: translateY(-50%) scale(1.1);
}

#lb-prev {
  left: -70px;
}

#lb-next {
  right: -70px;
}

/* Label */
#lb-label {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: #e0f0ff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Dots */
#lb-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.lb-dot.active {
  background: #29b6f6;
  transform: scale(1.35);
}

.lb-dot:hover {
  background: rgba(255, 255, 255, 0.65);
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {

  html,
  body {
    overflow: auto;
  }

  #login-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  #left-panel {
    flex: none;
    height: 60vh;
    order: 2;
  }

  #right-panel {
    flex: none;
    width: 100%;
    padding: 36px 28px;
    box-shadow: none;
    order: 1;
  }

  #media-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }

  #video-area {
    flex: 0 0 140px;
  }

  #lb-prev {
    left: -50px;
  }

  #lb-next {
    right: -50px;
  }
}