/* =========================================================================
   USSC Theme - THU Blue/Gold color overrides for Tabler
   Redesign skill applied: anti-slop, trust-first, professional
   ========================================================================= */

:root {
  /* THU Official Colors */
  --tblr-primary: #003D7A;
  --tblr-primary-rgb: 0, 61, 122;
  --tblr-primary-fg: #ffffff;

  --tblr-accent: #C8A032;
  --tblr-accent-rgb: 200, 160, 50;
  --tblr-accent-fg: #1a1a1a;

  /* Slightly warmer body text */
  --tblr-body-color: #3a4048;

  /* Font sizes - slightly larger for readability */
  --tblr-body-font-size: 1rem;
  --tblr-font-size-h1: 2rem;
  --tblr-font-size-h2: 1.75rem;
  --tblr-font-size-h3: 1.5rem;
  --tblr-font-size-h4: 1.25rem;
  --tblr-font-size-h5: 1.125rem;
  --tblr-font-size-h6: 1rem;

  /* Font families - Inter for Latin, Noto Sans TC for Chinese */
  --tblr-font-sans-serif: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tblr-font-monospace: "JetBrains Mono", "Fira Code", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Tinted shadow (blue-tinted, not pure black) */
  --ussc-shadow-sm: 0 1px 3px rgba(0, 61, 122, 0.06), 0 1px 2px rgba(0, 61, 122, 0.04);
  --ussc-shadow-md: 0 4px 12px rgba(0, 61, 122, 0.08), 0 2px 4px rgba(0, 61, 122, 0.04);
  --ussc-shadow-lg: 0 8px 24px rgba(0, 61, 122, 0.10), 0 4px 8px rgba(0, 61, 122, 0.06);

  /* z-index scale */
  --z-header: 100;
  --z-overlay: 200;
  --z-modal: 300;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] {
  --tblr-primary: #4a8fdb;
  --tblr-primary-rgb: 74, 143, 219;
  --tblr-accent: #D4AC4E;
  --tblr-accent-rgb: 212, 172, 78;
  --tblr-body-color: #c4c9cf;
  --ussc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
  --ussc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
  --ussc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   Base - larger font sizes for readability
   ========================================================================= */
html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--tblr-primary);
  color: #fff;
  padding: .5rem 1rem;
  z-index: var(--z-overlay);
  border-radius: 0 0 .375rem 0;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
}

/* =========================================================================
   Sidebar - full height, flush with navbar and left edge
   ========================================================================= */
.page-body > .container-fluid {
  padding-left: 0;
  margin-top: 0;
}
.page-wrapper .page-body {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.sidebar-nav {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: rgba(var(--tblr-primary-rgb), .05);
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
}
[data-bs-theme="dark"] .sidebar-nav {
  background: rgba(var(--tblr-primary-rgb), .1);
}
.sidebar-nav .nav-link {
  color: var(--tblr-body-color) !important;
  border-radius: .375rem;
  padding: .35rem .75rem !important;
  font-size: .95rem;
  line-height: 1.4;
  transition: background .2s, color .2s;
}
.sidebar-nav ul {
  gap: .125rem !important;
}
.sidebar-footer {
  font-size: .75rem;
  color: var(--tblr-secondary-color, #6c757d);
  border-top: 1px solid rgba(var(--tblr-body-color-rgb), .08);
  padding-top: .5rem;
  margin-top: auto;
}
.sidebar-nav .nav-link:hover {
  background: rgba(var(--tblr-primary-rgb), .06);
  color: var(--tblr-primary);
}
.sidebar-nav .nav-link.active {
  background: rgba(var(--tblr-primary-rgb), .1);
  color: var(--tblr-primary);
  font-weight: 600;
}

/* =========================================================================
   Navbar - deep blue with white text
   ========================================================================= */
.navbar > .container-fluid {
  padding-left: .75rem;
}
.navbar {
  background-color: var(--tblr-primary);
}
.navbar .navbar-brand {
  color: #fff;
}
.navbar .navbar-brand:hover {
  color: rgba(255, 255, 255, .85);
}
.navbar .navbar-brand .fw-bold {
  color: #fff !important;
}
.navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, .3);
}
.navbar .navbar-toggler-icon {
  filter: invert(1) brightness(2);
}
[data-bs-theme="dark"] .navbar .navbar-toggler-icon {
  filter: none;
  --tblr-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar .nav-link {
  color: rgba(255, 255, 255, .85);
}
.navbar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}
.navbar .dropdown-menu {
  font-size: .95rem;
}
.navbar .theme-toggle {
  color: rgba(255, 255, 255, .85);
}
.navbar .theme-toggle:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* =========================================================================
   Typography
   ========================================================================= */
h1, h2, h3, h4 {
  letter-spacing: -.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* =========================================================================
   Cards - tinted shadow, no heavy border
   ========================================================================= */
.card {
  box-shadow: var(--ussc-shadow-sm);
  border: 1px solid rgba(var(--tblr-body-color-rgb), 0.06);
  transition: box-shadow .2s, transform .2s;
}

/* =========================================================================
   Form controls - focus ring, consistent radius
   ========================================================================= */
.form-control:focus,
.form-select:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--tblr-primary-rgb), .12);
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(var(--tblr-primary-rgb), .5);
  outline-offset: 2px;
}

/* =========================================================================
   Buttons - hover and active states
   ========================================================================= */
.btn {
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-primary:hover {
  background: rgba(var(--tblr-primary-rgb), .9);
  transform: translateY(-1px);
  box-shadow: var(--ussc-shadow-sm);
}
.btn:active {
  transform: scale(.98);
}

/* =========================================================================
   Captcha image styling
   ========================================================================= */
.captcha-img {
  border-radius: .375rem;
  border: 1px solid rgba(var(--tblr-body-color-rgb), .12);
  cursor: pointer;
  transition: border-color .2s;
}
.captcha-img:hover {
  border-color: var(--tblr-primary);
}
.captcha-refresh {
  flex-shrink: 0;
}

/* =========================================================================
   Password meter
   ========================================================================= */
#pswmeter {
  border-radius: .25rem;
  overflow: hidden;
}
#pswmeter-message {
  font-size: .75rem;
  margin-top: .25rem;
}

/* =========================================================================
   Breadcrumb cleanup
   ========================================================================= */
.breadcrumb {
  margin-bottom: 1rem;
  padding: .5rem 0;
  background: transparent;
}

/* =========================================================================
   Page hero (index.php) - asymmetric, not centered blob
   ========================================================================= */
.ussc-hero {
  background: linear-gradient(135deg, rgba(var(--tblr-primary-rgb), .04) 0%, rgba(var(--tblr-accent-rgb), .03) 100%);
  border-radius: .5rem;
  padding: 2rem 1.5rem;
}

.ussc-hero h1 {
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  max-width: 28ch;
  margin-bottom: .5rem;
}

.ussc-hero p {
  font-size: 1.05rem;
  max-width: 50ch;
  line-height: 1.6;
  margin-bottom: 0;
}

[data-bs-theme="dark"] .ussc-hero {
  background: linear-gradient(135deg, rgba(var(--tblr-primary-rgb), .08) 0%, rgba(var(--tblr-accent-rgb), .05) 100%);
}

/* =========================================================================
   Feature cards - asymmetric layout, not 3 equal columns
   ========================================================================= */
.feature-card {
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ussc-shadow-md);
}

.feature-card .card-icon {
  width: 44px;
  height: 44px;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(var(--tblr-primary-rgb), .08);
  color: var(--tblr-primary);
}

[data-bs-theme="dark"] .feature-card .card-icon {
  background: rgba(var(--tblr-primary-rgb), .15);
}

/* Pin button to bottom of card */
.feature-card .stretched-link {
  position: absolute;
  bottom: 1rem;
}

/* =========================================================================
   Footer
   ========================================================================= */
.ussc-footer {
  border-top: 1px solid rgba(var(--tblr-body-color-rgb), .08);
  padding: 1.5rem 0 2rem;
  color: var(--tblr-secondary-color, #6c757d);
  font-size: .875rem;
}

.ussc-footer a:hover {
  color: var(--tblr-primary);
  text-decoration: none;
}

/* =========================================================================
   Dark mode toggle button
   ========================================================================= */
.theme-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: .375rem .5rem;
  border-radius: .375rem;
  color: var(--tblr-body-color);
  transition: background .2s;
}
.theme-toggle:hover {
  background: rgba(var(--tblr-body-color-rgb), .08);
}
.theme-toggle:active {
  transform: scale(.95);
}
.theme-toggle .ti {
  font-size: 1.25rem;
}

/* =========================================================================
   Alert tweaks
   ========================================================================= */
.alert {
  border-radius: .5rem;
}

/* =========================================================================
   Typebot container
   ========================================================================= */
typebot-standard {
  width: 100%;
  border-radius: .5rem;
  overflow: hidden;
}

/* =========================================================================
   Success page checkmark
   ========================================================================= */
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(25, 135, 84, .1);
  color: #198754;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}
