/* ==========================================================================
   TPM-VP-CTE5 Web Application — Visual Infographic & Light Pastel Design
   Varopakorn Public Company Limited | Caster No.5 (CTE5)
   ========================================================================== */

:root {
  --bg-main: #F4F7FB;
  --bg-card: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --border-pastel: #DDE5F0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #EAF2FF 0%, #F8F9FE 50%, #FFFDF9 100%);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

/* Top Navigation Tab Pills */
.top-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.top-page-btn:hover {
  border-color: #93C5FD;
  background: #F0F9FF;
  transform: translateY(-1px);
}

.top-page-btn.active {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  color: #FFFFFF;
  border-color: #1D4ED8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* Sub-module navigation pills inside the 10-Module Hub */
.module-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.module-pill:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.module-pill.active {
  background: linear-gradient(135deg, #E0F2FE 0%, #EDE9FE 100%);
  color: #0369A1;
  border-color: #38BDF8;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   INFOGRAPHIC POSTER BOARD CONTAINER (MATCHING IMAGE 2 STYLE)
   ========================================================================== */

.infographic-board {
  background: linear-gradient(180deg, #EBF3FF 0%, #F7FAFF 60%, #FFFDF8 100%);
  border: 3px solid #BFDBFE;
  border-radius: 1.75rem;
  padding: 1.25rem;
  box-shadow: 0 14px 36px -6px rgba(30, 64, 175, 0.12);
  position: relative;
}

/* Top Navy & Gold Banner Header */
.infographic-top-banner {
  background: linear-gradient(90deg, #0F2952 0%, #1E4278 65%, #2B579A 100%);
  border-radius: 1.35rem;
  padding: 0.85rem 1.5rem;
  color: #FFFFFF;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 3px solid #3B82F6;
  box-shadow: 0 8px 20px rgba(15, 41, 82, 0.22);
  position: relative;
}

.infographic-yellow-pill {
  background: linear-gradient(180deg, #FEF08A 0%, #FDE047 100%);
  color: #1E293B;
  border: 3px solid #1E293B;
  border-radius: 9999px;
  padding: 0.35rem 1.35rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.speech-bubble-top {
  background: #FFFFFF;
  color: #0F172A;
  border: 2.5px solid #1E3A8A;
  border-radius: 1.25rem;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  position: relative;
}

/* 4-Column Problem Cards */
.infographic-col-card {
  background: #FFFFFF;
  border-radius: 1.35rem;
  border: 2.5px solid #CBD5E1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.infographic-col-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.15);
}

.col-theme-blue { border-color: #60A5FA; background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 35%); }
.col-theme-red { border-color: #F87171; background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 35%); }
.col-theme-green { border-color: #4ADE80; background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 35%); }
.col-theme-amber { border-color: #FBBF24; background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 35%); }

.col-header-banner {
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.col-number-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: #FFFFFF;
  flex-shrink: 0;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Scene Image Frame with Speech Bubble Overlay */
.scene-frame {
  position: relative;
  margin: 0.6rem 0.75rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid #CBD5E1;
  background: #F8FAFC;
  height: 175px;
}

.scene-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-speech-bubble {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  max-width: 56%;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #334155;
  border-radius: 1rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.scene-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 20px;
  border-width: 8px 6px 0;
  border-style: solid;
  border-color: #334155 transparent;
  display: block;
  width: 0;
}

/* Waste Letter Square Badge */
.waste-letter-box {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Bottom DOWNTIME + 3MU + TPM Goal Strip */
.infographic-bottom-strip {
  margin-top: 1.1rem;
  background: #FFFFFF;
  border: 2.5px solid #CBD5E1;
  border-radius: 1.35rem;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Pastel Card Generic */
.pastel-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-pastel);
  border-radius: 1.15rem;
  box-shadow: 0 4px 16px -2px rgba(148, 163, 184, 0.12);
}

/* Traffic Light Badges */
.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.traffic-green { background-color: #DCFCE7; color: #047857; border: 1px solid #A7F3D0; }
.traffic-yellow { background-color: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.traffic-red { background-color: #FFE4E6; color: #BE123C; border: 1px solid #FECDD3; }

.traffic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.traffic-green .traffic-dot { background-color: #10B981; }
.traffic-yellow .traffic-dot { background-color: #F59E0B; }
.traffic-red .traffic-dot { background-color: #F43F5E; }

/* ==========================================================================
   PAGE 3: ARCHITECTURAL TPM HOUSE & CLASSICAL 8 PILLARS (MATCHING REFERENCE)
   ========================================================================== */

.tpm-house-container {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 60%, #F8FAFC 100%);
  border-radius: 1.75rem;
  border: 3px solid #93C5FD;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 14px 36px -6px rgba(30, 64, 175, 0.14);
}

/* 1. Triangular Gable Roof (หลังคาบ้านทรงจั่วสามเหลี่ยม) */
.tpm-gable-roof-wrap {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding-top: 0.25rem;
}

.tpm-gable-svg-container {
  position: relative;
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2.4rem 2rem 1rem;
}

.tpm-gable-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.10));
}

.tpm-gable-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  text-align: center;
}

/* Stepped Architrave Cornice & Beam below the Triangle */
.tpm-architrave-cornice {
  width: 100%;
  height: 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 100%);
  border: 2px solid #94A3B8;
  border-radius: 3px;
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.08);
}

.tpm-roof-beam {
  width: 96%;
  margin: 0 auto;
  background: linear-gradient(90deg, #0F2952 0%, #1E40AF 50%, #0F2952 100%);
  border: 2px solid #1E3A8A;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.5rem 1rem;
  text-align: center;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 6px 14px rgba(15, 41, 82, 0.18);
}

/* 2. The 8 Classical Stepped Pillars Grid */
.tpm-pillars-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.5rem;
  width: 95%;
  margin: 0.35rem auto 0;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .tpm-pillars-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .tpm-pillars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

/* Individual Classical Column */
.tpm-classical-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease;
  position: relative;
}

.tpm-classical-pillar:hover {
  transform: translateY(-4px);
}

/* Capital (บัวหัวเสา 3 ชั้น) */
.tpm-cap-tier1 {
  width: 96%;
  padding: 0.35rem 0.25rem;
  border-radius: 4px 4px 12px 12px;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.tpm-cap-tier2 {
  width: 80%;
  height: 9px;
  margin-top: 2px;
  border-radius: 2px 2px 8px 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.tpm-cap-tier3 {
  width: 68%;
  height: 6px;
  margin-top: 2px;
  border-radius: 2px;
}

/* Column Shaft (ลำตัวเสาทรงกระบอกเรียวตรงกลาง) */
.tpm-col-shaft {
  width: 64%;
  min-height: 250px;
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 0.65rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-shadow:
    inset 10px 0 16px rgba(255, 255, 255, 0.28),
    inset -10px 0 18px rgba(0, 0, 0, 0.22),
    0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  overflow: hidden;
}

/* Subtle architectural vertical fluting lines on the column shaft */
.tpm-col-shaft::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.10) 0px,
    rgba(255, 255, 255, 0.10) 3px,
    transparent 3px,
    transparent 11px
  );
  pointer-events: none;
}

.tpm-shaft-vertical-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Pedestal Base (บัวฐานเสา 3 ชั้น) */
.tpm-base-tier1 {
  width: 68%;
  height: 6px;
  border-radius: 2px;
}

.tpm-base-tier2 {
  width: 82%;
  height: 9px;
  margin-top: 2px;
  border-radius: 8px 8px 2px 2px;
}

.tpm-base-tier3 {
  width: 96%;
  margin-top: 2px;
  padding: 0.3rem 0.25rem;
  border-radius: 10px 10px 3px 3px;
  text-align: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: #FFFFFF;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
}

/* 3. Stepped Temple Floor Platform (แท่นพื้นบ้าน 2 ชั้นใต้ฐานเสา) */
.tpm-platform-step1 {
  width: 96%;
  height: 14px;
  margin: 0 auto;
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 100%);
  border: 2px solid #94A3B8;
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

.tpm-platform-step2 {
  width: 100%;
  min-height: 22px;
  margin: 0 auto;
  background: linear-gradient(180deg, #F8FAFC 0%, #CBD5E1 100%);
  border: 2px solid #64748B;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1E293B;
}

/* 4. Circular Icon Medallions & Responsible Cards Below Platform */
.tpm-medallions-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.5rem;
  width: 98%;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .tpm-medallions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .tpm-medallions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

.tpm-medallion-circle {
  width: 74px;
  height: 74px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 3px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
  transition: all 0.2s ease;
  cursor: pointer;
}

.tpm-medallion-circle:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.tpm-foundation-tier1 {
  background: linear-gradient(90deg, #DCFCE7 0%, #A7F3D0 50%, #DCFCE7 100%);
  border: 2.5px solid #10B981;
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  margin-top: 1rem;
}

.tpm-foundation-tier2 {
  background: linear-gradient(90deg, #FEF3C7 0%, #FDE68A 50%, #FEF3C7 100%);
  border: 2.5px solid #F59E0B;
  border-radius: 1rem;
  padding: 0.75rem 1.15rem;
  margin-top: 0.5rem;
}

.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   PAGE 2: OEE OUTPUT BASE & TIME BASE SUMMARY BOARD (MATCHING REFERENCE IMAGE)
   ========================================================================== */

.oee-dual-wrapper {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 3px solid #93C5FD;
  border-radius: 1.75rem;
  padding: 1.25rem;
  box-shadow: 0 14px 34px -6px rgba(15, 41, 82, 0.14);
}

.oee-dual-top-pill {
  background: linear-gradient(180deg, #133E7C 0%, #09254E 100%);
  color: #FFFFFF;
  border-radius: 1.25rem;
  padding: 0.65rem 2rem;
  box-shadow: 0 6px 18px rgba(9, 37, 78, 0.28);
  border: 2.5px solid #3B82F6;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.oee-method-panel-blue {
  background: linear-gradient(180deg, #E3F1FF 0%, #F2F8FF 100%);
  border: 3px solid #1E64B7;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(30, 100, 183, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.oee-method-panel-green {
  background: linear-gradient(180deg, #E4F7EA 0%, #F3FBF6 100%);
  border: 3px solid #1B7A3D;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(27, 122, 61, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.oee-method-header-blue {
  background: linear-gradient(180deg, #124382 0%, #092A58 100%);
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 0.45rem 1.8rem;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(9, 42, 88, 0.25);
  width: fit-content;
  margin: 0 auto 0.75rem auto;
  border: 2px solid #60A5FA;
}

.oee-method-header-green {
  background: linear-gradient(180deg, #14632F 0%, #0A3E1B 100%);
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 0.45rem 1.8rem;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(10, 62, 27, 0.25);
  width: fit-content;
  margin: 0 auto 0.75rem auto;
  border: 2px solid #4ADE80;
}

.oee-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  background: #FFFFFF;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.oee-data-table th {
  padding: 0.4rem 0.35rem;
  font-weight: 800;
  color: #FFFFFF;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.78rem;
}

.oee-data-table td {
  padding: 0.3rem 0.35rem;
  border-bottom: 1px solid #CBD5E1;
  border-right: 1px solid #CBD5E1;
}

.oee-data-table tr:last-child td {
  border-bottom: none;
}

.oee-breakdown-row td {
  background-color: #FFE4E6 !important;
  border-top: 2.5px solid #EF4444 !important;
  border-bottom: 2.5px solid #EF4444 !important;
  color: #991B1B;
  font-weight: 800;
}

.oee-breakdown-row td:first-child {
  border-left: 2.5px solid #EF4444 !important;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.oee-breakdown-row td:last-child {
  border-right: 2.5px solid #EF4444 !important;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.oee-table-input {
  width: 68px;
  padding: 0.16rem 0.3rem;
  border-radius: 0.38rem;
  border: 1.5px solid #94A3B8;
  background: #FFFFFF;
  font-weight: 800;
  text-align: right;
  color: #0F172A;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.oee-table-input-std {
  border-color: #64748B;
  background: #F8FAFC;
  color: #1E293B;
}

.oee-table-input-act {
  border-color: #2563EB;
  background: #FFFFFF;
  color: #0F172A;
}

.oee-method-panel-purple {
  background: linear-gradient(180deg, #EEF2FF 0%, #F8FAFC 100%);
  border: 3px solid #3730A3;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(55, 48, 163, 0.12);
}

.oee-method-header-purple {
  background: linear-gradient(180deg, #1E3A8A 0%, #0F172A 100%);
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 0.45rem 1.8rem;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  width: fit-content;
  margin: 0 auto 0.75rem auto;
  border: 2px solid #818CF8;
}

.oee-table-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: #FEFCE8;
}

.oee-math-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.15;
  margin: 0 0.2rem;
}

.oee-math-frac > .num {
  border-bottom: 2.5px solid currentColor;
  padding: 0 0.45rem 0.12rem;
  font-weight: 900;
}

.oee-math-frac > .den {
  padding: 0.12rem 0.45rem 0;
  font-weight: 900;
}

@media print {
  .no-print { display: none !important; }
  body { background: #FFFFFF !important; }
}
