/* ============================================================
   BeanRate AI – Shared Mobile UI System
   يُضاف هذا الملف في كل صفحة لا تستخدم layout.php
   ============================================================ */

/* ── Base Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #050505;
  color: #f4f4f5;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100vh;
}

/* ── Mobile App Header ───────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(5, 5, 5, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.app-header .header-logo {
  height: 32px;
  width: auto;
}
.app-header .header-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  flex: 1;
}
.app-header .header-action {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #a1a1aa;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}
.app-header .header-action:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── Mobile Page Content ─────────────────────────── */
.mobile-page {
  padding: 20px 16px;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}

/* ── Bottom Navigation ───────────────────────────── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(5, 5, 5, 0.95);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 10px 8px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 16px;
  text-decoration: none;
  color: #52525b;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 50px;
  border: none;
  background: none;
  cursor: pointer;
}
.mobile-bottom-nav .nav-item i {
  font-size: 20px;
  transition: transform 0.2s;
}
.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:active {
  color: #D4AF37;
}
.mobile-bottom-nav .nav-item.plus-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4AF37, #f59e0b);
  color: #000;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
  font-size: 22px;
  padding: 0;
  gap: 0;
  transform: translateY(-6px);
}
.mobile-bottom-nav .nav-item.plus-btn i {
  font-size: 20px;
}

/* ── Glass Card ──────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 20px;
}

/* ── Section Title ───────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  margin-right: 4px;
}

/* ── Input Field ─────────────────────────────────── */
.app-input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  color: #f4f4f5;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.app-input:focus {
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}
.app-input::placeholder { color: #52525b; }

/* ── Primary Button ──────────────────────────────── */
.app-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #D4AF37, #f59e0b);
  color: #000;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 800;
  font-size: 16px;
  padding: 16px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
}
.app-btn-primary:active { transform: scale(0.98); opacity: 0.9; }

/* ── List Item ───────────────────────────────────── */
.app-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  text-decoration: none;
  color: #e4e4e7;
  transition: background 0.2s;
  cursor: pointer;
}
.app-list-item:active { background: rgba(255,255,255,0.07); }
.app-list-item .item-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.app-list-item .item-text .item-title {
  font-weight: 600;
  font-size: 14px;
}
.app-list-item .item-text .item-sub {
  font-size: 12px;
  color: #71717a;
  margin-top: 2px;
}
.app-list-item .item-arrow {
  margin-right: auto;
  color: #52525b;
  font-size: 12px;
}

/* ── Toggle Switch ───────────────────────────────── */
.app-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.app-toggle:last-child { border-bottom: none; }
.app-toggle label { font-size: 14px; color: #e4e4e7; }
.app-toggle input[type="checkbox"] {
  width: 44px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: #27272a;
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.app-toggle input[type="checkbox"]:checked {
  background: #D4AF37;
}
.app-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s;
}
.app-toggle input[type="checkbox"]:checked::after {
  left: 22px;
}

/* ── Avatar Upload ───────────────────────────────── */
.avatar-upload-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
}
.avatar-upload-wrap img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(212, 175, 55, 0.6);
}
.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #D4AF37;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 2px solid #050505;
}

/* ── Empty State ─────────────────────────────────── */
.app-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #52525b;
}
.app-empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}
.app-empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ── Toast ───────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,20,0.95);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  z-index: 9999;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Archive Special Layout ──────────────────────── */
.archive-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 340px) {
  .archive-insights { grid-template-columns: 1fr; }
}
.archive-insights .insight-small {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.archive-insights .insight-small .label {
  font-size: 8px;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.archive-insights .insight-small .value {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.archive-card-compact {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.archive-card-compact .img-wrap {
  aspect-ratio: 16/9;
  position: relative;
}
.archive-card-compact img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.archive-card-compact .meta {
  padding: 16px;
}
.archive-card-compact .score-float {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Filters ─────────────────────────────────────── */
.filter-row {
  margin-bottom: 20px;
}
.filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.filter-chip.active {
  background: #D4AF37;
  border-color: #D4AF37;
  color: #000;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Desktop override ────────────────────────────── */
@media (min-width: 1024px) {
  .mobile-bottom-nav { display: none !important; }
  .app-header { display: none; }
  .mobile-page {
    max-width: 760px;
    padding: 40px 24px;
    padding-bottom: 40px;
  }
}

/* ── Legacy Bottom Nav (DEPRECATED: Use .luxury-app .mobile-nav in app.css) ── */
/* If a page still uses .mobile-bottom-nav, it will fall back to basic styles here */
.mobile-bottom-nav {
  display: none;
}


