/* /assets/fancyindex.css */
:root{
  --bg: #111214;
  --panel: #15171a;
  --rowA: #171a1e;
  --rowB: #14171a;
  --rowHover: #1b1f24;
  --border: #242a31;
  --text: #e7e9ee;
  --muted: #a7adb8;
  --accent: #e24a4a;
  --accent2: #ff6a6a;
  --radius: 10px;
}
html, body{
  background: radial-gradient(1200px 700px at 15% 0%, #17191d 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.25;
  margin: 0;
}
body{
  padding: 18px;
}
h1{
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ============================================================
   DESKTOP TABLE STYLES
   ============================================================ */
table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: block;
}
table tbody, table thead{
  display: table;
  width: 100%;
}

th{
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border-bottom: 1px solid var(--border);
}
tr:nth-child(even) td{ background: var(--rowA); }
tr:nth-child(odd)  td{ background: var(--rowB); }

/* General Cell Styles */
td{
  padding: 6px 10px;
  border-bottom: 1px solid rgba(36,42,49,0.75);
  vertical-align: middle;
  position: relative;
}
tr:last-child td{ border-bottom: 0; }
tr:hover td{ background: var(--rowHover); }

/* --- DESKTOP COLUMN CONTROLS (TIGHTER) --- */

/* 1. Name Column (Absorbs all leftover space) */
th:nth-child(1), td:nth-child(1){
  width: 100% !important;
  max-width: none !important;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 15px;
}

/* 2. Size Column (Half of previous: 35px -> 18px) */
th:nth-child(2), td:nth-child(2){
  width: auto;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-left: 0;
  padding-right: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Date Column (Half of previous: 65px -> 33px) */
th:nth-child(3), td:nth-child(3){
  width: auto;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-left: 3px;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Links */
a{
  color: var(--text);
  text-decoration: none;
}
a:hover{
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
td a{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Parent directory */
a[href="../"]{
  color: var(--accent);
  font-weight: 600;
}
/* Visited states */
a:visited{ color: var(--accent) !important; }
a:visited:hover{ color: var(--accent2) !important; }
a:active{ color: var(--accent2); }

/* Icons */
img{
  opacity: 0.9;
  filter: saturate(0.9) brightness(0.95) contrast(1.05);
}

/* ============================================================
   MOBILE CARD VIEW (UNCHANGED)
   ============================================================ */
@media (max-width: 700px){
  body{ padding: 10px; }
  h1 { margin-left: 4px; font-size: 16px; }

  table, thead, tbody, th, td, tr { 
    display: block; 
    border: none;
    background: transparent;
    box-shadow: none;
  }
  thead tr { position: absolute; top: -9999px; left: -9999px; }

  tbody tr {
    background: var(--panel) !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  td:nth-child(1) {
    width: 100% !important;
    max-width: none !important;
    padding: 0 0 12px 0;
    border: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
  }

  td:nth-child(2) {
    width: auto;
    padding: 0;
    border: none;
    font-size: 11px;
    background: transparent !important;
    color: var(--muted);
    opacity: 0.7;
    margin-right: 12px;
    text-align: left;
  }
  td:nth-child(2)::after { content: " size"; opacity: 0.5; }

  td:nth-child(3) {
    width: auto;
    padding: 0;
    border: none;
    font-size: 11px;
    background: transparent !important;
    color: var(--muted);
    opacity: 0.7;
    margin-left: auto;
    text-align: right;
  }

  img { width: 20px; height: 20px; vertical-align: text-bottom; margin-right: 5px; }
  .file-badge { display: none; }

  .file-dl-btn {
    margin-top: 10px; 
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    margin-left: 0 !important;
  }

  .hls-play-btn {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 12px;
    justify-content: center;
    box-sizing: border-box;
    min-height: 52px; 
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* ============================================================
   Player / Extension Styles
   ============================================================ */
.player-page{ padding: 18px; }
.player-wrap{ max-width: 1100px; margin: 0 auto; }
.site-header{
  display: flex; align-items: center; max-width: 1100px; margin: 0 auto 12px auto;
  padding: 0 12px; border: none; background: transparent; box-shadow: none;
}
.site-header a{ text-decoration: none; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.site-header a:hover{ color: var(--accent2); }

.player-header{
  margin: 0 0 12px 0; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.player-row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player-badge{
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; background: rgba(226,74,74,0.10);
  border: 1px solid rgba(226,74,74,0.28); font-weight: 600; letter-spacing: 0.2px;
}
.player-label{ color: var(--muted); font-weight: 600; }
.player-link{ word-break: break-all; }
.player-panel{
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.player-video{ width: 100%; height: auto; display: block; background: #000; }
.player-note{ padding: 10px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.player-msg{ margin-top: 12px; }
.player-err{
  padding: 10px 12px; border: 1px solid rgba(226,74,74,0.28);
  border-radius: var(--radius); background: rgba(226,74,74,0.08); color: var(--text);
}
.player-warn{
  margin-top: 1rem; padding: 1rem; border: 1px solid #ffeeba;
  background-color: #fff3cd; color: #856404; border-radius: 4px;
  font-size: 0.9rem; display: none;
}
.player-warn strong{ font-weight: 700; }
.player-video-wrap{ position: relative; }
.player-sound-btn{
  position: absolute; top: 12px; right: 12px; z-index: 10;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(226,74,74,0.35);
  background: linear-gradient(180deg, rgba(226,74,74,0.18), rgba(226,74,74,0.10));
  color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: 0.2px;
  cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
}
.player-sound-btn:hover{
  background: linear-gradient(180deg, rgba(255,106,106,0.25), rgba(226,74,74,0.15));
  border-color: rgba(255,106,106,0.55); color: var(--accent2);
}
.player-sound-btn:active{ transform: translateY(1px); }
.player-sound-btn:disabled, .player-sound-btn.enabled{
  opacity: 0.7; cursor: default; border-color: rgba(226,74,74,0.25);
  background: rgba(226,74,74,0.12);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.file-badge{
  display: inline-flex; align-items: center; margin-right: 6px; padding: 2px 6px;
  border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
td a[href$=".mp4"]{ opacity: 0.82; }

/* Stream Play Button */
.hls-play-btn{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; 
  margin-left: 10px; border-radius: 999px;
  border: 1px solid rgba(226,74,74,0.6);
  background: linear-gradient(180deg, rgba(226,74,74,0.38), rgba(226,74,74,0.18));
  color: #fff !important; font-size: 12px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase; text-decoration: none !important; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(226,74,74,0.25), 0 6px 16px rgba(0,0,0,0.45);
  touch-action: manipulation;
}
.hls-play-btn::before{
  content: ''; display: inline-block; width: 0; height: 0;
  border-left: 7px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.hls-play-btn:hover{
  background: linear-gradient(180deg, rgba(255,106,106,0.5), rgba(226,74,74,0.3));
  border-color: rgba(255,106,106,0.9); color: var(--accent2) !important;
  box-shadow: 0 0 0 1px rgba(255,106,106,0.55), 0 10px 22px rgba(0,0,0,0.6);
}
.hls-play-btn:active{ transform: translateY(1px); }

/* Download Button */
.file-dl-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-left: 8px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(36,42,49,0.95); outline: 1px solid rgba(255,255,255,0.08); outline-offset: 0;
  background: rgba(255,255,255,0.06); color: var(--text) !important;
  font-size: 12px; font-weight: 800; letter-spacing: 0.35px;
  text-transform: uppercase; text-decoration: none !important; white-space: nowrap; line-height: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.file-dl-btn::before{
  content: ''; display: inline-block; width: 14px; height: 14px; flex: 0 0 14px; transform: translateY(0.5px);
  background:
    linear-gradient(currentColor, currentColor) 6px 1px / 2px 8px no-repeat,
    linear-gradient(45deg, transparent 50%, currentColor 52% 100%) 1px 7px / 6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, currentColor 52% 100%) 7px 7px / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 1px 12px / 12px 2px no-repeat;
}
.file-dl-btn:hover{
  background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.14);
  color: var(--accent2) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
}
.file-dl-btn:active{ transform: translateY(1px); }

/* Shared Mobile Overrides */
@media (max-width: 700px){
  .player-page{ padding: 12px; }
  .site-header{ padding: 0.6rem 0.8rem; margin-bottom: 10px; }
  .player-sound-btn{ top: 8px; right: 8px; padding: 7px 12px; font-size: 12px; }
}