/* ========================================================
   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.3s ease;
}

.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)
   ======================================================== */
.ribap-footer {
  margin-top: auto;
  padding: 24px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-weight: 500;
}

.ribap-footer a {
  color: #ffffff;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.ribap-footer a:hover {
  opacity: 0.8;
}

/* ========================================================
   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 safe area */
  .ribap-footer {
    padding: 20px 14px max(24px, env(safe-area-inset-bottom));
    font-size: 12px;
  }
}

/* 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;
  }
}
