/* ==========================================================================
   DESIGN SYSTEM PREMIUM - ADMOB COMPLIANCE & APK MANAGER
   Theme: Galactic Dark, Glassmorphism, Electric Purple & Neon Cyan Accents
   ========================================================================== */

@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 {
  /* Color Palette */
  --bg-primary: hsl(222, 47%, 11%);
  --bg-secondary: hsl(224, 44%, 15%);
  --bg-glass: rgba(15, 22, 42, 0.6);
  --bg-glass-bright: rgba(255, 255, 255, 0.03);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 16%, 57%);
  
  --color-primary: hsl(263, 85%, 65%);
  --color-primary-glow: hsla(263, 85%, 65%, 0.4);
  --color-accent: hsl(180, 100%, 50%);
  --color-accent-glow: hsla(180, 100%, 50%, 0.3);
  
  --color-success: hsl(142, 70%, 50%);
  --color-warning: hsl(38, 92%, 50%);
  --color-danger: hsl(350, 89%, 60%);
  
  /* Fonts */
  --font-headings: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px 2px var(--color-primary-glow);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(263,80%,20%,0.15) 0, transparent 50%),
    radial-gradient(at 100% 100%, hsla(180,70%,15%,0.1) 0, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.main-content {
  padding-top: 100px;
  padding-bottom: 80px;
  min-height: calc(100vh - 180px);
}

/* --- Glassmorphic UI Components --- */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-glass), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, hsl(280, 85%, 55%) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6), var(--shadow-glow);
}

.btn-accent {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
}

.btn-accent:hover {
  background: var(--color-accent);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: var(--bg-glass-bright);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6), 0 0 15px rgba(16, 185, 129, 0.3);
}

/* --- Header / Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 22, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  height: 80px;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.6rem;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--color-accent);
  -webkit-text-fill-color: var(--color-accent);
}

.nav-menu {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-link {
  font-family: var(--font-headings);
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  width: 100%;
  background: var(--color-primary);
}

/* --- Landing Page App Grid --- */
.hero {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: var(--color-primary-glow);
  filter: blur(100px);
  top: -80px;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: -1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: left;
}

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

.app-icon-wrapper {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  overflow: hidden;
}

.app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.app-card-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
  margin-top: auto;
  gap: 12px;
}

.compliance-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compliance-tag.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.compliance-tag.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- Public Details / Page Templates --- */
.app-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.app-detail-icon {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass-bright);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.app-detail-info {
  flex: 1;
  min-width: 280px;
}

.app-detail-info h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.store-links {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.subpage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.subpage-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  text-align: left;
}

.subpage-card:hover {
  border-color: var(--color-accent);
  background: rgba(255,255,255,0.04);
  transform: translateY(-3px);
}

.subpage-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.subpage-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Legal / Content Pages --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--text-primary);
  transform: translateX(-4px);
}

.article-card {
  padding: 48px;
}

.article-title {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.article-content {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 24px;
}

.article-content h2 {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-content h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-content ul, .article-content ol {
  margin-left: 24px;
  margin-bottom: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

/* --- ADMIN PANEL LAYOUT --- */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 280px;
  background: rgba(10, 15, 30, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 101;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  margin-bottom: 48px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-headings);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.sidebar-link:hover {
  background: var(--bg-glass-bright);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--color-primary-glow) 0%, rgba(139,92,246,0.1) 100%);
  color: var(--text-primary);
  border-left: 3px solid var(--color-primary);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
}

/* Admin Main View */
.admin-main {
  flex-grow: 1;
  margin-left: 280px;
  padding: 40px;
  background: var(--bg-primary);
  min-height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 24px;
}

.admin-header-title h1 {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.admin-header-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Admin Login Page */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 450px;
  padding: 48px;
  text-align: center;
}

.login-card .logo {
  justify-content: center;
  margin-bottom: 32px;
}

/* --- Forms & Controls --- */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-label {
  display: block;
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: rgba(15, 22, 42, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(15, 22, 42, 0.7);
  box-shadow: 0 0 10px 1px rgba(139, 92, 246, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.code-editor {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.9rem;
  background: #090d16 !important;
  color: #a5f3fc;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
  border-top: 1px solid var(--border-glass);
  padding-top: 24px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 24px;
  text-align: left;
}

.stat-card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: var(--font-headings);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-card-value span {
  font-size: 1rem;
  color: var(--color-accent);
}

/* Admin Item Lists / Tables */
.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  transition: var(--transition-smooth);
}

.admin-card-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-item-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-item-actions {
  display: flex;
  gap: 12px;
}

/* --- Alerts and Messages --- */
.alert {
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  animation: slideIn 0.3s ease-out;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* --- Keyframe Animations --- */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Split Panel Layout for Editor & Preview --- */
.split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  height: calc(100vh - 220px);
}

.editor-pane {
  display: flex;
  flex-direction: column;
}

.preview-pane {
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 24px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}

/* Responsiveness */
@media (max-width: 992px) {
  .admin-sidebar {
    width: 80px;
    padding: 24px 10px;
    align-items: center;
  }
  
  .sidebar-logo span, .sidebar-link span {
    display: none;
  }
  
  .admin-main {
    margin-left: 80px;
    padding: 24px;
  }
  
  .split-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .preview-pane {
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 16px;
  }
  
  .nav-menu {
    display: none; /* simple burger menu can be added later if needed */
  }
  
  .hero h1 {
    font-size: 2.4rem;
  }
  
  .article-card {
    padding: 24px;
  }
  
  .article-title {
    font-size: 2rem;
  }
}
