/* Poukwapa Devspot - Index Page 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 (logo frame/text) */
  --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 (logo brackets/DEVSPOT) */
  --accent-600: #d68f12;
  --accent-700: #b8770c;
  --accent-800: #8f5a08;
  --accent-900: #704606;

  /* Neutral slate (kept, slightly cooled for the navy) */
  --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-100: #d1fae5;
  --success-500: #10b981;
  --success-700: #047857;

  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-700: #b91c1c;

  /* Platform */
  --telegram-500: #0088cc;
  --telegram-600: #006699;

  /* Semantic */
  --background: #f7f8fb;             /* subtle light vs navy */
  --surface: #ffffff;
  --text-primary: #0a1420;           /* near-primary-900 */
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Extras for easy theming */
  --brand: var(--primary-500);
  --brand-ink: #ffffff;
  --brand-accent: var(--accent-500);
  --ring: color-mix(in oklab, var(--accent-500) 45%, transparent);
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;

  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 2.5rem;
  --space-4xl: 3rem;
  --space-5xl: 8rem;
    --header-gap: clamp(1.5rem, 3.5vw, 3rem);

  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* 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;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-index */
  --z-dropdown: 100;
  --z-modal: 1000;
  --z-tooltip: 1100;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
}

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;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ==========================================
   Utility Classes
   ========================================== */
.container {
  max-width: 1200px;
  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);
}

/* ==========================================
   Header Styles
   ========================================== */
/* Header with image background + gradient overlay */
header {
  position: relative;
  color: white;
  text-align: center;
  padding: var(--space-3xl) 0; /* keep your spacing */
  isolation: isolate;         /* ensures overlays sit behind content */
    margin-bottom: var(--header-gap);

}

/* Background layer */
header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  /* 1) gradient overlay (tweak opacity) + 2) your image */
  background:
    url("header-bg.png") center / cover no-repeat;

  /* Optional: parallax-y feel on large screens */
  /* background-attachment: fixed; */
}


/* Optional: make the header taller/shorter on big/small screens */
@media (min-width: 1024px) {
  header { padding: 1rem 0; } /* taller on desktop */
}

  :root { --header-gap: clamp(2rem, 4vw, 5rem); }



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);
}

header .subtitle {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  font-weight: var(--font-weight-normal);
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
}

.lang-btn {
  background: rgb(255 255 255 / 0.2);
  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);
}

.lang-btn:hover {
  background: rgb(255 255 255 / 0.3);
  transform: translateY(-1px);
}

.lang-btn.active {
  background: rgb(255 255 255 / 0.9);
  color: var(--primary-500);
  border-color: rgb(255 255 255 / 0.9);
}

/* Admin Controls */
.admin-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.auth-btn {
  background: rgb(255 255 255 / 0.1);
  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-medium);
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.auth-btn:hover {
  background: rgb(255 255 255 / 0.2);
  transform: translateY(-1px);
}

/* ==========================================
   Button Styles
   ========================================== */
.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);
}

.back-btn:hover {
  background: var(--gray-600);
  transform: translateY(-1px);
}

/* ==========================================
   App Cards & Grid
   ========================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  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;
}

.app-card-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-100);
}

.app-preview-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--border-light);
}

.preview-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.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(--border-light) 0%, var(--border) 100%);
}

.preview-placeholder span {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.preview-placeholder p {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.app-category-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: rgb(59 130 246 / 0.9);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(4px);
}

.app-preview-content {
  padding: var(--space-xl);
}

.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);
}

.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;
}

.app-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.comment-count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.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);
}

.view-app-btn:hover {
  color: var(--primary-600);
}

/* ==========================================
   App Detail Styles
   ========================================== */
.app-detail-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.app-detail-header {
  color: #fff;
  padding: var(--space-2xl);
  /* Same image + overlay as header/footer */
  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;
}

.app-detail-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
}

.app-detail-category {
  background: rgb(255 255 255 / 0.2);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  display: inline-block;
  margin-bottom: var(--space-lg);
}

.app-detail-short-desc {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  line-height: var(--line-height-normal);
}

.app-detail-description,
.app-detail-gallery,
.app-detail-download,
.app-detail-comments {
  padding: 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-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

/* ==========================================
   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);
}

.rich-text-content h1 { font-size: var(--font-size-xl); }
.rich-text-content h2 { font-size: var(--font-size-lg); }
.rich-text-content h3 { font-size: var(--font-size-base); }

.rich-text-content p {
  margin-bottom: var(--space-lg);
}

.rich-text-content ul,
.rich-text-content ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-2xl);
}

.rich-text-content li {
  margin-bottom: var(--space-sm);
}

.rich-text-content blockquote {
  border-left: 4px solid var(--primary-500);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  font-style: italic;
  background: var(--gray-50);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
}

.rich-text-content strong {
  font-weight: var(--font-weight-semibold);
}

.rich-text-content code {
  background: var(--gray-100);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
}

.rich-text-content a {
  color: var(--primary-500);
  text-decoration: none;
}

.rich-text-content a:hover {
  text-decoration: underline;
}

/* ==========================================
   Screenshot Gallery
   ========================================== */
.detail-screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.detail-screenshot-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
  aspect-ratio: 16 / 9;
}

.detail-screenshot-item:hover {
  transform: scale(1.02);
}

.detail-screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* ==========================================
   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);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
}

.feedback-form input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.feedback-form button {
  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);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.feedback-form button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.feedback-item {
  background: var(--border-light);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  position: relative;
  border: 1px solid var(--border);
}

.feedback-author {
  font-weight: var(--font-weight-semibold);
  color: var(--primary-500);
  margin-bottom: var(--space-xs);
}

.feedback-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-normal);
}

.feedback-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-2xl);
}

/* ==========================================
   Telegram Button
   ========================================== */
.telegram-community-btn-large {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, var(--telegram-500) 0%, var(--telegram-600) 100%);
  color: white;
  text-decoration: none;
  padding: var(--space-lg) var(--space-2xl);
  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-lg);
}

.telegram-community-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.telegram-community-btn-large::before {
  content: "📱";
  font-size: var(--font-size-xl);
}

/* ==========================================
   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(4px);
}

.image-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  animation: modalSlideIn 300ms ease-out;
}

.image-modal-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.image-modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-2xl);
  color: white;
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.image-modal-close:hover {
  color: var(--gray-300);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ==========================================
   State Styles
   ========================================== */
.no-apps {
  text-align: center;
  padding: var(--space-4xl);
  color: var(--text-secondary);
}

.no-apps h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

/* Message Styles */
.success-message,
.error-message {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.success-message {
  background: var(--success-100);
  color: var(--success-700);
  border: 1px solid var(--success-500);
}

.error-message {
  background: var(--error-100);
  color: var(--error-700);
  border: 1px solid var(--error-500);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .language-switcher {
    position: static;
    justify-content: center;
    margin-bottom: var(--space-lg);
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .app-detail-container {
    margin: 0 calc(-1 * var(--space-md));
    border-radius: 0;
  }

  .detail-screenshot-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .feedback-form {
    flex-direction: column;
  }

  .feedback-form input {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 0.75rem;
    --space-xl: 1rem;
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;
    --space-4xl: 2.5rem;
  }

  header {
    padding: var(--space-xl) 0;
  }

  header h1 {
    font-size: var(--font-size-xl);
  }

  .app-detail-title {
    font-size: var(--font-size-xl);
  }

  .detail-screenshot-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* ==========================================
   Focus & Accessibility
   ========================================== */
*:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

input:focus,
button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.3);
}

/* 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;
  }
}

/* Option 2: h1 with image styling */
.site-title {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.site-title img {
    height: 260px;
    width: auto;
    max-width: 500px;
    /* Remove display: block and margin: 0 auto when using flexbox */
}  

/* =========================
   Footer (now like header)
   ========================= */
.site-footer {
  position: relative;
  color: #fff;
  margin-top: var(--space-5xl);
  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);
  }
}



/* =========================
   Dark Mode (opt-in)
   Toggle with <html data-theme="dark">
   ========================= */
html[data-theme="dark"] {
  /* Core palette */
  --background: #0b1220;             /* page bg */
  --surface: #121a2b;                /* cards, modals */
  --text-primary: #e6ebf5;           /* main text */
  --text-secondary: #c7d0e2;
  --text-muted: #93a0bb;

  --border: #1f2a40;
  --border-light: #162033;

  /* Brand nudges for dark */
  --primary-500: #5aa5ff;            /* brighten brand for contrast */
  --primary-600: #3f89e6;
  --primary-700: #2b6fbf;

  --accent-500: #f0a51b;             /* gold pops well on dark */
  --ring: color-mix(in oklab, var(--primary-500) 45%, transparent);

  /* Shadow tuning for dark */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
  --shadow-md: 0 6px 12px -2px rgb(0 0 0 / 0.45), 0 3px 6px -3px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 14px 24px -6px rgb(0 0 0 / 0.55), 0 8px 12px -8px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 24px 36px -10px rgb(0 0 0 / 0.6);

  color-scheme: dark; /* better native form controls */
}

/* Header + footer photos: deepen overlay on dark */
html[data-theme="dark"] header::before {
  background:
    linear-gradient(135deg, rgba(0,0,0,.55), rgba(0,0,0,.55)),
    url("header-bg.png") center / cover no-repeat;
}

/* App detail header uses the same hero image var in your CSS */
html[data-theme="dark"] .app-detail-header {
  background:
    linear-gradient(135deg, rgba(0,0,0,.55), rgba(0,0,0,.55)),
    var(--hero-bg, url("header-bg.png")) center / cover no-repeat;
}

/* Footer image overlay */
html[data-theme="dark"] .site-footer::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.7) 100%),
    url("header-bg.png") center / cover no-repeat;
}

/* Cards, grids, modals */
html[data-theme="dark"] .app-card-preview,
html[data-theme="dark"] .app-detail-container,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .feedback-item {
  background: rgba(18, 26, 43, 0.9);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html[data-theme="dark"] .app-card-preview:hover {
  border-color: #27406a;
  box-shadow: var(--shadow-lg);
}

/* App preview image placeholder tint */
html[data-theme="dark"] .preview-placeholder {
  color: var(--text-muted);
  background: linear-gradient(135deg, #0e1729 0%, #0b1220 100%);
}

/* Badges & links */
html[data-theme="dark"] .app-category-badge {
  background: rgba(30, 58, 138, .9);
  color: #eaf2ff;
}
html[data-theme="dark"] .view-app-btn,
html[data-theme="dark"] .rich-text-content a {
  color: var(--primary-500);
}
html[data-theme="dark"] .view-app-btn:hover,
html[data-theme="dark"] .rich-text-content a:hover {
  color: var(--primary-600);
}

/* Forms */
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .feedback-form input {
  background: #0f1a2c;
  color: var(--text-primary);
  border-color: var(--border);
}
html[data-theme="dark"] .form-group input:hover,
html[data-theme="dark"] .form-group select:hover,
html[data-theme="dark"] .form-group textarea:hover,
html[data-theme="dark"] .feedback-form input:hover {
  border-color: #27406a;
}
html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .feedback-form input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Buttons */
html[data-theme="dark"] .auth-btn,
html[data-theme="dark"] .lang-btn,
html[data-theme="dark"] .edit-btn,
html[data-theme="dark"] .delete-btn {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.18);
  color: #e9f0ff;
}
html[data-theme="dark"] .auth-btn:hover,
html[data-theme="dark"] .lang-btn:hover {
  background: rgb(255 255 255 / 0.16);
}

html[data-theme="dark"] button[type="submit"],
html[data-theme="dark"] .admin-btn,
html[data-theme="dark"] .upload-btn,
html[data-theme="dark"] .feedback-form button {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #071120;
  color: #fff; /* ensure readable */
}

/* Messages */
html[data-theme="dark"] .success-message {
  background: rgba(5, 46, 32, .45);
  color: #9ae6b4;
  border-color: #2f855a;
}
html[data-theme="dark"] .error-message {
  background: rgba(75, 17, 17, .45);
  color: #feb2b2;
  border-color: #ef4444;
}

/* Image modal close contrast */
html[data-theme="dark"] .image-modal-close:hover { color: #c6d4ef; }

/* Scrollbar (dark) */
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0e1627; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #36435b; }
html[data-theme="dark"] * { scrollbar-color: #36435b #0e1627; }

/* Apps section with photo bg (if you used .apps-hero earlier) */
html[data-theme="dark"] .apps-hero::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.65)),
    var(--apps-bg, var(--hero-bg, url("header-bg.png"))) center / cover no-repeat;
}
/* Glassy cards over photo */
html[data-theme="dark"] .apps-hero .app-card-preview {
  background: rgba(18, 26, 43, .85);
  border-color: rgba(255,255,255,.06);
}



/* ==========================================
   Community Links Section (Add this to index-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%);
}

/* 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%);
}

/* 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);
}

/* Text emphasis */
.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);
}

html[data-theme="dark"] .app-detail-download p {
  color: var(--text-secondary);
}