:root {
  --bg: #0B0F19;
  --surface: #141C2E;
  --surface-hover: #1E293D;
  --border: rgba(255, 255, 255, 0.1);
  --border-cyan: rgba(0, 229, 255, 0.3);
  --accent: #00E5FF;
  --accent-purple: #7C4DFF;
  --accent-green: #00E676;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Glow Effects */
.glow-bg-1 {
  position: fixed;
  top: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.12) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}
.glow-bg-2 {
  position: fixed;
  bottom: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.12) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.nav-logo {
  font-size: 2rem;
  line-height: 1;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* Search Bar */
.nav-search {
  position: relative;
  width: 380px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.nav-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--accent);
  color: #0A0F1D;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: 16px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0288D1);
  color: #0A0F1D;
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-apk {
  background: linear-gradient(135deg, var(--accent-green), #00B0FF);
  color: #0A0F1D;
  font-weight: 800;
}

.btn-apk:hover {
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

/* Unauthenticated Screen */
.unauth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 2rem;
}

.unauth-card {
  background: var(--surface);
  border: 1px solid var(--border-cyan);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 229, 255, 0.15);
}

.unauth-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.unauth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
  color: var(--accent);
}

.unauth-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* User Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-admin {
  background: rgba(124, 77, 255, 0.2);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-section {
  margin-bottom: 2rem;
  text-align: center;
}

.hero-content h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #FFFFFF, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
}

.platform-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover, .filter-chip.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 229, 255, 0.15);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}

.app-icon {
  font-size: 2.8rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.app-meta h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tag-badge {
  display: inline-block;
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.app-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex: 1;
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.82rem;
}

/* Modal Backdrop & Drawer */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.modal-drawer {
  background: #0F1626;
  width: 720px;
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2.5rem;
  border-left: 1px solid var(--border);
  position: relative;
  box-shadow: -20px 0 50px rgba(0,0,0,0.5);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.close-drawer-btn {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* Modal Card Center */
.modal-card {
  margin: auto;
  background: #0F1626;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 480px;
  max-width: 90%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-sm { width: 360px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 1rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.5rem;
}

/* Drawer Detail Elements */
.drawer-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.drawer-hero-icon {
  font-size: 4rem;
  background: rgba(255,255,255,0.05);
  padding: 14px;
  border-radius: 24px;
  border: 1px solid var(--border-cyan);
}

.drawer-hero-title h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.drawer-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.drawer-section {
  margin-bottom: 2rem;
}

.drawer-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.drawer-section h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--accent);
}

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

.feature-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-item-icon {
  font-size: 1.5rem;
  margin-top: 2px;
}

.feature-item-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.feature-item-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.step-number {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.error-text {
  color: #ff5252;
  font-size: 0.85rem;
  margin-top: 8px;
}

.success-text {
  color: var(--accent-green);
  font-size: 0.85rem;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .navbar { padding: 1rem; flex-wrap: wrap; gap: 12px; }
  .nav-search { order: 3; width: 100%; }
  .modal-drawer { width: 100%; padding: 1.5rem; }
}
