/* ============================================
   BSC ECOLAB - Google Blue Design Foundation
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;900&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --google-blue: #1a73e8;
  --google-blue-700: #0b57d0;
  --google-blue-800: #0842a0;
  --google-blue-50: #e8f0fe;
  --google-blue-25: #f5f9ff;
  --google-green: #1a73e8;
  --google-yellow: #1a73e8;
  --google-red: #1a73e8;
  --google-cyan: #1a73e8;

  --primary-color: var(--google-blue);
  --primary-blue: var(--google-blue);
  --primary-blue-dark: var(--google-blue-700);
  --primary-blue-light: var(--google-blue-50);
  --secondary-color: #202124;
  --background-color: #f8fbff;
  --bg-light: #f1f6ff;
  --card-bg: #ffffff;
  --text-color: #202124;
  --text-secondary: #5f6368;
  --border-color: #d7e3f8;
  --nav-height: 64px;

  --surface: #ffffff;
  --surface-blue: #f5f9ff;
  --surface-green: #f5f9ff;
  --ink: #202124;
  --muted: #5f6368;
  --line: rgba(26, 115, 232, 0.16);
  --line-strong: rgba(26, 115, 232, 0.28);
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.08), 0 1px 3px rgba(60, 64, 67, 0.10);
  --shadow-md: 0 4px 10px rgba(60, 64, 67, 0.10), 0 1px 4px rgba(60, 64, 67, 0.08);
  --shadow-lg: 0 12px 30px rgba(26, 115, 232, 0.14), 0 4px 12px rgba(60, 64, 67, 0.10);
  --shadow-focus: 0 0 0 4px rgba(26, 115, 232, 0.14);
  --gradient-blue: linear-gradient(135deg, #1a73e8 0%, #0b57d0 100%);
  --gradient-google: linear-gradient(90deg, #1a73e8 0%, #0b57d0 100%);
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  --radius-card: 8px;
  --radius-control: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background-color);
  color: var(--ink);
  font-family: "Inter", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

img {
  height: auto;
}

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

a {
  color: var(--google-blue);
  text-decoration: none;
  transition: color 0.2s var(--motion-ease), opacity 0.2s var(--motion-ease);
}

a:hover {
  color: var(--google-blue-700);
}

ul,
ol {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.18;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.28;
}

h4 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

/* Navigation */
nav {
  position: sticky !important;
  top: 0;
  z-index: 1000;
  min-height: var(--nav-height);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.nav-container {
  width: min(100%, 1440px);
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--google-blue-700);
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-logo img {
  width: auto;
  height: 34px;
  display: block;
}

.nav-menu {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  list-style: none;
}

.nav-menu a {
  position: relative;
  min-height: 38px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-control);
  color: #3c4043;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--google-blue-700);
  background: rgba(26, 115, 232, 0.09);
}

.nav-menu img.menu-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--google-blue-700);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* Layout */
.container {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 24px;
}

.section-spacing {
  padding: clamp(56px, 8vw, 96px) 0;
}

.hero,
.hero-section {
  position: relative;
  min-height: clamp(420px, 58vh, 720px);
  padding: clamp(72px, 10vw, 128px) 0 clamp(56px, 8vw, 96px);
  display: flex;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.hero .container,
.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero p,
.hero-section p {
  max-width: 760px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-emoji {
  width: 104px;
  min-height: 104px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
}

.hero-emoji img {
  max-width: 104px;
  max-height: 104px;
  object-fit: contain;
}

.button-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Cards and surfaces */
.card,
.stat-card,
.game-card,
.feature-card,
.news-card,
.guest-stats-section,
.login-box-single,
.member-access-box,
.chat-panel,
.selected-model-card,
.model-card,
.duty-table-container,
.terminal-container,
.test-section {
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.card,
.game-card,
.feature-card,
.news-card {
  padding: clamp(22px, 3vw, 32px);
}

.card h3,
.game-card h3,
.feature-card h3,
.news-card h3 {
  color: var(--google-blue-700);
}

.card p,
.game-card p,
.feature-card p,
.news-card p {
  color: var(--muted);
}

.card-icon,
.game-icon,
.section-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  color: var(--google-blue-700);
  background: var(--google-blue-50);
  border: 1px solid rgba(26, 115, 232, 0.14);
}

.card-icon img,
.game-icon img,
.section-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.card-icon.green {
  background: var(--google-blue-50);
  color: var(--google-blue-700);
}

.card-icon.blue {
  background: var(--google-blue-50);
  color: var(--google-blue-700);
}

.card-icon.cyan {
  background: var(--google-blue-50);
  color: var(--google-blue-700);
}

.card-icon.yellow {
  background: var(--google-blue-50);
  color: var(--google-blue-700);
}

.card-icon.purple {
  background: var(--google-blue-50);
  color: var(--google-blue-700);
}

/* Buttons */
.btn,
button.btn,
a.btn,
.btn-play,
.btn-check {
  min-height: 42px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--google-blue-700);
  background: #fff;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.2s var(--motion-ease), box-shadow 0.2s var(--motion-ease), background 0.2s var(--motion-ease), border-color 0.2s var(--motion-ease), color 0.2s var(--motion-ease);
}

.btn:hover,
button.btn:hover,
a.btn:hover,
.btn-play:hover,
.btn-check:hover {
  transform: translateY(-1px);
}

.btn-primary,
.btn-play,
#loginBtn,
#sendBtn {
  color: #fff !important;
  background: var(--google-blue) !important;
  border-color: var(--google-blue) !important;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.26);
}

.btn-primary:hover,
.btn-play:hover,
#loginBtn:hover,
#sendBtn:hover {
  background: var(--google-blue-700) !important;
  border-color: var(--google-blue-700) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.28);
}

.btn-secondary {
  color: var(--google-blue-700) !important;
  background: #fff !important;
  border-color: var(--line-strong) !important;
}

.btn-secondary:hover,
.btn-secondary.active {
  background: var(--google-blue-50) !important;
  border-color: rgba(26, 115, 232, 0.36) !important;
}

.btn-danger {
  color: #fff !important;
  background: var(--google-blue-800) !important;
  border-color: var(--google-blue-800) !important;
}

.btn-sm,
.btn-small {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 0.85rem;
}

button:disabled,
.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Forms */
input,
textarea,
select,
.member-login-input,
.duty-input-text,
.filter-select,
.search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus,
select:focus,
.member-login-input:focus,
.duty-input-text:focus,
.filter-select:focus,
.search-input:focus {
  border-color: var(--google-blue);
  box-shadow: var(--shadow-focus);
}

label {
  color: var(--muted);
  font-weight: 650;
}

code,
pre {
  border-radius: 8px;
}

/* System and data views */
.stat-card {
  padding: 22px;
  text-align: center;
}

.stat-value {
  color: var(--google-blue-700);
  font-weight: 900;
}

.stat-label {
  color: var(--muted);
  font-weight: 650;
}

.duty-table-container {
  overflow-x: auto;
}

.duty-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.duty-table th {
  color: var(--google-blue-700);
  background: var(--google-blue-50);
}

.duty-table td,
.duty-table th {
  border-bottom: 1px solid rgba(26, 115, 232, 0.10);
}

.modal-content,
.modal-box,
.prompt-box,
.confirm-box {
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Chat */
.chat-panel,
.model-card,
.selected-model-card,
.member-access-box {
  border-radius: 8px !important;
}

.message,
.chat-message,
.user-message,
.bot-message,
.assistant-message {
  border-radius: 8px;
}

.user-message {
  background: var(--google-blue) !important;
  color: #fff !important;
}

.bot-message,
.assistant-message {
  background: var(--surface-blue) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}

.model-card.active,
.selected-model-card {
  border-color: rgba(26, 115, 232, 0.35) !important;
  box-shadow: 0 8px 22px rgba(26, 115, 232, 0.12) !important;
}

/* Games */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.game-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  text-align: center;
}

#gameArena {
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
}

.quiz-btn {
  border-radius: 8px !important;
}

/* Feedback states */
.success,
.success-message {
  color: #0d652d !important;
  background: #e6f4ea !important;
  border-color: rgba(52, 168, 83, 0.35) !important;
}

.error,
.error-message {
  color: #a50e0e !important;
  background: #fce8e6 !important;
  border-color: rgba(234, 67, 53, 0.35) !important;
}

.info,
.info-message {
  color: var(--google-blue-800) !important;
  background: var(--google-blue-50) !important;
  border-color: rgba(26, 115, 232, 0.28) !important;
}

/* Footer */
footer {
  margin-top: 0;
  padding: 64px 0 28px;
  color: rgba(255, 255, 255, 0.76);
  background: #0b1b34;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1.45fr;
  gap: 32px;
  margin-bottom: 28px;
}

footer h3 {
  color: #fff;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

footer p,
footer li {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

footer ul {
  padding: 0;
  list-style: none;
}

footer li {
  margin-bottom: 8px;
}

footer a {
  color: rgba(255, 255, 255, 0.78);
}

footer a:hover {
  color: #8ab4f8;
}

.footer-divider {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--google-blue);
}

.text-muted {
  color: var(--muted);
}

.google-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.page-accent-blue {
  --page-accent: var(--google-blue);
}

.motion-lite * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

.hidden {
  display: none !important;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

@media (max-width: 1180px) {
  .nav-container {
    padding: 0 16px;
  }

  .nav-menu a {
    padding: 8px 8px;
    font-size: 0.78rem;
  }
}

@media (max-width: 1180px) {
  .menu-toggle {
    display: inline-flex !important;
    margin-left: auto;
    flex: 0 0 42px;
  }

  .nav-container {
    min-height: 60px;
  }

  .nav-menu {
    position: absolute;
    inset: 100% 12px auto 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 0.95rem;
  }

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

  .hero,
  .hero-section {
    min-height: 380px;
  }

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

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .section-spacing {
    padding: 48px 0;
  }

  .hero,
  .hero-section {
    padding: 64px 0 48px;
  }

  .hero-emoji,
  .hero-emoji img {
    width: 84px;
    max-width: 84px;
    min-height: 84px;
  }

  .card,
  .game-card,
  .feature-card,
  .news-card,
  .test-section {
    padding: 20px;
  }

  .button-group,
  .quiz-options {
    width: 100%;
  }

  .button-group .btn,
  .button-group a,
  .button-group button {
    width: 100%;
  }
}
