/* =============================================
   ISLAMIC ALTERNATIVES — Muslim Life Orb
   Same green/gold identity as TDII
============================================= */

:root {
  --gold:        #C9973A;
  --gold-light:  #E8C97A;
  --gold-pale:   #FDF6E8;
  --green-deep:  #1A3A2A;
  --green-mid:   #2D5A3D;
  --green-light: #EAF3ED;
  --cream:       #FAF8F3;
  --white:       #FFFFFF;
  --text:        #1C1C1C;
  --text-mid:    #4B5563;
  --text-muted:  #9CA3AF;
  --border:      #E5DDD0;
  --radius:      10px;
  --radius-lg:   14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.site-header {
  background: var(--green-deep);
  border-bottom: 3px solid var(--gold);
  padding: 1.25rem 1rem 0;
}
.header-inner { max-width: 1100px; margin: 0 auto; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.header-moon { font-size: 1.8rem; color: var(--gold); line-height: 1; }
.site-title {
  font-family: 'Amiri', serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #fff;
  font-weight: 700;
  display: block;
  line-height: 1.1;
  text-decoration: none;
}
.site-title:hover { text-decoration: none; opacity: 0.9; }
.site-tagline-text { font-size: 0.78rem; color: var(--gold-light); opacity: 0.8; font-weight: 300; }

.btn-suggest {
  background: var(--gold);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-suggest:hover { opacity: 0.88; text-decoration: none; }

/* Search */
.header-search {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid rgba(201,151,58,0.4);
}
.header-search-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  color: #fff;
  border: none;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.header-search-input::placeholder { color: rgba(255,255,255,0.35); }
.header-search-btn {
  background: var(--gold);
  color: var(--green-deep);
  border: none;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.14s;
}
.header-search-btn:hover { opacity: 0.88; }

/* Category nav */
.cat-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0;
  margin: 0 -1rem;
  padding: 0 1rem;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  color: rgba(232,201,122,0.7);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.14s, border-color 0.14s;
  text-decoration: none;
  flex-shrink: 0;
}
.cat-nav-link:hover { color: var(--gold); text-decoration: none; }
.cat-nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---- MAIN ---- */
.site-main { flex: 1; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.page-wrap-narrow { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; }

/* ---- APP GRID ---- */
.section-heading {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--green-deep);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.section-heading .count {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* App card */
.app-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: box-shadow 0.18s, transform 0.18s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.app-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
  transform: translateY(-2px);
  text-decoration: none;
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.app-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.app-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

.app-card-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.2;
}
.app-card-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.app-card-desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-replaces {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.app-card-replaces span {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-right: 0.2rem;
  display: inline-block;
  margin-top: 0.15rem;
}

.app-card-footer {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-free     { background: #F0FDF4; color: #166534; }
.tag-freemium { background: #FFFBEB; color: #92400E; }
.tag-paid     { background: #FEF2F2; color: #991B1B; }
.tag-platform { background: var(--green-light); color: var(--green-mid); }
.tag-featured { background: var(--gold-pale); color: #92400E; border: 1px solid var(--gold-light); }

/* Featured star badge */
.featured-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  color: var(--gold);
  font-size: 0.85rem;
}

/* ---- APP PROFILE PAGE ---- */
.app-profile-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.app-profile-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  overflow: hidden;
}
.app-profile-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.app-profile-info { flex: 1; min-width: 200px; }
.app-profile-name {
  font-family: 'Amiri', serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--green-deep);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.app-profile-tagline { font-size: 0.9rem; color: var(--text-muted); font-style: italic; margin-bottom: 0.75rem; }
.app-profile-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.app-profile-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-mid); }
.app-profile-meta strong { color: var(--green-deep); }
.app-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gold);
  color: var(--green-deep);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  transition: opacity 0.14s;
  text-decoration: none;
}
.app-visit-btn:hover { opacity: 0.88; text-decoration: none; }

.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.section-card-title {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--green-deep);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.why-muslim-box {
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.65;
}
.why-muslim-box::before {
  content: '☪️  Why it\'s Muslim-friendly';
  display: block;
  font-weight: 600;
  color: var(--green-deep);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

/* Replaces section */
.replaces-list { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.replaces-chip {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-mid);
}

/* ---- HOMEPAGE HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  border-bottom: 3px solid var(--gold);
  padding: 3rem 1rem;
  text-align: center;
  color: #fff;
}
.hero-bismillah {
  font-family: 'Amiri', serif;
  font-size: 1.75rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  max-width: 540px;
  margin: 0 auto 1.5rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-stat-num {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}
.hero-stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-top: 0.2rem; }

/* Category browse cards */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
  display: block;
}
.cat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none; }
.cat-card-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.cat-card-name { font-size: 0.82rem; font-weight: 600; color: var(--text-mid); }
.cat-card-count { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ---- SUGGEST FORM ---- */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.form-label .req { color: #DC2626; margin-left: 2px; }
.form-control {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color 0.14s;
}
.form-control:focus { border-color: var(--gold); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
.btn-submit { background: var(--gold); color: var(--green-deep); font-weight: 600; border: none; padding: 0.65rem 1.75rem; border-radius: var(--radius); font-size: 0.95rem; font-family: 'Inter', sans-serif; cursor: pointer; transition: opacity 0.14s; }
.btn-submit:hover { opacity: 0.88; }

/* ---- UPVOTE BUTTON ---- */
.upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-mid);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.upvote-btn:hover, .upvote-btn.voted {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--green-deep);
}
.upvote-count { font-weight: 600; }

/* ---- SEARCH PAGE ---- */
.search-info { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.search-info strong { color: var(--text); }

/* ---- EMPTY / ERROR ---- */
.state-empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); }
.state-empty .state-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.state-empty p { font-size: 0.9rem; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: var(--radius); padding: 1rem 1.25rem; color: #166534; font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ---- BACK LINK ---- */
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.back-link:hover { color: var(--green-mid); text-decoration: none; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--green-deep);
  border-top: 3px solid var(--gold);
  padding: 2.5rem 1rem 1.5rem;
  margin-top: auto;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
.footer-brand { font-family: 'Amiri', serif; font-size: 1.1rem; color: #fff; margin-bottom: 0.5rem; }
.footer-desc { font-size: 0.8rem; color: rgba(232,201,122,0.6); margin-bottom: 1rem; line-height: 1.5; }
.btn-suggest-foot { display: inline-block; background: var(--gold); color: var(--green-deep); font-size: 0.78rem; font-weight: 600; padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none; }
.footer-heading { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(232,201,122,0.5); margin-bottom: 0.65rem; }
.footer-link { display: block; font-size: 0.8rem; color: rgba(232,201,122,0.65); margin-bottom: 0.35rem; }
.footer-link:hover { color: var(--gold); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(201,151,58,0.2); padding-top: 1rem; font-size: 0.78rem; color: rgba(232,201,122,0.4); text-align: center; }
.footer-bottom a { color: var(--gold); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .app-profile-header { flex-direction: column; }
  .hero { padding: 2rem 1rem; }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
