/* ==========================================================================
   DAOTAO.HANBASE.NET — MODERN AVIATION PORTAL STYLESHEET
   Colors:
   - Royal Blue Dark: #10275B
   - Secondary Blue:  #173878
   - App Icon Blue:   #1C5392
   - Bright Yellow:   #FFD329
   - White:           #FFFFFF
   - Light Blue-Grey: #EDF2FA
   Font: Roboto (300, 400, 500)
   ========================================================================== */

:root {
  --royal-dark: #10275B;
  --royal-secondary: #173878;
  --icon-blue: #1C5392;
  --accent-yellow: #FFD329;
  --accent-yellow-hover: #F5C400;
  --bg-page: #EDF2FA;
  --bg-white: #FFFFFF;
  --text-primary: #10275B;
  --text-secondary: #4A5B82;
  --text-muted: #6E7E9F;
  --border-light: #D6E1F2;
  --border-card: #E2EAF6;
  --shadow-soft: 0 4px 14px rgba(16, 39, 91, 0.06);
  --shadow-hover: 0 10px 24px rgba(16, 39, 91, 0.13);
  --radius-card: 14px;
  --radius-group: 16px;
  --transition-fast: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  overflow-x: hidden;
  line-height: 1.5;
}

/* ==========================================================================
   HEADER (Royal Blue #10275B, Single-line Title + Right "Tải App" Button)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--royal-dark) 0%, var(--royal-secondary) 100%);
  border-bottom: 3px solid var(--accent-yellow);
  box-shadow: 0 3px 12px rgba(16, 39, 91, 0.18);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--bg-white);
}

.brand-wrap:focus-visible {
  outline: 2px solid var(--accent-yellow);
  outline-offset: 4px;
  border-radius: 8px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.site-title {
  font-size: clamp(16px, 3.8vw, 22px);
  font-weight: 500;
  color: var(--bg-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.btn-install-app {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-install-app:hover {
  background-color: var(--accent-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.btn-install-app:active {
  transform: translateY(0);
}

.btn-install-app:focus-visible {
  outline: 2px solid var(--bg-white);
  outline-offset: 2px;
}

.btn-install-app svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ==========================================================================
   MAIN CONTAINER & SEARCH BAR
   ========================================================================== */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.search-section {
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--royal-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 13px 90px 13px 46px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--royal-dark);
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.search-input:focus {
  outline: none;
  border-color: var(--royal-secondary);
  box-shadow: 0 0 0 3px rgba(23, 56, 120, 0.14);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-page);
  color: var(--royal-dark);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-clear-search:hover {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.btn-clear-search:focus-visible {
  outline: 2px solid var(--royal-dark);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   TEST GROUPS (3 DISTINCT AREAS: BANK CAAV, BANK EASA, LỚP HỌC KHÁC)
   ========================================================================== */
.groups-wrapper {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.group-section {
  border-radius: var(--radius-group);
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

/* Group 1: Bank CAAV — Light blue-grey surface, Deep Royal Blue header bar */
.group-caav {
  background-color: #E4ECF8;
  border: 1px solid #C8D7EE;
  box-shadow: 0 2px 10px rgba(16, 39, 91, 0.04);
}

.group-caav .group-header {
  background: linear-gradient(90deg, var(--royal-dark) 0%, var(--royal-secondary) 100%);
  color: var(--bg-white);
  border-bottom: 3px solid var(--accent-yellow);
}

/* Group 2: Bank EASA — Crisp white/soft surface with Bright Yellow accent bar */
.group-easa {
  background-color: var(--bg-white);
  border: 1.5px solid #D5E0F2;
  border-left: 5px solid var(--accent-yellow);
  box-shadow: 0 4px 16px rgba(16, 39, 91, 0.05);
}

.group-easa .group-header {
  background: linear-gradient(90deg, #F6F9FE 0%, #EDF2FA 100%);
  color: var(--royal-dark);
  border-bottom: 2px solid var(--accent-yellow);
}

.group-easa .group-count-badge {
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
}

/* Group 3: Lớp học khác — Light blue-grey surface, Secondary Royal Blue header bar */
.group-other {
  background-color: #E4ECF8;
  border: 1px solid #C8D7EE;
  box-shadow: 0 2px 10px rgba(16, 39, 91, 0.04);
}

.group-other .group-header {
  background: linear-gradient(90deg, var(--royal-secondary) 0%, var(--icon-blue) 100%);
  color: var(--bg-white);
  border-bottom: 3px solid var(--accent-yellow);
}

.group-header {
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.group-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: contain;
}

.group-title {
  font-size: 17px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-count-badge {
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: rgba(255, 211, 41, 0.2);
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 211, 41, 0.45);
  white-space: nowrap;
}

.group-easa .group-count-badge {
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
  border-color: #E5B800;
}

.group-body {
  padding: 20px;
}

/* ==========================================================================
   COURSE GRID & CARDS
   - Mobile narrow: 1 card / row
   - Tablet: 2 cards / row
   - Desktop: 3 or 4 cards / row depending on width
   ========================================================================== */
.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 600px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .course-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .course-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.course-card {
  position: relative;
  background-color: var(--bg-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

/* Active / Available Card */
.course-card.is-available {
  cursor: pointer;
}

@media (hover: hover) {
  .course-card.is-available:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--royal-secondary);
  }
}

.course-card.is-available:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 2px;
  border-color: var(--royal-dark);
}

/* Unavailable / Pending Card */
.course-card.is-unavailable {
  background-color: #F8FAFD;
  border: 1px dashed #C5D2E8;
  box-shadow: none;
  cursor: default;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background-color: var(--bg-page);
  color: var(--royal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.course-card.is-available:hover .card-icon-wrap {
  background-color: var(--royal-dark);
  color: var(--accent-yellow);
  border-color: var(--royal-dark);
}

.course-card.is-unavailable .card-icon-wrap {
  background-color: #EEF2F8;
  color: #7B8BA8;
}

.card-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.2;
}

.status-badge.badge-ready {
  background-color: #E8F1FF;
  color: var(--royal-secondary);
  border: 1px solid #C2D8FC;
}

.status-badge.badge-ready .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #15803D;
}

.status-badge.badge-pending {
  background-color: #EBEEF5;
  color: #64748B;
  border: 1px solid #D5DCE8;
}

.status-badge.badge-pending .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #94A3B8;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-group-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--royal-dark);
  line-height: 1.3;
}

.course-card.is-unavailable .card-title {
  color: #3B4D71;
}

.card-subtitle {
  font-size: 13.5px;
  font-weight: 300;
  color: var(--text-secondary);
}

.card-footer {
  padding-top: 8px;
  border-top: 1px solid #EDF2FA;
  display: flex;
  align-items: center;
}

.btn-card-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-card-primary {
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
  cursor: pointer;
}

.course-card.is-available:hover .btn-card-primary {
  background-color: var(--accent-yellow-hover);
}

.btn-card-disabled {
  background-color: #E6EBF4;
  color: #6E7E9F;
  cursor: not-allowed;
}

.btn-card-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   EMPTY SEARCH STATE
   ========================================================================== */
.empty-state {
  background-color: var(--bg-white);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-group);
  padding: 40px 20px;
  text-align: center;
  max-width: 540px;
  margin: 12px auto;
  box-shadow: var(--shadow-soft);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background-color: var(--bg-page);
  color: var(--royal-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--royal-dark);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-reset-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-reset-search:hover {
  background-color: var(--accent-yellow-hover);
}

/* ==========================================================================
   MODAL HƯỚNG DẪN CÀI APP ANDROID (PWA)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(16, 39, 91, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-card {
  background-color: var(--bg-white);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 24px 20px;
  box-shadow: 0 16px 40px rgba(16, 39, 91, 0.25);
  border-top: 4px solid var(--accent-yellow);
  text-align: center;
}

.modal-app-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  box-shadow: 0 4px 12px rgba(28, 83, 146, 0.25);
}

.modal-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--royal-dark);
  margin-bottom: 8px;
}

.modal-body {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  text-align: left;
  background-color: var(--bg-page);
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.modal-body ol {
  padding-left: 18px;
}

.modal-body li + li {
  margin-top: 6px;
}

.modal-body strong {
  font-weight: 500;
  color: var(--royal-dark);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-modal-close {
  width: 100%;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background-color: var(--accent-yellow);
  color: var(--royal-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ==========================================================================
   MINIMALIST FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--royal-dark);
  color: rgba(255, 255, 255, 0.8);
  border-top: 2px solid var(--royal-secondary);
  padding: 16px;
  font-size: 13px;
  font-weight: 300;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    text-align: left;
  }
}

.footer-domain {
  color: var(--accent-yellow);
  font-weight: 400;
  text-decoration: none;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .header-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
  }
  .site-title {
    font-size: 15.5px;
  }
  .btn-install-app {
    padding: 7px 11px;
    font-size: 13px;
  }
  .group-header {
    padding: 11px 14px;
  }
  .group-body {
    padding: 14px;
  }
  .course-card {
    padding: 16px;
  }
}
