/* =============================================================================
   AIBP Enterprise Innovation Awards — style.css
   Fonts: Crimson Pro (display) + Lato (body)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  --red:        #B42024;
  --dark:       #3C3838;
  --white:      #FFFFFF;
  --grey-light: #F5F5F5;
  --grey-mid:   #E0E0E0;
  --grey-muted: #9E9E9E;

  --asean-my: #EE963A;
  --asean-id: #4B64AE;
  --asean-ph: #854C9D;
  --asean-th: #834924;
  --asean-vn: #F37346;

  --header-gradient: linear-gradient(135deg, #B42024 0%, #3C3838 100%);

  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius:    16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow:    0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);

  --header-h: 56px;
  --nav-h:    68px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--grey-light);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); outline: none; }

/* ── Screens ───────────────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Sign-In Screen ────────────────────────────────────────────────────────── */
#signin-screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: linear-gradient(168deg, #b42024 0%, #5c0d10 42%, #000000 100%);
  z-index: 10;
  overflow-y: auto;
}
#signin-screen.active { display: flex; }

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border-radius: 24px;
  padding: 40px 28px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  height: 52px;
  display: block;
  margin: 0 auto 8px;
  object-fit: contain;
}

.login-event {
  text-align: center;
  font-size: 13px;
  color: var(--grey-muted);
  margin-bottom: 28px;
  line-height: 1.55;
}
.login-event strong { color: var(--dark); }

.login-form { display: flex; flex-direction: column; gap: 10px; }

.login-form select,
.login-form input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  font-size: 15px;
  color: var(--dark);
  background: var(--grey-light);
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.login-form select:focus,
.login-form input[type="text"]:focus  { border-color: var(--dark); background: var(--white); }
.login-form select:disabled,
.login-form input[type="text"]:disabled { opacity: 0.4; cursor: default; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--grey-muted);
  letter-spacing: 0.04em;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-mid); }

.forgot-pin {
  text-align: center;
  font-size: 12px;
  color: var(--grey-muted);
  margin-top: 2px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  transition: opacity 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary:active   { opacity: 0.82; }
.btn-primary:disabled { opacity: 0.4; cursor: default; }

/* ── Main App Shell ────────────────────────────────────────────────────────── */
#main-app {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}
#main-app.active { display: flex; }

/* ── App Header ────────────────────────────────────────────────────────────── */
#app-header {
  flex-shrink: 0;
  height: var(--header-h);
  background: var(--header-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  z-index: 50;
}
.header-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.header-logo-img {
  height: 28px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}
.header-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ── Scrollable Tab Area ───────────────────────────────────────────────────── */
#app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--grey-light);
}

/* ── Tab Content ───────────────────────────────────────────────────────────── */
.tab-content { display: none; min-height: 100%; }
.tab-content.active { display: block; }

.tab-inner { padding: 16px 16px 24px; }

.tab-header {
  background: var(--white);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--grey-mid);
}
.tab-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

/* ── Bottom Nav ────────────────────────────────────────────────────────────── */
#bottom-nav {
  flex-shrink: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--grey-mid);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 50;
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--grey-muted);
  padding: 8px 4px;
  transition: color 0.15s;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-tab .nav-icon { font-size: 20px; line-height: 1; }
.nav-tab.active { color: var(--red); }

/* ── Country Filter Pills ──────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
}
.filter-pill {
  background: var(--grey-light);
  border: 1.5px solid var(--grey-mid);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--grey-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.filter-pill.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── Finalist Cards ────────────────────────────────────────────────────────── */
.finalist-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.12s;
  border-left: 4px solid var(--red);
}
.finalist-card:active { transform: scale(0.99); }

.finalist-card .category {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.finalist-card .company {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 3px;
}
.finalist-card .project { font-size: 13px; color: var(--grey-muted); margin-bottom: 6px; line-height: 1.4; }
.finalist-card .presenter { font-size: 12px; color: var(--grey-muted); margin-top: 6px; }

.finalist-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}
.finalist-card-info { flex: 1; min-width: 0; }
.finalist-logo-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  background: var(--grey-light);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--grey-mid);
}
.finalist-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.finalist-card .expanded { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grey-mid); }
.finalist-card .expanded.open { display: block; }
.finalist-card .section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin: 10px 0 4px;
}
.finalist-card .section-title:first-child { margin-top: 0; }
.finalist-card .section-text { font-size: 13px; color: var(--grey-muted); line-height: 1.55; }

/* ── Feedback Tile ─────────────────────────────────────────────────────────── */
.feedback-tile {
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s;
}
.feedback-tile:active { opacity: 0.82; }
.feedback-tile .tile-icon { font-size: 22px; }
.feedback-tile .tile-text { font-size: 15px; font-weight: 700; }

/* ── Agenda ────────────────────────────────────────────────────────────────── */
.session-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: background 0.15s;
}
.session-card.has-details { cursor: pointer; }
.session-card.has-details:active { background: var(--grey-light); }

.session-card__time {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  min-width: 50px;
  padding-top: 2px;
  line-height: 1.4;
}
.session-card__main { flex: 1; min-width: 0; }

.session-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 4px;
}

/* Track label shown on showcase cards */
.session-card__track {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

.session-card__speaker { font-size: 12px; color: var(--grey-muted); line-height: 1.4; }

/* General sessions (no track) */
.session-card.general {
  background: var(--grey-light);
  border-left: 4px solid var(--grey-mid);
}
.session-card.general .session-card__time { color: var(--grey-muted); }
.session-card.general .session-card__title { font-weight: 400; font-family: var(--font-body); font-size: 15px; }

/* Showcase sessions */
.session-card.showcase { border-left: 4px solid var(--red); }

/* Chevron indicator */
.session-card__chevron {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--grey-muted);
  line-height: 1;
  padding-top: 1px;
  transition: transform 0.2s;
}
.session-card.expanded .session-card__chevron { transform: rotate(90deg); }

/* Accordion expand panel */
.session-card__expand {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-mid);
}
.session-card__expand.open { display: block; }

/* Detail rows inside accordion */
.agenda-detail-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.agenda-detail-row:last-child { margin-bottom: 0; }

.agenda-detail-label {
  flex-shrink: 0;
  width: 64px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  padding-top: 2px;
}
.agenda-detail-value {
  flex: 1;
  font-size: 13px;
  color: var(--dark);
  line-height: 1.45;
}

/* ── Session Groups (Showcase sections) ───────────────────────────────────── */
.session-group {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
  border-left: 4px solid var(--red);
}

.session-group__header {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  padding: 8px 16px;
}

.session-subitem {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-light);
  align-items: flex-start;
}
.session-subitem:last-child { border-bottom: none; }

.session-subitem__time {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  min-width: 44px;
  padding-top: 2px;
}

.session-subitem__details { flex: 1; min-width: 0; }

.session-subitem__project {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 3px;
}

.session-subitem__meta {
  font-size: 12px;
  color: var(--grey-muted);
  line-height: 1.4;
}

/* ── Q&A ───────────────────────────────────────────────────────────────────── */
.qa-submit {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.qa-submit textarea {
  width: 100%;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  padding: 12px;
  font-size: 14px;
  background: var(--grey-light);
  min-height: 80px;
  resize: none;
  color: var(--dark);
  transition: border-color 0.15s, background 0.15s;
}
.qa-submit textarea:focus { border-color: var(--dark); background: var(--white); }
.qa-submit label { font-size: 13px; color: var(--grey-muted); display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.qa-submit label input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }
.qa-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 8px;
  border-left: 4px solid var(--red);
}
.qa-item .question { font-size: 14px; color: var(--dark); line-height: 1.5; }
.qa-item .asker { font-size: 11px; color: var(--grey-muted); margin-top: 4px; }

/* ── Photos ────────────────────────────────────────────────────────────────── */
.upload-btn {
  display: block;
  width: 100%;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 16px;
  transition: opacity 0.15s;
  border: none;
  cursor: pointer;
}
.upload-btn:active { opacity: 0.82; }
#photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-thumb { position: relative; cursor: pointer; border-radius: var(--radius-xs); overflow: hidden; }
.photo-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; transition: opacity 0.15s; }
.photo-thumb:active img { opacity: 0.85; }
.photo-lightbox-img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 16px; display: block; }
.btn-linkedin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #0077B5;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.btn-linkedin:active { opacity: 0.85; }

/* ── Modal Overlay ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 56, 56, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

/* ── Modal Sheet ───────────────────────────────────────────────────────────── */
.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  z-index: 201;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.modal-sheet.open { transform: translateX(-50%) translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--grey-mid);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-inner { padding: 20px 20px 40px; position: relative; }
.modal-inner h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
  padding-right: 36px;
  line-height: 1.2;
}
.modal-subtitle { font-size: 13px; color: var(--grey-muted); margin-bottom: 20px; }

.modal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-right: 36px;
}
.modal-card-header-text { flex: 1; min-width: 0; }
.modal-company-label {
  font-size: 12px;
  color: var(--grey-muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.modal-card-header h3 { margin-bottom: 0; padding-right: 0; }
.modal-card-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: var(--grey-light);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--grey-mid);
}
.modal-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.modal-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--grey-muted);
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.modal-close-btn:active { background: var(--grey-mid); }

/* ── Scoring Sliders ───────────────────────────────────────────────────────── */
.slider-group { margin-bottom: 22px; }
.slider-label { font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--dark); }
.slider-desc  { font-size: 12px; color: var(--grey-muted); margin-bottom: 10px; line-height: 1.45; }
.slider-row   { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--red); }
.slider-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.qualitative { margin-top: 4px; }
.qualitative .slider-label { margin-bottom: 8px; }
.qualitative textarea {
  width: 100%;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  padding: 12px;
  font-size: 14px;
  background: var(--grey-light);
  min-height: 80px;
  resize: none;
  color: var(--dark);
  transition: border-color 0.15s, background 0.15s;
}
.qualitative textarea:focus { border-color: var(--dark); background: var(--white); }

/* ── Submit Score Button ───────────────────────────────────────────────────── */
.modal-submit {
  display: block;
  width: 100%;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  border: none;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.15s;
}
.modal-submit:active { opacity: 0.82; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 48px);
  text-align: center;
  white-space: normal;
  box-shadow: var(--shadow-lg);
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.2s ease; }

@media (min-width: 480px) {
  #photo-grid { grid-template-columns: repeat(3, 1fr); }
}
