/**
 * Madrasah Fatih Timeline Page Styles
 * CSS (css/linimasa.css)
 * Implements: Split layout, left column sticky years, right column scroll cards,
 * spreadsheet integration look, active tags, and filters.
 */

.timeline-page-wrapper {
  padding-top: 130px; /* Space for navigation bar */
}

/* Page Intro Header */
.timeline-header-section {
  background-color: var(--bg-white);
  padding: 72px 0 52px 0;
  border-bottom: 1px solid rgba(106, 36, 97, 0.06);
}

.timeline-header-section .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}

.timeline-header-compact {
  padding: 60px 0 40px !important;
}

.timeline-header-compact .container {
  display: block !important;
  text-align: center !important;
}

/* Category Filter Tags */
.timeline-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}

.filter-btn {
  background-color: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid rgba(61, 27, 115, 0.1);
  padding: 8px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--accent-orange);
  color: #fff;
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-neon);
  transform: translateY(-2px);
}

/* Split Main Container */
.timeline-split-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: flex-start;
  margin: 40px 0 80px 0;
}

/* Left Sticky Years Column */
.timeline-left-years {
  position: sticky;
  top: 140px; /* Positions below the sticky header navbar */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: var(--border-radius-xl);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(106, 36, 97, 0.08);
}

.timeline-year-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-purple-dark);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(106, 36, 97, 0.08);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.timeline-year-item {
  font-size: 24px;
  font-weight: 800;
  color: rgba(106, 36, 97, 0.45);
  cursor: pointer;
  transition: var(--transition-normal);
  padding: 8px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid transparent;
}

.timeline-year-item:hover {
  color: var(--primary-purple);
  background-color: rgba(106, 36, 97, 0.04);
}

.timeline-year-item.active {
  color: var(--accent-orange);
  background-color: rgba(242, 115, 41, 0.06);
  border-left-color: var(--accent-orange);
  padding-left: 24px;
}

/* Right Scrollable Timeline Events Column */
.timeline-right-events {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Timeline Cards */
.timeline-event-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  background-color: var(--bg-white);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(106, 36, 97, 0.07);
  border-left: 4px solid transparent;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  cursor: pointer;
}

.timeline-event-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-orange);
  border-left-color: var(--accent-orange);
}

.timeline-event-img-wrap {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.timeline-event-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.timeline-event-card:hover .timeline-event-img {
  transform: scale(1.08);
}

.timeline-event-year-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--gradient-orange-pink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 50px;
  box-shadow: var(--shadow-neon);
  z-index: 2;
  letter-spacing: 0.5px;
}

.timeline-event-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-event-cat-tag {
  background-color: rgba(106, 36, 97, 0.05);
  color: var(--primary-purple);
  font-size: 10px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 50px;
  align-self: flex-start;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.timeline-event-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-purple-dark);
  line-height: 1.3;
  margin-bottom: 12px;
}

.timeline-event-card:hover .timeline-event-title {
  color: var(--accent-orange);
}

.timeline-event-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.timeline-readmore {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-purple);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Empty State */
.timeline-empty-state {
  background-color: var(--bg-white);
  padding: 80px 40px;
  text-align: center;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(61, 27, 115, 0.05);
}

.timeline-empty-state i {
  font-size: 48px;
  color: var(--primary-purple-light);
  margin-bottom: 16px;
}

.timeline-empty-state h4 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-purple-dark);
  margin-bottom: 8px;
}

.timeline-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Spreadsheet Info Panel */
.spreadsheet-info-panel {
  background: linear-gradient(135deg, #eef7ee 0%, #dff2df 100%);
  border: 1px solid #b2dbb2;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  margin-bottom: 40px;
  color: #2b542b;
}

.spreadsheet-info-panel h4 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e3d1e;
}

.spreadsheet-info-panel h4 i {
  color: #27ae60;
}

.spreadsheet-info-panel p {
  font-size: 14px;
  line-height: 1.6;
}

.spreadsheet-info-panel code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  color: #c0392b;
}

/* ==========================================================
   MOBILE YEAR NAVIGATOR (< Tahun >)
   ========================================================== */
.mobile-year-nav {
  display: none; /* Hidden by default — shown on mobile via media query */
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(106, 36, 97, 0.12);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(106, 36, 97, 0.10);
  padding: 6px;
  margin: 24px auto 40px auto;
  width: fit-content;
  min-width: 240px;
  position: sticky;
  top: 110px;
  z-index: 40;
}

.mobile-year-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--primary-purple-dark);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.mobile-year-btn:hover:not(:disabled) {
  background: var(--gradient-orange-pink);
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.mobile-year-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mobile-year-label {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-purple-dark);
  letter-spacing: -1px;
  min-width: 120px;
  text-align: center;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  padding: 8px 0;
}

/* ==========================================================
   6. RESPONSIVE MEDIA QUERIES FOR TIMELINE
   ========================================================== */
@media (max-width: 992px) {
  .timeline-split-container {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 36px; /* Added spacing to separate content from sticky navigator */
  }

  /* Hide desktop sidebar — mobile uses the year navigator instead */
  .timeline-left-years {
    display: none;
  }

  /* Show mobile year navigator */
  .mobile-year-nav {
    display: flex;
  }

  .timeline-event-card {
    grid-template-columns: 200px 1fr;
  }
}

@media (max-width: 768px) {
  .timeline-header-section .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .timeline-event-card {
    grid-template-columns: 1fr;
  }

  .timeline-event-img-wrap {
    height: 200px;
  }

  .timeline-event-body {
    padding: 20px;
  }

  .timeline-event-title {
    font-size: 18px;
  }

  .mobile-year-nav {
    top: 98px;
    min-width: 180px;
    padding: 4px;
    margin: 20px auto 36px auto;
  }

  .mobile-year-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .mobile-year-label {
    font-size: 20px;
    min-width: 80px;
    padding: 4px 0;
  }
}

/* ==========================================================
   VIDEO SHOWCASE SECTION
   ========================================================== */
.timeline-video-section {
  padding: 40px 0 60px 0;
  background-color: var(--bg-white);
  border-bottom: 1px solid rgba(106, 36, 97, 0.05);
}

/* YouTube-style video player layout */
.video-player-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 30px;
  align-items: stretch;
  background: var(--bg-white);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(106, 36, 97, 0.06);
  overflow: hidden;
  padding: 24px;
}

.video-main-player {
  display: flex;
  flex-direction: column;
}

.video-main-player .video-container {
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.video-title-wrapper {
  border: 1px solid rgba(106, 36, 97, 0.12);
  border-left: 4px solid var(--accent-orange);
  background-color: rgba(106, 36, 97, 0.03);
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
}

.video-main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-purple-dark);
  margin: 0;
  line-height: 1.3;
  text-align: left;
}

/* Playlist sidebar */
.video-playlist-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(106, 36, 97, 0.05);
  padding: 18px;
  max-height: 480px; /* aligns roughly with 16:9 player height */
  overflow-y: auto;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(106, 36, 97, 0.08);
  margin-bottom: 14px;
}

.playlist-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-purple-dark);
}

.playlist-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.playlist-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playlist-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  cursor: pointer;
  border-radius: var(--border-radius-md);
  padding: 8px;
  transition: all var(--transition-fast);
  background: transparent;
  user-select: none;
  text-align: left;
}

.playlist-item:hover {
  background: rgba(106, 36, 97, 0.04);
}

.playlist-item.active {
  background: rgba(106, 36, 97, 0.08);
  border-left: 3px solid var(--accent-orange);
}

.playlist-thumb-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  height: 68px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.playlist-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.playlist-item:hover .playlist-thumb {
  transform: scale(1.05);
}

.playlist-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 3px;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(106, 36, 97, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.playlist-item:hover .play-overlay {
  opacity: 1;
}

.playlist-item.active .play-overlay {
  opacity: 0; /* don't show play icon when actively playing */
}

.playlist-item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.playlist-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-purple-dark);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item.active .playlist-item-title {
  color: var(--accent-orange);
}

.playlist-item-channel {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.playlist-item-status {
  font-size: 10px;
  color: var(--accent-orange);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Scrollbar styling for playlist */
.video-playlist-sidebar::-webkit-scrollbar {
  width: 6px;
}

.video-playlist-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.video-playlist-sidebar::-webkit-scrollbar-thumb {
  background: rgba(106, 36, 97, 0.15);
  border-radius: 3px;
}

.video-playlist-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(106, 36, 97, 0.3);
}

/* Video Container Standard */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Timeline Events Section below the video */
.timeline-events-section {
  padding: 80px 0;
  background-color: var(--bg-light);
}

/* Responsive video player */
@media (max-width: 992px) {
  .video-player-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }
  
  .video-playlist-sidebar {
    max-height: none;
  }
}

@media (max-width: 576px) {
  .playlist-item {
    grid-template-columns: 100px 1fr;
  }
  
  .playlist-thumb-wrap {
    height: 56px;
  }
  
  .video-main-title {
    font-size: 18px;
  }
}

