/* ==========================================================================
   TVS PROJECTS DASHBOARD STYLES
   ========================================================================== */

.tvs-app-container {
  --tvs-primary-red: #A9121F;
  --tvs-primary-red-bg: #FDF2F4;
  --tvs-primary-red-border: #F8D7DA;
  
  --tvs-teal-green: #0D9488;
  --tvs-teal-bg: #CCFBF1;
  --tvs-teal-border: #99F6E4;

  --tvs-blue: #2563EB;
  --tvs-blue-bg: #EFF6FF;
  --tvs-blue-border: #BFDBFE;

  --tvs-amber: #D97706;
  --tvs-amber-bg: #FEF3C7;
  --tvs-amber-border: #FDE68A;

  --tvs-purple: #7C3AED;
  --tvs-purple-bg: #F3E8FF;
  --tvs-purple-border: #DDD6FE;

  --tvs-text-dark: #1E293B;
  --tvs-text-muted: #64748B;
  --tvs-text-light: #94A3B8;

  --tvs-card-bg: #FFFFFF;
  --tvs-body-bg: #F8FAFC;
  --tvs-border-color: #E2E8F0;

  font-family: 'Noto Sans Lao', system-ui, -apple-system, sans-serif;
  color: var(--tvs-text-dark);
  background-color: var(--tvs-body-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(240, 243, 248, 0.8) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(235, 240, 248, 0.8) 0%, transparent 40%);
  border-radius: 28px;
  padding: 36px 28px;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.tvs-app-container * {
  box-sizing: border-box;
}

/* HEADER SECTION */
.tvs-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.tvs-main-title {
  font-family: 'Noto Serif Lao', serif;
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tvs-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tvs-top-icons {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tvs-text-muted);
}

.tvs-icon-btn {
  background: transparent;
  border: none;
  color: var(--tvs-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tvs-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--tvs-primary-red);
}

.tvs-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--tvs-text-muted);
  text-align: right;
  max-width: 320px;
}

/* NAV & FILTER BAR */
.tvs-filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.tvs-pill-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #EAEFF5;
  padding: 5px;
  border-radius: 999px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.tvs-pill-container::-webkit-scrollbar {
  display: none;
}

.tvs-filter-btn {
  border: none;
  background: transparent;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Noto Sans Lao', sans-serif;
  color: var(--tvs-text-muted);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.tvs-filter-btn:hover {
  color: var(--tvs-text-dark);
}

.tvs-filter-btn.active {
  background: #FFFFFF;
  color: var(--tvs-text-dark);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tvs-filter-btn[data-category="all"].active {
  background: var(--tvs-primary-red);
  color: #FFFFFF;
}

.tvs-view-toggle-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #EAEFF5;
  padding: 4px;
  border-radius: 12px;
}

.tvs-toggle-icon-btn {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--tvs-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tvs-toggle-icon-btn.active {
  background: #FFFFFF;
  color: var(--tvs-text-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* LAYOUT VIEWS */
.tvs-content-area {
  width: 100%;
}

.tvs-hybrid-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.tvs-timeline-col {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 12px;
}

.tvs-cards-col {
  grid-column: span 7;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.tvs-card-span-2 {
  grid-column: span 2;
}

.tvs-card {
  background: var(--tvs-card-bg);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.7);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.tvs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
  border-color: rgba(203, 213, 225, 0.9);
}

.tvs-card-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
}

.tvs-card-hero .tvs-card-img-wrapper {
  height: 100%;
  min-height: 160px;
  margin-bottom: 0;
}

.tvs-card-img-wrapper {
  width: 100%;
  height: 170px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  background: #F1F5F9;
}

.tvs-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tvs-card:hover .tvs-card-img {
  transform: scale(1.05);
}

.tvs-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.tvs-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tvs-text-dark);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tvs-card-desc {
  font-size: 13px;
  color: var(--tvs-text-muted);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tvs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
}

.tvs-location-pin {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--tvs-text-light);
  font-size: 12px;
}

/* BADGES */
.tvs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}

.tvs-badge-red { background: var(--tvs-primary-red-bg); color: var(--tvs-primary-red); border: 1px solid var(--tvs-primary-red-border); }
.tvs-badge-teal { background: var(--tvs-teal-bg); color: var(--tvs-teal-green); border: 1px solid var(--tvs-teal-border); }
.tvs-badge-blue { background: var(--tvs-blue-bg); color: var(--tvs-blue); border: 1px solid var(--tvs-blue-border); }
.tvs-badge-amber { background: var(--tvs-amber-bg); color: var(--tvs-amber); border: 1px solid var(--tvs-amber-border); }
.tvs-badge-purple { background: var(--tvs-purple-bg); color: var(--tvs-purple); border: 1px solid var(--tvs-purple-border); }

/* TIMELINE */
.tvs-timeline-wrapper {
  position: relative;
  padding-left: 90px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tvs-timeline-wrapper::before {
  content: '';
  position: absolute;
  left: 72px;
  top: 15px;
  bottom: 25px;
  width: 3px;
  background: linear-gradient(180deg, #A9121F 0%, #2563EB 50%, #D97706 100%);
  border-radius: 3px;
  opacity: 0.6;
}

.tvs-timeline-node {
  position: relative;
  display: flex;
  align-items: center;
}

.tvs-timeline-date {
  position: absolute;
  left: -90px;
  width: 60px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--tvs-text-dark);
}

.tvs-timeline-dot {
  position: absolute;
  left: -24px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3.5px solid var(--tvs-blue);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.tvs-timeline-dot.dot-red { border-color: var(--tvs-primary-red); }
.tvs-timeline-dot.dot-blue { border-color: var(--tvs-blue); }
.tvs-timeline-dot.dot-amber { border-color: var(--tvs-amber); }
.tvs-timeline-dot.dot-teal { border-color: var(--tvs-teal-green); }

.tvs-timeline-pill-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: all 0.25s ease;
}

.tvs-timeline-pill-card:hover {
  background: #FFFFFF;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  transform: translateX(4px);
}

.tvs-timeline-pill-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tvs-text-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* VIEW SWITCH OVERRIDES */
.tvs-view-pure-grid .tvs-hybrid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tvs-view-pure-grid .tvs-timeline-col { display: none; }

.tvs-view-pure-grid .tvs-cards-col {
  grid-column: span 12;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tvs-view-pure-grid .tvs-card-hero {
  display: flex;
  flex-direction: column;
  grid-column: auto;
}

.tvs-view-pure-grid .tvs-card-hero .tvs-card-img-wrapper {
  height: 170px;
  width: 100%;
}

.tvs-view-pure-grid .tvs-card-span-2 { grid-column: auto; }

.tvs-view-pure-timeline .tvs-hybrid-grid { display: block; }
.tvs-view-pure-timeline .tvs-cards-col { display: none; }
.tvs-view-pure-timeline .tvs-timeline-col {
  grid-column: span 12;
  max-width: 800px;
  margin: 0 auto;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .tvs-hybrid-grid { grid-template-columns: 1fr; }
  .tvs-timeline-col { grid-column: span 1; margin-bottom: 20px; }
  .tvs-cards-col { grid-column: span 1; }
}

@media (max-width: 640px) {
  .tvs-app-container { padding: 24px 16px; border-radius: 20px; }
  .tvs-header-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tvs-header-right { align-items: flex-start; }
  .tvs-subtitle { text-align: left; }
  .tvs-cards-col { grid-template-columns: 1fr; }
  .tvs-card-span-2 { grid-column: span 1; }
  .tvs-card-hero { display: flex; flex-direction: column; }
  .tvs-card-hero .tvs-card-img-wrapper { height: 170px; }
  .tvs-timeline-wrapper { padding-left: 60px; }
  .tvs-timeline-wrapper::before { left: 45px; }
  .tvs-timeline-date { left: -60px; width: 40px; font-size: 11px; }
  .tvs-timeline-dot { left: -20px; }
}