/* Material 3 Design System - Blue Accent Color */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  /* Blue Light Color Palette (Material 3) */
  --md-sys-color-primary: #0061a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d1e4ff;
  --md-sys-color-on-primary-container: #001d36;
  --md-sys-color-secondary: #535f70;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d7e3f7;
  --md-sys-color-on-secondary-container: #101c2b;
  --md-sys-color-tertiary: #6b5778;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #f2daff;
  --md-sys-color-on-tertiary-container: #251431;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-outline: #72777f;
  --md-sys-color-background: #f8f9ff;
  --md-sys-color-on-background: #191c1e;
  --md-sys-color-surface: #f8f9ff;
  --md-sys-color-on-surface: #191c1e;
  --md-sys-color-surface-variant: #dfe2eb;
  --md-sys-color-on-surface-variant: #43474e;
  --md-sys-color-inverse-surface: #2e3133;
  --md-sys-color-inverse-on-surface: #f0f0f3;
  --md-sys-color-inverse-primary: #9ecaff;
  --md-sys-color-shadow: #000000;
  --md-sys-color-surface-tint: #0061a4;
  --md-sys-color-outline-variant: #c3c7cf;
  --md-sys-color-scrim: #000000;

  /* Elevations */
  --md-sys-elevation-1: 0 1px 2px 0 rgba(0,0,0,0.30), 0 1px 3px 1px rgba(0,0,0,0.15);
  --md-sys-elevation-2: 0 1px 2px 0 rgba(0,0,0,0.30), 0 2px 6px 2px rgba(0,0,0,0.15);
  --md-sys-elevation-3: 0 1px 3px 0 rgba(0,0,0,0.30), 0 4px 8px 3px rgba(0,0,0,0.15);
}

/* Yellow Theme (Banana) */
.theme-yellow {
  --md-sys-color-primary: #705d00;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffe170;
  --md-sys-color-on-primary-container: #221b00;
  --md-sys-color-secondary: #665e3f;
  --md-sys-color-secondary-container: #eee2bc;
  --md-sys-color-on-secondary-container: #211b04;
  --md-sys-color-surface-tint: #705d00;
}

/* Orange Theme (thlinh) */
.theme-orange {
  --md-sys-color-primary: #994600;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffdbca;
  --md-sys-color-on-primary-container: #331200;
  --md-sys-color-secondary: #765848;
  --md-sys-color-secondary-container: #ffdbca;
  --md-sys-color-on-secondary-container: #2b160a;
  --md-sys-color-surface-tint: #994600;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Background & Overlay */
.background-layer {
  background-size: cover;
  background-position: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(25, 28, 30, 0.9);
  z-index: -1;
}

/* M3 Navigation Bar (Top-positioned Google Style) */
.m3-navigation-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--md-sys-color-surface);
  height: 80px;
  padding: 0 8px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
}

.m3-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  height: 100%;
  min-width: 80px;
  padding: 0 4px;
  gap: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.m3-nav-item .icon-wrapper {
  width: 64px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: background-color 0.2s;
}

.m3-nav-item.active .icon-wrapper {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-nav-item img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

.m3-nav-item.active img {
  opacity: 1;
}

.m3-nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Ensure the layout doesn't change on larger screens */
@media (min-width: 601px) {
  .m3-navigation-bar {
    height: 80px;
  }
}

main {
  flex-grow: 1;
  padding: 16px;
  padding-top: 100px; /* Space for top nav */
}

/* Mobile optimizations */
@media (max-width: 600px) {
  main {
    padding: 12px;
    padding-top: 96px;
  }
  
  .m3-card {
    padding: 16px;
  }
}

/* K7A2 Gallery refinement (4 images in a row) */
.m3-image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .m3-image-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on very small screens for visibility */
  }
}

@media (min-width: 1024px) {
  .m3-image-grid {
    gap: 16px;
  }
}

/* M3 Components */
.m3-card {
  background-color: var(--md-sys-color-surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--md-sys-elevation-1);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.card-elevated {
  background-color: var(--md-sys-color-surface-variant);
  box-shadow: var(--md-sys-elevation-1);
  border: none;
}

.card-elevated:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.m3-btn {
  height: 40px;
  padding: 0 24px;
  border-radius: 20px;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.2s, background-color 0.2s;
}

.btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-filled:hover {
  background-color: #0070bc;
  box-shadow: var(--md-sys-elevation-1);
}

.btn-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-textfield {
  margin-bottom: 16px;
}

.m3-textfield label {
  display: block;
  font-size: 0.75rem;
  color: var(--md-sys-color-primary);
  margin-bottom: 4px;
  padding-left: 12px;
}

.m3-textfield input {
  width: 100%;
  height: 56px;
  padding: 8px 16px;
  background-color: var(--md-sys-color-surface-variant);
  border: none;
  border-bottom: 1px solid var(--md-sys-color-outline);
  border-radius: 4px 4px 0 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-textfield input:focus {
  outline: none;
  border-bottom: 2px solid var(--md-sys-color-primary);
}

.announcement-banner {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 500;
}
