/* Needix Theme & Stylesheet - Modern, Accessible & Eco-conçu (Green IT) */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --border: #243048;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.lang-selector {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.btn-nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.btn-nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 36px;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn-primary-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
  text-decoration: none;
}

.btn-secondary-hero {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 28px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, border 0.2s;
}
.btn-secondary-hero:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  text-decoration: none;
}

.hero-badges-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero-badges-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Concept Highlight Cards */
.concept-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 60px 0 80px;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--radius);
  transition: transform 0.2s, border-color 0.2s;
}
.concept-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}
.concept-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}
.concept-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: #fff;
}
.concept-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Store Badges Section */
.stores-section {
  padding: 60px 0;
  background: rgba(21, 28, 44, 0.5);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.section-header {
  margin-bottom: 40px;
}
.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.store-badges-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

.store-badge-card {
  background: #000;
  color: #fff;
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 210px;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
}
.store-badge-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  text-decoration: none;
}
.store-badge-card.fdroid-card {
  border-color: rgba(59, 130, 246, 0.4);
  background: #0f172a;
}
.store-icon-svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.badge-subtext {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}
.badge-maintext {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

/* Mode d'emploi (Steps) */
.how-section {
  padding: 80px 0;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  position: relative;
}
.step-number-pill {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #000;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.step-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Web App Section (Embedded) */
.webapp-section {
  padding: 80px 0;
  background: #080c14;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.app-container-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.app-toolbar {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(11, 15, 25, 0.6);
}
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-action {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}
.btn-action.btn-save-main {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}
.btn-action.btn-save-main:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* Stats Row */
.app-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.stat-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 10px;
}
.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* App Nav Tabs & Filters */
.app-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}
.app-tabs-group {
  display: flex;
  gap: 8px;
}
.app-tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.app-tab-btn.active {
  background: var(--primary);
  color: #000;
}
.filter-search-group {
  display: flex;
  gap: 12px;
  flex: 1;
  max-width: 600px;
}
.input-search {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  outline: none;
}
.select-filter {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}
.btn-add-primary {
  background: linear-gradient(135deg, var(--secondary), #2563eb);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Items Grid */
.app-content-body {
  padding: 24px;
  min-height: 400px;
}
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.item-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s;
}
.item-card.low-stock {
  border-color: rgba(239, 68, 68, 0.5);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.location-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-right: 6px;
}
.loc-fridge { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.loc-cupboard { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.loc-freezer { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.loc-cellar { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.loc-bathroom { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.loc-other { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.category-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.item-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.item-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-style: italic;
}
.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Quantity controller */
.quantity-controller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 14px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  background: var(--border);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover {
  background: var(--text-muted);
}
.qty-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.qty-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.qty-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.min-threshold {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.action-buttons {
  display: flex;
  gap: 8px;
}
.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.1s;
}
.icon-btn:hover {
  transform: scale(1.15);
}

/* Badges */
.badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.badge.danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge.warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge.neutral { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge.muted { background: transparent; color: var(--text-muted); }

/* Shopping list styling */
.shopping-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.store-group-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.store-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.shopping-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shopping-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.btn-restock {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
}

/* FAQ Accordion */
.faq-section {
  padding: 80px 0;
}
.faq-accordion {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 22px 24px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  padding: 0 24px 22px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #cbd5e1;
}
.form-control {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(11, 15, 25, 0.4);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }
.toast.info { background: #2563eb; }
.toast.fade-out { opacity: 0; transition: opacity 0.4s; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .nav-links { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .app-controls-row { flex-direction: column; align-items: stretch; }
  .filter-search-group { max-width: 100%; flex-direction: column; }
}

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