/* ============================================================
   IMMORTAL TALISMAN - MMORPG NEWS & MEDIA STYLESHEET
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0F0E0E;
  color: #F5F0EA;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 12px;
}

/* Browsers default <button> to the system-ui font; inherit the app font instead */
button {
  font-family: inherit;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: #0B0A0A;
}
::-webkit-scrollbar-thumb {
  background: #8F5D1E;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #E5A843;
}

/* Main App Container */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* Top Navigation Line with Modes */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(180deg, #1A1717 0%, #121010 100%);
  border-bottom: 1px solid rgba(143, 93, 30, 0.45);
  flex-shrink: 0;
  z-index: 20;
}

.nav-title {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #E5A843;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode-switch {
  display: flex;
  gap: 4px;
}

.mode-btn {
  font-family: 'Cinzel', 'Segoe UI', sans-serif;
  background: rgba(30, 26, 26, 0.8);
  border: 1px solid rgba(143, 93, 30, 0.4);
  color: #938D87;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.mode-btn:hover {
  color: #FFDF87;
  border-color: #E5A843;
  background: rgba(50, 42, 38, 0.9);
}

.mode-btn.active {
  color: #0F0E0E;
  background: linear-gradient(180deg, #FFDF87 0%, #E5A843 100%);
  border-color: #E5A843;
  box-shadow: 0 0 6px rgba(229, 168, 67, 0.45);
}

/* Content Viewport */
.view-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0F0E0E;
}

.view-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.view-pane.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* ========================================================
   SINGLE COMPONENT MODE (?type=video / ?type=news / ?type=gallery)
   Only shows 1 according to type. Navigation header is hidden.
   ======================================================== */
.mode-single .nav-header {
  display: none !important;
}

.mode-single .view-viewport {
  height: 100% !important;
  width: 100% !important;
}

.mode-single .view-pane {
  display: none;
}

.mode-single .view-pane.active {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  visibility: visible;
}

/* ========================================================
   SHOW ALL MODE (When type is null, not found, or type=all)
   Shows navigation header and all components together in vertical flow.
   ======================================================== */
.mode-all .nav-header {
  display: flex !important;
}

.mode-all .view-viewport {
  overflow-y: auto !important;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px;
}

.mode-all .view-pane {
  display: block !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
  flex-shrink: 0;
}

.mode-all #view-video {
  height: 220px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(143, 93, 30, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mode-all #view-news {
  min-height: 240px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(143, 93, 30, 0.45);
  background: rgba(18, 16, 16, 0.85);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mode-all #view-news .news-wrapper {
  height: auto;
}

.mode-all #view-news .news-list {
  max-height: 220px;
  overflow-y: auto;
}

.mode-all #view-gallery {
  height: 210px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(143, 93, 30, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mode-all #view-gallery .slider-container {
  height: 100%;
}

/* ========================================================
   1. VIDEO VIEW (type=video)
   ======================================================== */
.video-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Center Big Play Button (Single Clean Golden Circle) */
.video-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
  z-index: 15;
  padding: 0;
  outline: none;
}

.video-container.is-paused .video-big-play {
  opacity: 1;
  pointer-events: auto;
}

.video-big-play:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.video-big-play:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* Single Clean Circle Disc */
.video-big-play-disc {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(42, 34, 28, 0.88) 0%, rgba(16, 14, 13, 0.94) 100%);
  backdrop-filter: blur(8px);
  border: 1.5px solid #FFDF87;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 14px rgba(229, 168, 67, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFDF87;
  transition: all 0.2s ease;
}

.video-big-play:hover .video-big-play-disc {
  background: radial-gradient(circle at 35% 30%, rgba(65, 48, 32, 0.94) 0%, rgba(22, 18, 16, 0.98) 100%);
  color: #FFFFFF;
  border-color: #FFF2C6;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9), 0 0 22px rgba(255, 223, 135, 0.7);
}

.video-big-play-disc svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
  transform: translateX(1.5px); /* Optical centering for play triangle */
}

.video-big-play-disc .pause-icon {
  transform: translateX(0);
}

/* Bottom Controls Bar */
.video-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(180deg, rgba(12, 11, 11, 0) 0%, rgba(12, 11, 11, 0.85) 25%, rgba(10, 9, 9, 0.96) 100%);
  border-top: 1px solid rgba(229, 168, 67, 0.22);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  z-index: 20;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-container:hover .video-controls-bar,
.video-container.is-paused .video-controls-bar {
  opacity: 1;
  transform: translateY(0);
}

/* Control Buttons */
.vctl-btn {
  background: transparent;
  border: none;
  color: #FFDF87;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}

.vctl-btn:hover {
  background: rgba(229, 168, 67, 0.22);
  color: #FFFFFF;
}

.vctl-btn:active {
  transform: scale(0.92);
}

.vctl-svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Time display */
.video-time {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  color: #DDD4C8;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  padding: 0 2px;
}

/* Scrubber / Slider Track */
.video-scrubber-wrapper {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.video-scrubber-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  overflow: visible;
  transition: height 0.15s ease;
}

.video-scrubber-wrapper:hover .video-scrubber-track {
  height: 8px;
}

.video-scrubber-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  pointer-events: none;
}

.video-scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E62915, #FD5D02, #FFDF87);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(253, 93, 2, 0.6);
  pointer-events: none;
}

.video-scrubber-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFDF87;
  border: 2px solid #5C1D06;
  box-shadow: 0 0 8px rgba(255, 223, 135, 0.9);
  pointer-events: none;
  transition: transform 0.1s ease;
}

.video-scrubber-wrapper:hover .video-scrubber-handle {
  transform: translate(-50%, -50%) scale(1.25);
}

.video-overlay-banner {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  background: rgba(15, 14, 14, 0.78);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(229, 168, 67, 0.35);
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity 0.3s ease;
  animation: fadeInDown 0.8s ease forwards;
}

.video-title-anim {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(90deg, #FFDF87, #FD5D02, #FFDF87);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-badge {
  font-size: 8.5px;
  font-weight: 800;
  background: #E62915;
  color: #FFF;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   2. NEWS VIEW (type=news)
   Clean MMORPG Article Listing (No filter, No category)
   ======================================================== */
.news-wrapper {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 8px 10px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.news-card {
  display: block;
  background: linear-gradient(135deg, rgba(28, 24, 24, 0.92) 0%, rgba(18, 16, 16, 0.96) 100%);
  border: 1px solid rgba(143, 93, 30, 0.38);
  border-left: 3px solid rgba(229, 168, 67, 0.65);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0, 0, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  user-select: text;
  -webkit-user-select: text;
}

.news-card:hover {
  background: linear-gradient(135deg, rgba(42, 34, 32, 0.96) 0%, rgba(26, 22, 21, 0.98) 100%);
  border-color: rgba(229, 168, 67, 0.85);
  border-left: 3px solid #FFDF87;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55), 0 0 10px rgba(229, 168, 67, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.card-bullet {
  color: #E5A843;
  font-size: 8px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.news-card:hover .card-bullet {
  color: #FFDF87;
  transform: rotate(45deg);
}

.card-title {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #F5F0EA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.news-card:hover .card-title {
  color: #FFDF87;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-date {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #A39D97;
  letter-spacing: 0.3px;
}

.card-link-icon {
  font-size: 11px;
  font-weight: 700;
  color: #8F5D1E;
  transition: all 0.2s ease;
}

.news-card:hover .card-link-icon {
  color: #FFDF87;
  transform: translate(1px, -1px);
}

.card-desc {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #BFB8AF;
  line-height: 1.45;
  letter-spacing: 0.15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================================
   3. GALLERY VIEW (type=gallery)
   ======================================================== */
.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #0B0A0A;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  background-size: cover;
  background-position: center center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide-caption-box {
  background: linear-gradient(0deg, rgba(8, 7, 7, 0.88) 0%, rgba(8, 7, 7, 0.62) 55%, transparent 100%);
  margin: -12px -12px -12px -12px;
  padding: 16px 14px 10px 14px;
  pointer-events: none;
  z-index: 5;
}

.slide-tag {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  color: #FD5D02;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px #000, 0 1px 4px rgba(0, 0, 0, 0.95);
}

.slide-title {
  font-family: 'Cinzel', 'Segoe UI', serif;
  font-size: 13px;
  font-weight: 700;
  color: #FFDF87;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
  text-shadow: 0 1px 2px #000, 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.85);
}

.slide-desc {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #FFFFFF;
  line-height: 1.4;
  letter-spacing: 0.15px;
  text-shadow: 0 1px 2px #000, 0 2px 5px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.85);
}

/* Slider Controls */
.slider-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: rgba(15, 14, 14, 0.85);
  border: 1px solid rgba(229, 168, 67, 0.6);
  color: #FFDF87;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  z-index: 60;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
  outline: none;
}

.slider-arrow:hover {
  background: linear-gradient(180deg, #FFDF87 0%, #E5A843 100%);
  color: #0F0E0E;
  border-color: #FFDF87;
  box-shadow: 0 0 12px rgba(229, 168, 67, 0.75);
  transform: translateY(-50%) scale(1.1);
}

.slider-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.arrow-left { left: 10px; }
.arrow-right { right: 10px; }

.slider-dots {
  position: absolute;
  bottom: 10px;
  right: 14px;
  display: flex;
  gap: 5px;
  z-index: 60;
  pointer-events: auto;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.dot:hover {
  background: rgba(255, 223, 135, 0.7);
}

.dot.active {
  background: #FFDF87;
  width: 16px;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(255, 223, 135, 0.8);
}
