/* ========================================================
   RIBAP - Main Stylesheet
   Design based on RIBAP Specification
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
  --bg-dark: #0a092d;
  --bg-drawer: #0a092d;
  --bg-user-drawer: #0e1662;
  --primary-blue: #4255ff;
  --primary-blue-hover: #3243e0;
  --accent-cyan: #51cfff;
  --accent-cyan-light: #b2f1ff;
  --accent-green: #22c55e;
  --text-white: #ffffff;
  --text-muted: #a6a0a0;
  --text-dark: #0a092d;
  --placeholder-bg: #8c8888;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --font-heading: 'Outfit', 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ========================================================
   Top Navigation Bar (Pages 1, 2, 3, 8, 9, 10, 11, 12)
   ======================================================== */
.ribap-header {
  background-color: var(--primary-blue);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  cursor: pointer;
  background: transparent;
  padding: 2px 0;
}

.hamburger-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-btn {
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.search-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.search-btn svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.2;
}

.header-logo {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  user-select: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-signin {
  background-color: #ffffff;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 8px 24px;
  border-radius: 9999px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-signin:hover {
  background-color: #f1f3f9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #d9deeb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.user-avatar-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ========================================================
   Landing Page / Tab Navigation (Pages 1, 2, 3)
   ======================================================== */
.landing-container {
  max-width: 1200px;
  width: 95%;
  margin: 32px auto 40px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.tab-btn {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s ease;
  position: relative;
  padding: 8px 16px;
}

.tab-btn:hover {
  color: #ffffff;
}

.tab-btn.active {
  color: #ffffff;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 10%;
  width: 80%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
}

/* Big Placeholder Content Card (matching grey rect in PDF) */
.content-placeholder-card {
  background-color: var(--placeholder-bg);
  border-radius: 12px;
  min-height: 480px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  transition: opacity 0.25s ease, background 0.35s ease, color 0.35s ease;
}

/* Custom Card Background & Text Themes */
.content-placeholder-card.tab-theme-light {
  color: #ffffff !important;
}
.content-placeholder-card.tab-theme-light .placeholder-title {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.content-placeholder-card.tab-theme-light .placeholder-badge {
  background-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(8px);
}
.content-placeholder-card.tab-theme-light .placeholder-desc,
.content-placeholder-card.tab-theme-light .placeholder-desc p,
.content-placeholder-card.tab-theme-light .placeholder-desc span,
.content-placeholder-card.tab-theme-light .placeholder-desc li {
  color: rgba(255, 255, 255, 0.94) !important;
}

.content-placeholder-card.tab-theme-dark {
  color: #0a092d !important;
}
.content-placeholder-card.tab-theme-dark .placeholder-title {
  color: #0a092d !important;
}
.content-placeholder-card.tab-theme-dark .placeholder-badge {
  background-color: rgba(10, 9, 45, 0.85) !important;
  color: #ffffff !important;
}
.content-placeholder-card.tab-theme-dark .placeholder-desc,
.content-placeholder-card.tab-theme-dark .placeholder-desc p,
.content-placeholder-card.tab-theme-dark .placeholder-desc span,
.content-placeholder-card.tab-theme-dark .placeholder-desc li {
  color: rgba(10, 9, 45, 0.9) !important;
}

.placeholder-badge {
  background-color: rgba(10, 9, 45, 0.7);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.placeholder-title {
  color: var(--text-dark);
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
}

.placeholder-desc {
  color: rgba(10, 9, 45, 0.85);
  font-size: 16px;
  max-width: 650px;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
}

.placeholder-desc.rich-content-body {
  max-width: 840px;
  width: 100%;
  text-align: justify;
  line-height: 1.8;
  margin-bottom: 24px;
}

.placeholder-desc.rich-content-body p {
  margin-bottom: 14px;
  line-height: inherit;
}

.placeholder-desc.rich-content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 4px 16px rgba(10, 9, 45, 0.2);
}

.placeholder-desc.rich-content-body blockquote {
  border-left: 4px solid var(--primary-blue);
  padding-left: 16px;
  margin: 16px 0;
  font-style: italic;
  color: rgba(10, 9, 45, 0.95);
}

.placeholder-desc.rich-content-body ul,
.placeholder-desc.rich-content-body ol {
  text-align: left;
  margin: 12px 0 16px 28px;
}

.placeholder-skeleton {
  width: 100%;
  max-width: 750px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.skeleton-line {
  height: 14px;
  background: rgba(10, 9, 45, 0.15);
  border-radius: 6px;
}

.skeleton-line.w-80 { width: 80%; margin: 0 auto; }
.skeleton-line.w-90 { width: 90%; margin: 0 auto; }
.skeleton-line.w-60 { width: 60%; margin: 0 auto; }

/* ========================================================
   Action Plan Dashboard (Page 12)
   ======================================================== */
.dashboard-container {
  max-width: 1200px;
  width: 95%;
  margin: 32px auto 40px;
  flex: 1;
}

.plan-header-card {
  background: linear-gradient(135deg, #1e4191 0%, #4255ff 100%);
  border-radius: 14px;
  padding: 24px 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--accent-green);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.badge-active-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.plan-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.progress-track {
  width: 100%;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, #ffffff 100%);
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sub tabs for Page 12: Section & Activities */
.dashboard-subtabs {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}

.subtab-btn {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 12px;
  position: relative;
  transition: color 0.2s;
}

.subtab-btn:hover {
  color: #ffffff;
}

.subtab-btn.active {
  color: #ffffff;
}

.subtab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-cyan);
  border-radius: 2px;
}

/* Gradient Content Container (matching page 12 bottom card in PDF) */
.plan-gradient-container {
  background: linear-gradient(180deg, #b2f1ff 0%, #6875c6 35%, #161f55 75%, #041030 100%);
  border-radius: 16px;
  min-height: 480px;
  padding: 36px 30px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.plan-item-card {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.plan-item-left h4 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan-item-left p {
  font-size: 13px;
  color: #4b5563;
}

.btn-item-action {
  background-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.btn-item-action:hover {
  background-color: var(--primary-blue-hover);
}

/* ========================================================
   Footer (Page 4 & Global) - PC & Mobile Compatible
   ======================================================== */
.ribap-footer {
  margin-top: auto;
  width: 100%;
  padding: 52px 32px 30px;
  background: linear-gradient(180deg, #090c33 0%, #050720 100%);
  border-top: 1px solid rgba(81, 207, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  box-sizing: border-box;
}

.footer-details-grid {
  max-width: 1240px;
  margin: 0 auto 36px;
  display: grid !important;
  grid-template-columns: 2.2fr 1.2fr 1.6fr;
  gap: 48px;
  text-align: left !important;
  align-items: start;
  box-sizing: border-box;
}

.footer-col {
  text-align: left !important;
  display: flex;
  flex-direction: column;
}

.footer-col-brand .footer-heading {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1.5px;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 700;
  margin: 4px 0 12px;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.footer-about-text {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 16px;
  max-width: 480px;
}

.footer-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(81, 207, 255, 0.1);
  border: 1px solid rgba(81, 207, 255, 0.28);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 700;
  width: fit-content;
}

.footer-heading {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: relative;
  padding-bottom: 8px;
  display: inline-block;
}

.footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 2.5px;
  background: var(--accent-cyan);
  border-radius: 2px;
}

.footer-col-brand .footer-heading::after {
  display: none;
}

.footer-link-list,
.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left !important;
}

.footer-link-list li {
  text-align: left !important;
}

.footer-link-list li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-link-list li a::before {
  content: '›';
  color: var(--accent-cyan);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.2s ease;
}

.footer-link-list li a:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.footer-link-list li a:hover::before {
  transform: translateX(2px);
  color: #ffffff;
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
  text-align: left !important;
}

.contact-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 1px;
}

.contact-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left !important;
}

.contact-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-contact-list a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-contact-list a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.footer-notice-bar {
  max-width: 860px;
  margin: 0 auto 20px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(81, 207, 255, 0.25);
  border-radius: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  line-height: 1.5;
}

.footer-bottom-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  box-sizing: border-box;
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-bottom-right a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  cursor: pointer;
}

.footer-bottom-right a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.footer-bottom-sep {
  color: rgba(255, 255, 255, 0.25);
}

.footer-admin-link {
  color: var(--accent-cyan) !important;
  font-weight: 700 !important;
}

/* ========================================================
   Interactive Legal Modal (Terms of Service & Privacy Policy)
   ======================================================== */
.ribap-legal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 45, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: legalFadeIn 0.2s ease-out;
}

@keyframes legalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ribap-legal-modal-dialog {
  background: #0f1642;
  border: 1px solid rgba(81, 207, 255, 0.3);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: legalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes legalSlideUp {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.ribap-legal-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 22, 98, 0.6);
  gap: 12px;
}

.ribap-legal-modal-tabs {
  display: flex;
  gap: 8px;
}

.legal-tab-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.legal-tab-btn.active {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(66, 85, 255, 0.4);
}

.legal-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.legal-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transition: all 0.2s;
  cursor: pointer;
}

.legal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(90deg);
}

.ribap-legal-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 14.5px;
}

.legal-document-text h3 {
  font-size: 17px;
  color: var(--accent-cyan);
  margin: 18px 0 8px;
  font-weight: 700;
}

.legal-document-text h3:first-child {
  margin-top: 0;
}

.legal-document-text p {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-align: justify;
}

.legal-document-text ul,
.legal-document-text ol {
  margin: 10px 0 16px 24px;
  color: rgba(255, 255, 255, 0.85);
}

.ribap-legal-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 22, 98, 0.4);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.btn-legal-print {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-legal-print:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--accent-cyan);
}

.btn-legal-close {
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--primary-blue);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-legal-close:hover {
  background: var(--primary-blue-hover);
  box-shadow: 0 4px 12px rgba(66, 85, 255, 0.4);
}

/* ========================================================
   Landing Page Multi-Photo Gallery & Position Layouts
   ======================================================== */
.landing-content-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0 24px;
}

/* Side-by-side: Photo Position Left */
.landing-content-layout.photo-pos-left {
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;
}
.landing-content-layout.photo-pos-left .tab-gallery-container {
  width: 45%;
  flex-shrink: 0;
  order: 1;
}
.landing-content-layout.photo-pos-left .rich-content-body {
  width: 55%;
  order: 2;
  text-align: left;
}

/* Side-by-side: Photo Position Right */
.landing-content-layout.photo-pos-right {
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;
}
.landing-content-layout.photo-pos-right .rich-content-body {
  width: 55%;
  order: 1;
  text-align: left;
}
.landing-content-layout.photo-pos-right .tab-gallery-container {
  width: 45%;
  flex-shrink: 0;
  order: 2;
}

/* Photo Position Above */
.landing-content-layout.photo-pos-above .tab-gallery-container {
  order: 1;
  margin: 10px auto 20px;
}
.landing-content-layout.photo-pos-above .rich-content-body {
  order: 2;
}

/* Photo Position Below */
.landing-content-layout.photo-pos-below .rich-content-body {
  order: 1;
}
.landing-content-layout.photo-pos-below .tab-gallery-container {
  order: 2;
  margin: 20px auto 10px;
}

/* Gallery Container */
.tab-gallery-container {
  width: 100%;
  max-width: 860px;
}

/* Gallery Layout: Grid */
.gallery-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  justify-content: center;
}

/* Gallery Layout: Strip (Horizontal scroll / flex) */
.gallery-layout-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.gallery-layout-strip .gallery-photo-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* Gallery Layout: Stacked (Full-width vertical stack) */
.gallery-layout-stacked {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gallery-layout-stacked .gallery-photo-item {
  width: 100%;
  max-height: 420px;
}

/* Gallery Layout: Single */
.gallery-layout-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gallery-layout-single .gallery-photo-item {
  max-width: 100%;
  max-height: 440px;
}

/* Individual Photo Card */
.gallery-photo-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-photo-item:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.gallery-photo-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-layout-stacked .gallery-photo-item img {
  height: 360px;
}
.gallery-layout-single .gallery-photo-item img {
  height: 380px;
}
.gallery-photo-item:hover img {
  transform: scale(1.04);
}

/* ========================================================
   Mobile Device & Touch UI Optimization (<= 768px & <= 480px)
   ======================================================== */
@media (max-width: 768px) {
  /* Header ergonomics */
  .ribap-header {
    height: 56px;
    padding: 0 14px;
  }
  .header-left {
    gap: 10px;
  }
  .hamburger-btn {
    width: 28px;
    height: 20px;
    padding: 1px 0;
  }
  .search-btn {
    width: 36px;
    height: 36px;
  }
  .header-logo {
    font-size: 20px;
    letter-spacing: 2px;
  }
  .header-right {
    gap: 8px;
  }
  .btn-signin {
    font-size: 12.5px;
    padding: 7px 14px;
    min-height: 36px;
  }
  .user-avatar-btn {
    width: 36px;
    height: 36px;
  }

  /* Landing Page horizontal swipeable pill bar */
  .landing-container {
    width: 100%;
    padding: 0 14px;
    margin: 16px auto 32px;
  }
  .tabs-bar {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    gap: 8px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 18px;
  }
  .tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s ease;
  }
  .tab-btn:hover,
  .tab-btn:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
  }
  .tab-btn.active {
    background: rgba(81, 207, 255, 0.22);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 2px 10px rgba(81, 207, 255, 0.25);
  }
  .tab-btn.active::after {
    display: none;
  }

  /* Landing Content Card */
  .content-placeholder-card {
    padding: 24px 18px;
    min-height: auto;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  .placeholder-badge {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 14px;
  }
  .placeholder-title {
    font-size: clamp(20px, 5.5vw, 26px);
    margin-bottom: 12px;
    line-height: 1.3;
    text-align: center;
  }
  .placeholder-desc {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 20px;
  }
  .placeholder-desc.rich-content-body {
    text-align: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
  }
  .placeholder-desc.rich-content-body p {
    text-indent: 0 !important;
    margin-bottom: 12px;
  }
  .placeholder-desc.rich-content-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
  }
  .content-placeholder-card a.btn-signin,
  .landing-cta-btn {
    width: 100%;
    max-width: 360px;
    min-height: 48px;
    padding: 13px 20px;
    font-size: 14px;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  }

  /* Action Plan Dashboard */
  .dashboard-container {
    width: 100%;
    padding: 0 14px;
    margin: 16px auto 32px;
  }
  .plan-header-card {
    padding: 18px 16px;
    border-radius: 12px;
    gap: 12px;
  }
  .plan-header-top {
    flex-wrap: wrap;
    gap: 10px;
  }
  .plan-title {
    font-size: 20px;
    line-height: 1.3;
  }
  .badge-active {
    font-size: 11.5px;
    padding: 3px 10px;
  }
  .dashboard-subtabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .dashboard-subtabs::-webkit-scrollbar {
    display: none;
  }
  .subtab-btn {
    flex-shrink: 0;
    font-size: 13.5px;
    padding: 7px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
  }
  .subtab-btn.active {
    background: rgba(81, 207, 255, 0.2);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
  }
  .subtab-btn.active::after {
    display: none;
  }
  .plan-gradient-container {
    padding: 18px 14px;
    border-radius: 14px;
    gap: 14px;
  }
  .plan-item-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
    border-radius: 10px;
  }
  .plan-item-card .btn-item-action {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
  }
  .plan-item-left h4 {
    font-size: 16px;
    line-height: 1.35;
  }
  .plan-item-left p {
    font-size: 13px;
    line-height: 1.5;
  }

  /* Footer & Multi-photo Responsive Layout for Tablets & Mobile */
  .footer-details-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    text-align: left !important;
    margin-bottom: 24px;
  }
  .footer-col {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .footer-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 12px;
  }
  .footer-bottom-left,
  .footer-bottom-right {
    justify-content: center;
    text-align: center;
  }
  .landing-content-layout.photo-pos-left,
  .landing-content-layout.photo-pos-right {
    flex-direction: column !important;
  }
  .landing-content-layout.photo-pos-left .tab-gallery-container,
  .landing-content-layout.photo-pos-right .tab-gallery-container,
  .landing-content-layout.photo-pos-left .rich-content-body,
  .landing-content-layout.photo-pos-right .rich-content-body {
    width: 100% !important;
  }
  .gallery-layout-grid {
    grid-template-columns: 1fr;
  }
  .gallery-photo-item img {
    height: 200px;
  }

  /* Footer safe area on mobile */
  .ribap-footer {
    padding: 36px 18px max(24px, env(safe-area-inset-bottom));
    font-size: 12.5px;
  }
}

/* Extra small mobile screens (<= 400px) */
@media (max-width: 400px) {
  .header-logo {
    font-size: 18px;
    letter-spacing: 1px;
  }
  .header-left {
    gap: 8px;
  }
  .search-btn {
    width: 32px;
    height: 32px;
  }
  .header-right {
    gap: 6px;
  }
  .btn-signin {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .btn-admin-header {
    padding: 5px 8px;
    font-size: 10px;
  }
}

/* ==========================================================================
   RIBAP Global Footer - Theme Modes & Dynamic Photo Gallery
   ========================================================================== */
.ribap-footer.tab-theme-dark {
  color: #1e293b !important;
  border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08) !important;
}
.ribap-footer.tab-theme-dark .footer-col-brand .footer-heading {
  color: #0f172a !important;
}
.ribap-footer.tab-theme-dark .footer-tagline {
  color: #0284c7 !important;
}
.ribap-footer.tab-theme-dark .footer-about-text {
  color: #334155 !important;
}
.ribap-footer.tab-theme-dark .footer-brand-badge {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #0369a1 !important;
}
.ribap-footer.tab-theme-dark .footer-heading {
  color: #0f172a !important;
}
.ribap-footer.tab-theme-dark .footer-heading::after {
  background: #0284c7 !important;
}
.ribap-footer.tab-theme-dark .footer-link-list li a {
  color: #334155 !important;
}
.ribap-footer.tab-theme-dark .footer-link-list li a:hover {
  color: #0284c7 !important;
}
.ribap-footer.tab-theme-dark .contact-icon {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.28) !important;
}
.ribap-footer.tab-theme-dark .contact-label {
  color: #64748b !important;
}
.ribap-footer.tab-theme-dark .contact-text-wrap a {
  color: #0369a1 !important;
}
.ribap-footer.tab-theme-dark .contact-text-wrap span {
  color: #1e293b !important;
}
.ribap-footer.tab-theme-dark .footer-notice-bar {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
  color: #0369a1 !important;
}
.ribap-footer.tab-theme-dark .footer-bottom-bar {
  border-top-color: rgba(0, 0, 0, 0.1) !important;
  color: #64748b !important;
}
.ribap-footer.tab-theme-dark .footer-bottom-right a {
  color: #334155 !important;
}
.ribap-footer.tab-theme-dark .footer-bottom-right a:hover {
  color: #0284c7 !important;
}
.ribap-footer.tab-theme-dark .footer-admin-link {
  color: #0284c7 !important;
}

/* Footer Multi-Photo Gallery Styles */
.footer-gallery-wrap {
  max-width: 1240px;
  margin: 0 auto 32px;
  box-sizing: border-box;
}
.footer-gallery-wrap.pos-below {
  margin: 32px auto 24px;
}
.footer-gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.footer-gallery-container.gallery-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}
.footer-gallery-container.gallery-layout-strip {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 8px;
  scrollbar-width: thin;
  justify-content: center;
}
.footer-gallery-container.gallery-layout-stacked {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.footer-gallery-container.gallery-layout-single {
  display: flex;
  justify-content: center;
}
.footer-photo-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.footer-photo-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}
.footer-photo-card img {
  max-height: 65px;
  max-width: 100%;
  object-fit: contain;
}
.tab-theme-dark .footer-photo-card {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}
.tab-theme-dark .footer-photo-card:hover {
  background: rgba(0, 0, 0, 0.08);
}
.footer-about-text.rich-content-body p {
  margin: 0 0 10px;
}
.footer-about-text.rich-content-body p:last-child {
  margin-bottom: 0;
}
.footer-about-text.rich-content-body ul, .footer-about-text.rich-content-body ol {
  padding-left: 20px;
  margin: 8px 0;
}
.footer-about-text.rich-content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

/* Clickable Thesis PDF Footer Badge */
a.footer-brand-badge, div.footer-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(81, 207, 255, 0.1);
  border: 1px solid rgba(81, 207, 255, 0.28);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 700;
  width: fit-content;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
a.footer-brand-badge:hover {
  background: rgba(81, 207, 255, 0.22);
  border-color: #51cfff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(81, 207, 255, 0.35);
  color: #ffffff;
}
.badge-pdf-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}
a.footer-brand-badge:hover .badge-pdf-tag {
  background: #ef4444;
  color: #ffffff;
}
.tab-theme-dark a.footer-brand-badge, .tab-theme-dark div.footer-brand-badge {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #0369a1 !important;
}
.tab-theme-dark a.footer-brand-badge:hover {
  background: rgba(2, 132, 199, 0.22) !important;
  border-color: #0284c7 !important;
  color: #0c4a6e !important;
}

/* ==========================================================================
   Section Worksheets Customizer & Participant Interactive Cards
   ========================================================================== */
.worksheet-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.worksheet-card.tab-theme-dark {
  color: #0b0e36;
}
.worksheet-card.tab-theme-dark h2,
.worksheet-card.tab-theme-dark h3,
.worksheet-card.tab-theme-dark h4 {
  color: #0b0e36;
}
.worksheet-card.tab-theme-light {
  color: #e2e8f0;
}
.worksheet-card.tab-theme-light h2,
.worksheet-card.tab-theme-light h3,
.worksheet-card.tab-theme-light h4 {
  color: #ffffff;
}

.worksheet-card.tab-theme-light hr {
  border: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}
.worksheet-card.tab-theme-dark hr {
  border: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
}

.interactive-reflection-box textarea {
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.interactive-reflection-box textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(66, 85, 255, 0.25);
}

.badge-admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.landing-admin-actions-wrap {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .landing-admin-actions-wrap {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  .landing-admin-actions-wrap .btn-signin {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
}
