/* Poukwapa Devspot - Admin Panel Stylesheet */

/* ==========================================
   CSS Custom Properties (Design System)
   ========================================== */
:root {
  /* Brand — Navy (Primary) */
  --primary-50:  #eef2f7;
  --primary-100: #d7e0eb;
  --primary-200: #b7c6d9;
  --primary-300: #8aa4c0;
  --primary-400: #5b7aa0;
  --primary-500: #1f3a5f;   /* main navy */
  --primary-600: #192f4c;
  --primary-700: #14263d;
  --primary-800: #0e1c2d;
  --primary-900: #0a1420;

  /* Brand — Gold (Accent) */
  --accent-50:  #fff7e8;
  --accent-100: #ffe7bf;
  --accent-200: #ffd18a;
  --accent-300: #ffbc55;
  --accent-400: #f8a92d;
  --accent-500: #f0a51b;  /* main gold */
  --accent-600: #d68f12;
  --accent-700: #b8770c;
  --accent-800: #8f5a08;
  --accent-900: #704606;

  /* Neutral slate */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Status */
  --success-50:  #ecfdf5;
  --success-100: #d1fae5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;

  --error-50:  #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;

  --warning-50:  #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-700: #b45309;

  /* Platform */
  --telegram-500: #0088cc;
  --telegram-600: #006699;

  /* Semantic */
  --background: #f7f8fb;
  --surface: #ffffff;
  --text-primary: #0a1420;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Extras */
  --brand: var(--primary-500);
  --brand-ink: #ffffff;
  --brand-accent: var(--accent-500);
  --ring: color-mix(in oklab, var(--primary-500) 45%, transparent);
  --shadow-color: 15 23 42;
  
  /* Spacing */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 0.75rem;    /* 12px */
  --space-lg: 1rem;       /* 16px */
  --space-xl: 1.5rem;     /* 24px */
  --space-2xl: 2rem;      /* 32px */
  --space-3xl: 2.5rem;    /* 40px */
  --space-4xl: 3rem;      /* 48px */
  --space-5xl: 4rem;      /* 64px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(var(--shadow-color) / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(var(--shadow-color) / 0.1), 0 2px 4px -2px rgb(var(--shadow-color) / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(var(--shadow-color) / 0.1), 0 4px 6px -4px rgb(var(--shadow-color) / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(var(--shadow-color) / 0.1), 0 8px 10px -6px rgb(var(--shadow-color) / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(var(--shadow-color) / 0.25);
  
  /* Typography */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-popover: 1100;
  --z-tooltip: 1200;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

/* ==========================================
   Utility Classes
   ========================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================
   Header Styles
   ========================================== */
header {
background:
    linear-gradient(135deg, rgba(0,0,0,.35), rgba(0,0,0,.35)),
    var(--hero-bg, url("header-bg.png")) center / cover no-repeat;  color: white;
  padding: var(--space-2xl) 0;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 6px -1px rgb(var(--shadow-color) / 0.1);
}




header h1 {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
  letter-spacing: -0.02em;
}

header .subtitle {
  font-size: var(--font-size-lg);
  opacity: 0.95;
  margin-bottom: var(--space-xl);
  font-weight: var(--font-weight-normal);
  letter-spacing: 0.01em;
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
  z-index: var(--z-sticky);
}

.lang-btn {
  background: rgb(255 255 255 / 0.15);
  border: 1px solid rgb(255 255 255 / 0.3);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn:hover {
  background: rgb(255 255 255 / 0.25);
  transform: translateY(-1px);
  border-color: rgb(255 255 255 / 0.4);
}

.lang-btn.active {
  background: rgb(255 255 255 / 1);
  color: var(--primary-500);
  border-color: rgb(255 255 255 / 1);
  font-weight: var(--font-weight-semibold);
}

.lang-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Admin Controls */
.admin-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.admin-status {
  background: rgb(255 255 255 / 0.15);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  border: 1px solid rgb(255 255 255 / 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: var(--font-weight-medium);
}

.auth-btn {
  background: rgb(255 255 255 / 0.15);
  border: 1px solid rgb(255 255 255 / 0.3);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-btn:hover {
  background: rgb(255 255 255 / 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgb(0 0 0 / 0.1);
}

.auth-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ==========================================
   Modal Styles
   ========================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  background-color: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: var(--space-lg);
}

.modal-content {
  background-color: var(--surface);
  margin: 2rem auto;
  padding: var(--space-3xl);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: modalSlideIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

#editAppModal .modal-content {
  max-width: 700px;
  margin: 1rem auto;
  max-height: calc(100vh - 2rem);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close {
  position: absolute;
  right: var(--space-xl);
  top: var(--space-xl);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.close:hover {
  color: var(--error-500);
  background: var(--error-50);
}

.close:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.modal h2 {
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
  text-align: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-2xl);
}

/* ==========================================
   Form Styles
   ========================================== */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  background-color: var(--surface);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--ring);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-group select {
  cursor: pointer;
}

/* Bilingual Input */
.bilingual-input {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .bilingual-input {
    grid-template-columns: 1fr 1fr;
  }
}

.lang-input-group label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================
   Button Styles
   ========================================== */
button[type="submit"],
.admin-btn {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  width: 100%;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

button[type="submit"]:hover:not(:disabled),
.admin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

button[type="submit"]:active:not(:disabled),
.admin-btn:active:not(:disabled) {
  transform: translateY(0);
}

button[type="submit"]:disabled,
.admin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

button[type="button"],
.back-btn {
  background: var(--gray-500);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-fast);
  cursor: pointer;
}

button[type="button"]:hover:not(:disabled),
.back-btn:hover:not(:disabled) {
  background: var(--gray-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.upload-btn {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.upload-btn:hover:not(:disabled) {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.edit-btn,
.delete-btn {
  background: rgb(255 255 255 / 0.15);
  border: 1px solid rgb(255 255 255 / 0.3);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.edit-btn:hover {
  background: rgb(255 255 255 / 0.25);
  transform: translateY(-1px);
}

.delete-btn:hover {
  background: var(--error-500);
  border-color: var(--error-500);
  transform: translateY(-1px);
}

/* ==========================================
   Admin Section
   ========================================== */
.admin-section {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin: var(--space-2xl) 0;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* Hide sections by default - controlled by JavaScript */
#adminSection,
#manageAppsSection,
#appDetailSection,
#loginRequiredSection {
  display: none;
}

#manageAppsSection {
  margin-top: var(--space-3xl);
}

.admin-header {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  padding: var(--space-3xl) var(--space-2xl);
  border-radius: var(--radius-xl);
  text-align: center;
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-md);
}

.admin-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  color: white;
  letter-spacing: -0.02em;
}

.admin-header p {
  opacity: 0.95;
  font-size: var(--font-size-lg);
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================
   App Cards & Grid
   ========================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-2xl);
  margin: var(--space-2xl) 0;
}

.app-card-preview {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-card-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-200);
}

.app-preview-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
  flex-shrink: 0;
}

.preview-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.app-card-preview:hover .preview-main-image {
  transform: scale(1.05);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
}

.preview-placeholder span {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.7;
}

.preview-placeholder p {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  opacity: 0.8;
}

.app-category-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--primary-500);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-preview-content {
  padding: var(--space-xl);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.app-preview-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
}

.app-preview-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.app-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.comment-count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.view-app-btn {
  color: var(--primary-500);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.view-app-btn:hover {
  color: var(--primary-600);
}

/* Admin Controls Overlay */
.admin-controls-overlay {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

.app-card-preview:hover .admin-controls-overlay {
  opacity: 1;
}

.admin-control-btn {
  background: rgb(255 255 255 / 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.admin-control-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.admin-control-btn:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.admin-control-btn--edit:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

.admin-control-btn--delete:hover {
  background: var(--error-500);
  color: white;
  border-color: var(--error-500);
}

/* ==========================================
   App Detail Styles
   ========================================== */
.app-detail-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

.app-detail-header {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  padding: var(--space-3xl) var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.app-detail-info {
  flex: 1;
  min-width: 300px;
}

.app-detail-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

.app-detail-category {
  background: rgb(255 255 255 / 0.2);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  display: inline-block;
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-detail-short-desc {
  font-size: var(--font-size-lg);
  opacity: 0.95;
  line-height: var(--line-height-relaxed);
}

.app-detail-admin-controls {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.app-detail-description,
.app-detail-gallery,
.app-detail-download,
.app-detail-comments {
  padding: var(--space-3xl) var(--space-2xl);
  border-bottom: 1px solid var(--border-light);
}

.app-detail-comments {
  border-bottom: none;
}

.app-detail-description h3,
.app-detail-gallery h3,
.app-detail-download h3,
.app-detail-comments h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ==========================================
   Rich Text Content
   ========================================== */
.rich-text-content {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  font-size: var(--font-size-base);
}

.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.rich-text-content h1:first-child,
.rich-text-content h2:first-child,
.rich-text-content h3:first-child {
  margin-top: 0;
}

.rich-text-content h1 { font-size: var(--font-size-2xl); }
.rich-text-content h2 { font-size: var(--font-size-xl); }
.rich-text-content h3 { font-size: var(--font-size-lg); }

.rich-text-content p {
  margin-bottom: var(--space-lg);
}

.rich-text-content p:last-child {
  margin-bottom: 0;
}

.rich-text-content ul,
.rich-text-content ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-2xl);
  list-style-position: outside;
}

.rich-text-content ul {
  list-style-type: disc;
}

.rich-text-content ol {
  list-style-type: decimal;
}

.rich-text-content li {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
}

.rich-text-content blockquote {
  border-left: 4px solid var(--primary-500);
  padding-left: var(--space-xl);
  margin: var(--space-xl) 0;
  font-style: italic;
  background: var(--gray-50);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.rich-text-content strong {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.rich-text-content em {
  font-style: italic;
}

.rich-text-content code {
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  color: var(--primary-600);
}

.rich-text-content pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

.rich-text-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.rich-text-content a {
  color: var(--primary-500);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.rich-text-content a:hover {
  color: var(--primary-600);
}

/* ==========================================
   Rich Text Editor (Quill)
   ========================================== */
.rich-text-editor-container {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  transition: border-color var(--transition-fast);
}

.rich-text-editor-container:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--ring);
}

.rich-text-editor-short .ql-container {
  height: 120px;
}

.rich-text-editor-full .ql-container {
  height: 200px;
}

.ql-toolbar {
  background: var(--gray-50);
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
}

.ql-container {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  border: none !important;
}

.ql-editor {
  padding: var(--space-lg);
}

.ql-editor.ql-blank::before {
  font-style: italic;
  color: var(--text-muted);
  left: var(--space-lg);
}

.ql-tooltip {
  z-index: var(--z-tooltip);
}

/* Quill toolbar button styles */
.ql-toolbar button {
  transition: all var(--transition-fast);
}

.ql-toolbar button:hover {
  color: var(--primary-500);
}

.ql-toolbar button.ql-active {
  color: var(--primary-500);
}

/* ==========================================
   Screenshot Gallery & Upload
   ========================================== */
.detail-screenshot-gallery,
.screenshot-gallery,
.screenshot-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.detail-screenshot-item,
.screenshot-item,
.screenshot-preview-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  aspect-ratio: 16 / 9;
  background: var(--gray-100);
  border: 1px solid var(--border);
}

.detail-screenshot-item:hover,
.screenshot-item:hover,
.screenshot-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.detail-screenshot-item img,
.screenshot-item img,
.screenshot-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform var(--transition-normal);
}

.detail-screenshot-item:hover img,
.screenshot-item:hover img {
  transform: scale(1.05);
}

.screenshot-delete {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--error-500);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.screenshot-delete:hover {
  background: var(--error-600);
  transform: scale(1.1);
}

.detail-screenshot-item:hover .screenshot-delete,
.screenshot-item:hover .screenshot-delete,
.screenshot-preview-item:hover .screenshot-delete {
  opacity: 1;
}

/* Upload Section */
.upload-section,
.screenshot-upload-section {
  background: var(--gray-50);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  margin-top: var(--space-xl);
  transition: all var(--transition-fast);
}

.upload-section:hover,
.screenshot-upload-section:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}

.upload-section h4,
.screenshot-upload-section h4 {
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
}

.file-input-wrapper {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
}

.file-input-wrapper input[type="file"] {
  flex: 1;
  min-width: 200px;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.file-input-wrapper input[type="file"]:hover {
  border-color: var(--primary-300);
}

.file-input-wrapper input[type="file"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--ring);
}

/* ==========================================
   Comments & Feedback
   ========================================== */
.feedback-form {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.feedback-form input {
  flex: 1;
  min-width: 250px;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.feedback-form input:hover {
  border-color: var(--gray-300);
}

.feedback-form input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--ring);
}

.feedback-form input::placeholder {
  color: var(--text-muted);
}

.feedback-form button {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

.feedback-form button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.feedback-form button:active {
  transform: translateY(0);
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.feedback-item {
  background: var(--gray-50);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  position: relative;
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.feedback-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-300);
}

.feedback-author {
  font-weight: var(--font-weight-semibold);
  color: var(--primary-500);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.feedback-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

.feedback-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.feedback-delete {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--error-500);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0;
  box-shadow: var(--shadow-sm);
}

.feedback-item:hover .feedback-delete {
  opacity: 1;
}

.feedback-delete:hover {
  background: var(--error-600);
  transform: scale(1.1);
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-3xl);
  font-size: var(--font-size-base);
}

/* ==========================================
   Telegram Button
   ========================================== */
.telegram-community-btn-large {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  background: linear-gradient(135deg, var(--telegram-500) 0%, var(--telegram-600) 100%);
  color: white;
  text-decoration: none;
  padding: var(--space-lg) var(--space-3xl);
  border-radius: var(--radius-xl);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  transition: all var(--transition-normal);
  margin-top: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.telegram-community-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.telegram-community-btn-large:active {
  transform: translateY(0);
}

.telegram-community-btn-large::before {
  content: "📱";
  font-size: var(--font-size-2xl);
}

/* ==========================================
   Image Modal
   ========================================== */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  background-color: rgb(0 0 0 / 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  animation: modalSlideIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.image-modal-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
}

.image-modal-close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  color: white;
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  background: rgb(0 0 0 / 0.5);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-modal-close:hover {
  background: rgb(0 0 0 / 0.7);
  transform: scale(1.1);
}

/* ==========================================
   State Styles
   ========================================== */
.no-apps {
  text-align: center;
  padding: var(--space-5xl) var(--space-2xl);
  color: var(--text-secondary);
}

.no-apps h3 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.no-apps p {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
}

/* Message Styles */
.success-message,
.error-message {
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-weight: var(--font-weight-medium);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.success-message {
  background: var(--success-50);
  color: var(--success-700);
  border: 1px solid var(--success-500);
}

.error-message {
  background: var(--error-50);
  color: var(--error-700);
  border: 1px solid var(--error-500);
}

/* Upload Status */
.upload-status {
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.upload-status .success {
  color: var(--success-500);
}

.upload-status .error {
  color: var(--error-500);
  display: block;
  margin-top: var(--space-xs);
}

.upload-status .loading {
  color: var(--primary-500);
}

/* Floating Message */
.floating-message {
  position: fixed;
  top: var(--space-xl);
  right: var(--space-xl);
  z-index: 10000;
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
  }

  .container {
    padding: 0 var(--space-xl);
  }
}

@media (max-width: 768px) {
  .language-switcher {
    position: static;
    justify-content: center;
    margin-bottom: var(--space-lg);
  }

  header {
    padding: var(--space-xl) 0;
  }

  .admin-controls {
    flex-direction: column;
    align-items: center;
  }

  .modal-content {
    margin: var(--space-lg) auto;
    padding: var(--space-2xl);
    width: 95%;
  }

  #editAppModal .modal-content {
    width: 95%;
    margin: var(--space-lg) auto;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .app-detail-header {
    flex-direction: column;
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
  }

  .app-detail-admin-controls {
    justify-content: center;
    width: 100%;
  }

  .app-detail-description,
  .app-detail-gallery,
  .app-detail-download,
  .app-detail-comments {
    padding: var(--space-2xl) var(--space-xl);
  }

  .detail-screenshot-gallery,
  .screenshot-gallery,
  .screenshot-preview {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .feedback-form {
    flex-direction: column;
  }

  .feedback-form input {
    min-width: auto;
  }

  .file-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .file-input-wrapper input[type="file"] {
    min-width: auto;
  }

  .bilingual-input {
    grid-template-columns: 1fr;
  }

  .telegram-community-btn-large {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 0.75rem;
    --space-xl: 1rem;
    --space-2xl: 1.25rem;
    --space-3xl: 1.5rem;
    --space-4xl: 2rem;
    --space-5xl: 2.5rem;
  }

  header h1 {
    font-size: var(--font-size-2xl);
  }

  header .subtitle {
    font-size: var(--font-size-base);
  }

  .admin-section {
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: var(--radius-lg);
  }

  .admin-header {
    padding: var(--space-2xl) var(--space-lg);
  }

  .admin-header h2 {
    font-size: var(--font-size-xl);
  }

  .app-detail-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .app-detail-title {
    font-size: var(--font-size-2xl);
  }

  .detail-screenshot-gallery,
  .screenshot-gallery,
  .screenshot-preview {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
  }

  .floating-message {
    left: var(--space-md);
    right: var(--space-md);
    max-width: none;
  }

  .modal-content {
    padding: var(--space-xl);
  }

  .image-modal-close {
    top: var(--space-md);
    right: var(--space-md);
    width: 2.5rem;
    height: 2.5rem;
    font-size: var(--font-size-2xl);
  }
}

/* ==========================================
   Focus & Accessibility
   ========================================== */
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary-500);
  color: white;
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-tooltip);
}

.skip-to-content:focus {
  top: var(--space-md);
  left: var(--space-md);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-muted: #333333;
  }

  .app-card-preview,
  .feedback-item,
  .upload-section {
    border-width: 2px;
  }
}

/* Dark mode support (optional, for future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode
  :root {
    --background: var(--gray-900);
    --surface: var(--gray-800);
    --text-primary: var(--gray-50);
    --text-secondary: var(--gray-300);
    --text-muted: var(--gray-400);
    --border: var(--gray-700);
    --border-light: var(--gray-800);
  }
  */
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
  .language-switcher,
  .admin-controls,
  .admin-section,
  .admin-controls-overlay,
  .admin-control-btn,
  .feedback-form,
  .feedback-delete,
  .screenshot-delete,
  .upload-section,
  .modal,
  .edit-btn,
  .delete-btn,
  .floating-message {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .app-card-preview,
  .app-detail-container {
    box-shadow: none;
    border: 1px solid #000;
    break-inside: avoid;
  }
  
  header {
    background: white;
    color: black;
    border-bottom: 2px solid #000;
  }

  .app-detail-header {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: var(--font-size-xs);
  }
}

/* ==========================================
   Custom Scrollbar (Webkit)
   ========================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--gray-100);
}

/* Use the same hero image as header/footer if you've set --hero-bg; fallback to header-bg.png */
:root { --hero-bg: var(--hero-bg, url("header-bg.png")); }

/* Wrap the section as a hero with overlay */
.login-required-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(420px, 60vh, 680px);
  display: grid;
  place-items: center;
  padding: var(--space-5xl) var(--space-lg);
  margin: 0;
}

/* Background image + gradient overlay */
.login-required-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(0,0,0,.35), rgba(0,0,0,.35)),
    var(--hero-bg) center / cover no-repeat;
}


/* Card sits above, with glassy look */
.login-required-card {
  width: 100%;
  max-width: 640px;
  background: rgba(0, 0, 0, 0.075);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2xl);
  text-align: center;
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #loginMatrix { display: none; }
}

/* Make the login hero fill the viewport (and grow if content is taller) */
.login-required-hero {
  min-height: 100vh; /* full screen */
}

/* Make the section itself tall */
.login-required-hero {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: var(--space-5xl) var(--space-lg);
}

/* Full-bleed background (matches header) */
.login-required-hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw; /* full viewport width */
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(0,0,0,.35), rgba(0,0,0,.35)),
    var(--hero-bg, url("header-bg.png")) center / cover no-repeat;
}

/* Matrix canvas full-bleed and click-through */
#loginMatrix {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;   /* <-- key change (not 100%) */
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: .55;
}

/* Matrix canvas full-bleed and click-through */
#loginMatrix {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;        /* fill the viewport width */
  height: 100%;
  max-width: none;     /* <-- override the global max-width:100% on canvas */
  pointer-events: none;
  z-index: -1;
  opacity: .55;
}

/* =========================
   Footer (now like header)
   ========================= */
.site-footer {
  position: relative;
  color: #fff;
  margin-top: var(--space-1xl);
  isolation: isolate;                 /* keep overlay behind content */
}

/* Background layer (same as header) */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* a touch darker at the bottom for readability */
    linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.55) 100%),
    url("header-bg.png") center / cover no-repeat;
}

/* Top and bottom sections now transparent so image shows through */
.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--space-2xl);
  padding: var(--space-4xl) 0;
}

.footer-bottom {
  background: transparent;
  border-top: 1px solid rgb(255 255 255 / 0.18);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xl) 0;
  gap: var(--space-lg);
  color: rgb(255 255 255 / 0.85);
  font-size: var(--font-size-sm);
}

/* Footer content colors over image */
.footer-logo { height: 56px; width: auto; margin-bottom: var(--space-lg); filter: drop-shadow(0 2px 8px rgb(0 0 0 / .35)); }
.footer-text { color: rgb(255 255 255 / 0.9); line-height: var(--line-height-relaxed); max-width: 46ch; }
.footer-links h4, .footer-contact h4 { color: #fff; }
.site-footer a { color: rgb(255 255 255 / 0.95); text-decoration: none; border-bottom: 1px solid transparent; transition: color var(--transition-fast), border-color var(--transition-fast); }
.site-footer a:hover { color: var(--accent-300); border-color: var(--accent-300); }
.telegram-link::before { content: "📱"; margin-right: .5rem; }

@media (max-width: 992px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* Footer brand: logo left, text right */
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.footer-logo {
  margin: 0;              /* no bottom gap since it's inline now */
  height: 84px;           /* a touch larger looks balanced in a row */
  width: auto;
}
.footer-text {
  margin: 0;              /* keep copy beside logo */
  max-width: 50ch;
}

/* Bullet lists aligned left under titles */
.footer-links ul,
.footer-contact ul {
  list-style: disc outside;
  padding-left: var(--space-xl);  /* indent bullets neatly under the h4 */
  margin: 0;
  display: block;                 /* ensure bullets render normally */
}
.footer-links li,
.footer-contact li {
  margin: var(--space-sm) 0;      /* spacing between items */
}

/* Mobile: stack the brand again for readability */
@media (max-width: 640px) {
  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
}

/* ==========================================
   Community Links Section (Add to admin-styles.css)
   ========================================== */

/* Community Links Grid */
.community-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* Base Community Link Button */
.community-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.community-link-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.community-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.community-link-btn:hover::before {
  opacity: 1;
}

.community-link-btn:active {
  transform: translateY(0);
}

.community-link-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Telegram Button */
.telegram-btn {
  background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
  color: white;
}

.telegram-btn:hover {
  background: linear-gradient(135deg, #0077b5 0%, #006699 100%);
}

/* WhatsApp Button */
.whatsapp-btn {
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  color: white;
}

.whatsapp-btn:hover {
  background: linear-gradient(135deg, #20BA5A 0%, #1CA14E 100%);
}

/* App Download Button */
.app-link-btn {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
}

.app-link-btn:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

/* Admin-specific: Download section styling */
.app-detail-download {
  padding: var(--space-2xl);
  border-bottom: 1px solid var(--border-light);
}

.app-detail-download h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.app-detail-download p {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-base);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .community-links-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .community-link-btn {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
  }
}

@media (max-width: 480px) {
  .community-link-btn {
    font-size: var(--font-size-sm);
    padding: var(--space-md);
  }
  
  .community-link-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Dark mode adjustments */
html[data-theme="dark"] .community-link-btn {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .community-link-btn:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .telegram-btn {
  background: linear-gradient(135deg, #0099dd 0%, #0088cc 100%);
}

html[data-theme="dark"] .whatsapp-btn {
  background: linear-gradient(135deg, #2DE47A 0%, #25D366 100%);
}

html[data-theme="dark"] .app-link-btn {
  background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
}

html[data-theme="dark"] .app-detail-download p {
  color: var(--text-secondary);
}

/* Focus states for accessibility */
.community-link-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

html[data-theme="dark"] .community-link-btn:focus {
  outline-color: var(--primary-300);
}

/* Loading state (optional) */
.community-link-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.community-link-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Icon animations */
.community-link-btn svg {
  transition: transform var(--transition-fast);
}

.community-link-btn:hover svg {
  transform: scale(1.1);
}

/* Admin view: subtle indication that links are editable */
.admin-controls .community-link-btn {
  position: relative;
}

.admin-controls .community-link-btn::after {
  content: '✏️';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.admin-controls .community-link-btn:hover::after {
  opacity: 1;
}

/* Empty state - when no links exist */
.no-links-message {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-style: italic;
}

html[data-theme="dark"] .no-links-message {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

/* Link preview in admin edit forms */
.form-group small {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.form-group input[type="url"] {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
}

/* Success indicator for valid URLs */
.form-group input[type="url"]:valid {
  border-left: 3px solid var(--success-500);
}

.form-group input[type="url"]:invalid:not(:placeholder-shown) {
  border-left: 3px solid var(--error-500);
}

/* Button group spacing in app detail */
.app-detail-download .community-links-grid {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Ensure proper spacing between sections */
.app-detail-download + .app-detail-comments {
  border-top: 1px solid var(--border-light);
}