/* ============================================================
   THE PIXEL EMPIRE FILES — style.css
   Dark Glass Aesthetic | Cinzel + Rajdhani
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-void:       #04060a;
  --bg-dark:       #070c14;
  --bg-surface:    rgba(255, 255, 255, 0.035);
  --bg-surface-h:  rgba(255, 255, 255, 0.065);

  --glass-border:  rgba(201, 168, 76, 0.18);
  --glass-glow:    rgba(201, 168, 76, 0.06);

  --gold:          #c9a84c;
  --gold-light:    #e8c878;
  --gold-dim:      rgba(201, 168, 76, 0.4);
  --green:         #2cd627;
  --green-dim:     rgba(44, 214, 39, 0.15);
  --red:           #e84545;
  --text-primary:  #e8dfc8;
  --text-muted:    #8a7f6e;
  --text-dim:      #4a4438;

  --font-display:  'Cinzel', Georgia, serif;
  --font-body:     'Rajdhani', 'Trebuchet MS', sans-serif;

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     18px;

  --shadow-gold:   0 0 20px rgba(201, 168, 76, 0.12), 0 0 60px rgba(201, 168, 76, 0.04);
  --shadow-glass:  0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --header-h:      72px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Background Canvas ---------- */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(44, 214, 39, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(10, 20, 40, 0.8) 0%, transparent 100%);
  pointer-events: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 40px rgba(0,0,0,0.6), 0 0 80px rgba(201,168,76,0.04);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.logo:hover { opacity: 0.85; }

.logo-skull {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--gold));
  animation: pulse-skull 4s ease-in-out infinite;
}
@keyframes pulse-skull {
  0%, 100% { filter: drop-shadow(0 0 6px var(--gold)); }
  50%       { filter: drop-shadow(0 0 16px var(--gold-light)); }
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.logo-sub {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Search */
.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 520px;
  position: relative;
  margin-left: auto;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 1.25rem;
  color: var(--gold-dim);
  pointer-events: none;
  z-index: 1;
  line-height: 1;
  top: 50%;
  transform: translateY(-50%);
}

.search-input {
  flex: 1;
  height: 42px;
  padding: 0 14px 0 42px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  letter-spacing: 0.03em;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.search-btn {
  height: 42px;
  padding: 0 18px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #0a0800;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.search-btn:hover {
  background: var(--gold-light);
  box-shadow: 0 0 20px rgba(201,168,76,0.3);
}
.search-btn:active { transform: translateY(1px); }

/* ---------- MAIN ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Status bar */
.status-bar {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#statusText {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- GLASS TABLE ---------- */
.table-section { position: relative; }

.glass-table-wrap {
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glass), var(--shadow-gold);
  position: relative;
}
.glass-table-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.04) 0%, transparent 50%, rgba(44,214,39,0.02) 100%);
  pointer-events: none;
  border-radius: inherit;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.file-table thead {
  background: rgba(201,168,76,0.07);
  border-bottom: 1px solid var(--glass-border);
}

.file-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 14px 20px;
  text-align: left;
}

.col-name { width: 80%; }
.col-size { width: 20%; text-align: right; }

/* Rows */
.file-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
  animation: rowIn 0.35s ease both;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-surface-h); }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-row td {
  padding: 14px 20px;
  vertical-align: middle;
}

.td-size {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* File name cell */
.file-name-cell { display: flex; flex-direction: column; gap: 8px; }

.file-name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.4;
}

.file-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-transform: uppercase;
}

.btn-download {
  background: var(--green-dim);
  border-color: rgba(44, 214, 39, 0.3);
  color: var(--green);
}
.btn-download:hover {
  background: rgba(44, 214, 39, 0.25);
  border-color: var(--green);
  box-shadow: 0 0 14px rgba(44, 214, 39, 0.2);
  transform: translateY(-1px);
}

.btn-watch {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.btn-watch:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201, 168, 76, 0.15);
  transform: translateY(-1px);
}

.btn-icon { font-size: 0.9rem; line-height: 1; }

/* ---------- EMPTY / ERROR STATES ---------- */
.empty-state,
.error-state {
  text-align: center;
  padding: 80px 24px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.empty-icon,
.error-icon { font-size: 3rem; margin-bottom: 16px; line-height: 1; }

.error-icon { color: var(--red); }

.empty-title,
.error-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.empty-sub,
.error-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.retry-btn {
  padding: 10px 28px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}
.retry-btn:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
}

/* ---------- LOADER ---------- */
.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201,168,76,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sentinel */
#sentinel { height: 20px; }

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(4,6,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-skull {
  font-size: 2.2rem;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.5));
  flex-shrink: 0;
}

.footer-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.footer-tagline {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* Telegram Button */
.footer-links { display: flex; align-items: center; }

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(0, 136, 204, 0.12);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: var(--radius-md);
  color: #5eb8e5;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}
.telegram-btn:hover {
  background: rgba(0, 136, 204, 0.22);
  border-color: rgba(0, 136, 204, 0.6);
  box-shadow: 0 0 24px rgba(0, 136, 204, 0.2), 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-2px);
  color: #7ecff5;
}
.telegram-btn:active { transform: translateY(0); }

.tg-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-bottom p {
  font-size: 0.76rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.footer-disclaimer {
  font-style: italic;
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 340px;
  padding: 14px 18px;
  background: rgba(15,20,30,0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-glass);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  border-left: 3px solid var(--gold);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(0.9); }
}

/* ---------- HIDDEN utility ---------- */
[hidden] { display: none !important; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
  :root { --header-h: 60px; }

  .header-inner { padding: 0 16px; gap: 12px; }

  .logo-title { font-size: 0.85rem; }
  .logo-sub   { display: none; }
  .logo-skull { font-size: 1.6rem; }

  .search-btn span { display: none; }
  .search-btn { padding: 0 14px; font-size: 0; }
  .search-btn::after { content: '→'; font-size: 1rem; color: #0a0800; }

  main { padding: 20px 16px 48px; }

  .file-table th,
  .file-row td { padding: 12px 14px; }

  .col-size { display: none; }
  .col-name { width: 100%; }

  .file-actions { flex-direction: column; }
  .btn { font-size: 0.75rem; }

  .footer-inner { padding: 28px 16px 20px; }

  .glass-table-wrap { border-radius: var(--radius-md); }
}

@media (max-width: 420px) {
  .logo-text { display: none; }
  .logo-skull { font-size: 1.8rem; }
}