/* =========================
   VR QA ACADEMY LAYOUT
========================= */

/* Prevent horizontal scroll everywhere */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ================= HEADER ================= */

.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;
  min-height: 64px;

  background: linear-gradient(90deg, var(--brand-blue-dark), var(--brand-blue), var(--brand-cyan));
  color: #fff;

  border-bottom: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);

  display: flex;
  align-items: center;
}

/* Inner container */
.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* ================= LEFT ================= */

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left img {
  height: 44px;
  width: auto;
}

/* Nav */
.nav-links {
  display: flex;
  gap: 18px;
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  opacity: 0.9;
}

.nav-links a:hover {
  opacity: 1;
}

/* ================= RIGHT ================= */

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Home button (BRANDED BLUE) */
.btn-home,
.header-right .btn-secondary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
  color: #fff;
  padding: 9px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: none;

  box-shadow: 0 6px 16px rgba(37,99,235,0.45);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn-home:hover,
.header-right .btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37,99,235,0.55);
  filter: brightness(1.05);
}

.btn-home:active,
.header-right .btn-secondary:active {
  transform: scale(.97);
}

/* ================= USER MENU ================= */

.user-menu {
  position: relative;
}

/* Avatar */
.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  cursor: pointer;
  background: #fff;

  transition: box-shadow .2s ease, transform .1s ease;
}

.avatar-btn:hover {
  box-shadow: 0 0 0 4px rgba(255,255,255,0.35);
  transform: translateY(-1px);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;

  background: var(--card);
  border-radius: 14px;
  min-width: 240px;

  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
  padding: 10px;

  border: 1px solid var(--border);

  z-index: 7000;

  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: all .18s ease;
}

.user-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-info {
  padding: 8px 10px;
}

.user-name {
  font-weight: 700;
}

.user-email {
  font-size: 13px;
  color: var(--muted);
}

.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.dropdown-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.dropdown-item:hover {
  background: rgba(249,115,22,0.15);
}

.dropdown-item.danger {
  color: var(--danger);
}

/* ================= PAGE CONTAINERS ================= */

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

/* ================= GRID SYSTEM ================= */

.card {
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}

/* Responsive: 1 column */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ================= FOOTER NAV ================= */

.lab-nav-footer {
  max-width: 1200px;
  margin: 32px auto 16px;
  padding: 0 24px;

  display: flex;
  justify-content: space-between;
}

/* ================= GLOBAL PAGE SPACING ================= */

main,
.main,
.container,
.dashboard {
  padding-top: 24px;
}

/* ================= FOOTER ================= */

.site-footer {
  margin: 24px auto;
  text-align: center;
  color: var(--muted);
}

/* ================= RESPONSIVE ================= */

/* ---------- Small laptops & tablets ---------- */
@media (max-width: 1024px) {

  .header-inner {
    padding: 10px 16px;
  }

  .container,
  .dashboard {
    padding-left: 16px;
    padding-right: 16px;
  }

}

/* ---------- Tablets & large phones ---------- */
@media (max-width: 768px) {

  .nav-links {
    display: none; /* hide big menu */
  }

  .header-left {
    gap: 10px;
  }

  .header-left img {
    height: 36px;
  }

  .btn-home,
  .header-right .btn-secondary {
    padding: 8px 12px;
    font-size: 14px;
  }

  .container,
  .dashboard {
    padding: 16px 12px 24px;
  }

  .lab-nav-footer {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {

  .header-inner {
    padding: 8px 10px;
  }

  .header-left img {
    height: 32px;
  }

  .btn-home,
  .header-right .btn-secondary {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 10px;
  }

  .avatar-btn {
    width: 34px;
    height: 34px;
  }

  .container,
  .dashboard {
    padding: 12px 10px 20px;
  }

  .site-footer {
    font-size: 13px;
    padding: 0 10px;
  }

}


/* ================= MOBILE HEADER EXTENSION ================= */

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #fff;
}

/* Mobile nav panel */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--brand-blue-dark), var(--brand-blue));
  border-top: 1px solid rgba(255,255,255,.2);
}

.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0;
}

.mobile-nav input {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  outline: none;
}

/* Show mobile menu */
.mobile-nav.show {
  display: flex;
}

/* ========== RESPONSIVE HEADER SWITCH ========== */
@media (max-width: 768px) {

  .nav-links {
    display: none !important;
  }

  .hamburger {
    display: block;
  }

}

/* ================= GLOBAL RESPONSIVE LAYOUT ================= */

/* Stack grid on small screens */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr !important;
  }
}

/* Containers padding */
@media (max-width: 768px) {
  .container,
  .dashboard {
    padding: 12px !important;
  }
}
