/* ===================================================================
   TRƯỜNG TRUNG HỌC PHỔ THÔNG TRÍ TUỆ VIỆT (VIET INTELLECT SCHOOL)
   Stylesheet chính - Responsive, Hiện đại, Chuẩn SEO
   =================================================================== */

:root {
  /* Bảng màu chính */
  --primary: #1e3a8a;          /* Xanh Navy chủ đạo */
  --primary-dark: #0f172a;     /* Xanh đen đậm */
  --primary-light: #2563eb;    /* Xanh lam sáng */
  --primary-soft: #eff6ff;     /* Xanh nền nhạt */
  
  --accent: #f59e0b;           /* Vàng kim / Amber điểm nhấn */
  --accent-hover: #d97706;
  --accent-soft: #fef3c7;
  
  --secondary: #0d9488;        /* Xanh mòng két học thuật */
  --secondary-light: #ccfbf1;
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0284c7;

  /* Màu nền & Chữ */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Hiệu ứng bóng đổ */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Bo góc & Chuyển động */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Khung chiều rộng tối đa */
  --container-max: 1240px;
}

/* -------------------------------------------------------------
   RESET & CƠ BẢN
------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* -------------------------------------------------------------
   CONTAINER & LAYOUT CƠ BẢN
------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.section-sm {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.section-bg {
  background-color: #f1f5f9;
}

.section-title-wrap {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
}

.section-subtitle {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-light);
  background: var(--primary-soft);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   HEADER & TOP BAR
------------------------------------------------------------- */
.top-bar {
  background-color: var(--primary-dark);
  color: #cbd5e1;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.top-info a, .top-info span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
}

.top-info a:hover {
  color: var(--accent);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-links a {
  color: #cbd5e1;
  font-size: 0.825rem;
}

.top-links a:hover {
  color: var(--accent);
}

/* Main Navigation */
.header-main {
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header-main.is-scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Nav Menu Desktop */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-item.active > .nav-link {
  color: var(--primary-light);
  background-color: var(--primary-soft);
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-link:hover, .dropdown-link.active {
  background-color: var(--primary-soft);
  color: var(--primary-light);
  padding-left: 1.5rem;
}

/* Header Action Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-search-trigger {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.btn-search-trigger:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-main);
  border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------
   BUTTONS & BADGES
------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-accent {
  background-color: var(--accent);
  color: #1f2937;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

.btn-white {
  background: white;
  color: var(--primary-dark);
  font-weight: 700;
}

.btn-white:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: var(--accent-hover); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* -------------------------------------------------------------
   PAGE HERO / BANNER HEADER CHO CÁC TRANG CON
------------------------------------------------------------- */
.page-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 3.5rem 0;
  position: relative;
  overflow: hidden;
}

.page-banner::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.page-banner-inner {
  position: relative;
  z-index: 1;
}

.page-banner-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.page-banner-desc {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 680px;
  margin-bottom: 1.25rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.breadcrumb a {
  color: #e2e8f0;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span.sep {
  opacity: 0.5;
}

.breadcrumb span.current {
  color: var(--accent);
  font-weight: 600;
}

/* -------------------------------------------------------------
   CARDS & GRIDS
------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* -------------------------------------------------------------
   FORMS & INPUTS
------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-label .req {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* -------------------------------------------------------------
   FOOTER
------------------------------------------------------------- */
.footer {
  background-color: var(--primary-dark);
  color: #94a3b8;
  padding-top: 4.5rem;
  border-top: 4px solid var(--accent);
}

.footer-top {
  padding-bottom: 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
  gap: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand .logo-name {
  color: white;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.footer-socials {
  display: flex;
  gap: 0.65rem;
}

.social-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--accent);
  color: var(--primary-dark);
  transform: translateY(-3px);
}

.footer-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 3px;
  background-color: var(--accent);
  border-radius: var(--radius-full);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
  color: #cbd5e1;
}

.footer-bottom {
  padding: 1.5rem 0;
  font-size: 0.85rem;
  text-align: center;
  color: #64748b;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* -------------------------------------------------------------
   FLOATING ACTION BUTTONS
------------------------------------------------------------- */
.floating-actions {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999;
}

.fab-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  color: white;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.fab-btn:hover {
  transform: scale(1.1);
}

.fab-phone {
  background: #16a34a;
  animation: pulse-ring 2s infinite;
}

.fab-top {
  background: var(--primary);
  opacity: 0;
  visibility: hidden;
}

.fab-top.show {
  opacity: 1;
  visibility: visible;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* -------------------------------------------------------------
   MODAL POPUP
------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN BREAKPOINTS
------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .btn-mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 5rem 1.5rem 2rem 1.5rem;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: 0.35s ease;
    overflow-y: auto;
    z-index: 1050;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-item {
    border-bottom: 1px solid var(--border-color);
  }

  .nav-link {
    padding: 0.85rem 0;
    justify-content: space-between;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    display: none;
    margin-bottom: 0.5rem;
  }

  .nav-item.dropdown-open .nav-dropdown {
    display: block;
  }

  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .mobile-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 768px) {
  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .page-banner-title {
    font-size: 1.85rem;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .nav-menu {
    width: 100%;
  }
}
