/* Custom CSS Design System - Slate & Indigo Neon Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* HSL Tailored Colors */
  --bg-color: #080d1a;
  --panel-bg: rgba(20, 29, 51, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --accent-cyan: #06b6d4; /* Cyan */
  --accent-cyan-glow: rgba(6, 182, 212, 0.2);
  
  --accent-green: #10b981; /* Emerald */
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  
  --accent-orange: #f97316; /* Amber-Orange */
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  padding-bottom: 5rem;
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 13, 26, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Intro */
header {
  padding: 3.5rem 0 2rem;
  text-align: center;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent-cyan), transparent);
}

.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 70%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-weight: 300;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0 3.5rem;
}

.stat-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: left;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.5;
}

.stat-card.stat-qx::before { background: var(--primary); }
.stat-card.stat-rt::before { background: var(--accent-cyan); }
.stat-card.stat-auto::before { background: var(--accent-green); }
.stat-card.stat-core::before { background: var(--accent-orange); }

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--panel-border-hover);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px 0 var(--primary-glow);
}

.stat-card.stat-qx:hover { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3), 0 0 15px 0 var(--primary-glow); }
.stat-card.stat-rt:hover { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3), 0 0 15px 0 var(--accent-cyan-glow); }
.stat-card.stat-auto:hover { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3), 0 0 15px 0 var(--accent-green-glow); }

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Quick Downloads/Pinned section */
.pinned-section {
  background: radial-gradient(100% 100% at 0% 0%, rgba(99, 102, 241, 0.07) 0%, transparent 100%), var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  margin-bottom: 3rem;
}

.pinned-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pinned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.pinned-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-normal);
}

.pinned-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(15, 23, 42, 0.8);
  transform: translateY(-2px);
}

.pinned-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pinned-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.pinned-icon.apk { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.pinned-icon.sh { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.pinned-icon.zip { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.pinned-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.pinned-size {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.pinned-actions {
  display: flex;
  gap: 0.5rem;
}

/* Search and Filters panel */
.controls-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2);
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(8, 13, 26, 0.6);
  border: 1px solid var(--panel-border);
  padding: 0.9rem 1.25rem 0.9rem 3rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: #fff;
  border-radius: 8px;
  transition: var(--transition-normal);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(8, 13, 26, 0.9);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Category Filter Pills */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.25rem;
}

.filter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.filter-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.filter-count {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.filter-tab.active .filter-count {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

/* File Listings Layout */
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.catalog-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.catalog-info span {
  font-weight: 600;
  color: #fff;
}

/* File Cards Grid */
.files-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.file-row {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  transition: var(--transition-normal);
}

.file-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(20, 29, 51, 0.85);
  transform: translateX(3px);
}

.file-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.file-row:hover .file-type-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.2);
}

.file-meta {
  min-width: 0;
}

.file-name-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.file-name {
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
  word-break: break-all;
  transition: var(--transition-fast);
}

.file-name:hover {
  color: #a5b4fc;
}

.folder-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-qx { background: rgba(99, 102, 241, 0.12); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-rt { background: rgba(6, 182, 212, 0.12); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-auto { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-root { background: rgba(249, 115, 22, 0.12); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.2); }

.file-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.file-size-badge {
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--primary);
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-secondary {
  color: var(--text-secondary);
}

.btn-secondary:hover {
  color: #fff;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: 6px;
}

/* Highlighted Search Match */
mark {
  background: rgba(234, 179, 8, 0.2);
  color: #fef08a;
  padding: 0 0.1rem;
  border-radius: 2px;
}

/* Empty State styling */
.empty-state {
  background: var(--panel-bg);
  border: 1px dashed var(--panel-border);
  padding: 4rem 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

/* Notification Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  border: 1px solid var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 10px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--accent-green);
}

/* Deployment Steps Info */
.info-section {
  margin-top: 4rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.info-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-content {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-content ol {
  margin-left: 1.25rem;
  margin-top: 0.75rem;
}

.info-content li {
  margin-bottom: 0.5rem;
}

.code-snippet {
  background: rgba(8, 13, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: monospace;
  color: #34d399;
  display: block;
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* Footer Styling */
footer {
  text-align: center;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }
  
  header {
    padding: 2.5rem 0 1.5rem;
  }
  
  .file-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.25rem;
  }
  
  .file-type-icon {
    display: none;
  }
  
  .action-buttons {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .action-buttons .btn {
    flex: 1;
    justify-content: center;
  }
}
