/* AIDEV-NOTE: v2 UI stylesheet (RTL, Sahel, minimal flat, light theme) */
/* AIDEV-NOTE: Font loaded from CDN - do not use local font files */
@import url('https://cdn.jsdelivr.net/npm/sahel-font@3.4.0/dist/font-face.min.css');

/* AIDEV-NOTE: Light theme colors (default) */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --muted: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(2, 6, 23, 0.04), 0 8px 24px rgba(2, 6, 23, 0.06);
}

/* AIDEV-NOTE: Dark theme colors */
[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #1e293b;
  --muted: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

html {
  direction: rtl;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sahel', 'Sahel VF', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.04s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn, .btn:link, .btn:visited, .btn:hover, .btn:active { text-decoration: none; }
.btn:hover { border-color: #cbd5e1; background: #fcfcfd; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.02); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }

.input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  box-sizing: border-box;
}
.input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
.input-ltr { direction: ltr; text-align: left; }
.label { display: block; margin-bottom: 8px; color: var(--text-muted); }
.field { display: grid; gap: 8px; }
.fields { display: grid; gap: 16px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.hero {
  padding: 72px 0;
}
.hero h1 {
  margin: 0 0 12px 0;
  font-family: 'Sahel VF', 'Sahel', sans-serif;
  font-variation-settings: "wght" 850;
  font-size: 44px;
}
.hero p { color: var(--text-muted); font-size: 16px; margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
}
.badge.free { background: var(--muted); }
.badge.standard { background: #e0f2fe; border-color: #0284c7; color: #0c4a6e; }
.badge.unlimited { background: #fef3c7; border-color: #f59e0b; color: #78350f; }

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0;
}
.nav a { color: var(--text); text-decoration: none; }

.features { padding: 32px 0; }
.feature { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }

.platforms { padding: 32px 0; }
.platform-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.platform-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--muted); display: grid; place-items: center; font-size: 12px; color: var(--text-muted); }
.platform-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }

.pricing { padding: 32px 0; }
.price-card { padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.progress {
  height: 10px; background: var(--muted); border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.progress > span { display: block; height: 100%; background: var(--primary); }

/* Layout: dashboard */
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; min-height: 100vh; align-items: start; }
.sidebar { position: sticky; top: 16px; padding: 16px; height: fit-content; max-height: calc(100vh - 32px); overflow-y: auto; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sidebar .logo .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.menu { display: grid; gap: 6px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.menu a.active, .menu a:hover { background: var(--muted); border-color: var(--border); }
.content { padding: 16px; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.header .actions { display: flex; align-items: center; gap: 8px; }


/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 101;
  background: var(--primary);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 20px;
}
.mobile-menu-toggle:hover { opacity: 0.9; }
.mobile-menu-toggle:active { transform: scale(0.95); }
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 99;
}
.sidebar-mobile-open { transform: translateX(0) !important; }

.card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.card h3 { margin: 0 0 8px 0; font-size: 16px; }
.card-clickable { cursor: pointer; transition: all 0.2s ease; }
.card-clickable:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.15); outline: 2px solid var(--border); outline-offset: -2px; }
.card-clickable:active { box-shadow: var(--shadow); }
.muted { color: var(--text-muted); }
.sep { height: 1px; background: var(--border); margin: 12px 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: right; }
.table th { color: var(--text-muted); font-weight: 600; }

.toast {
  position: fixed; top: 16px; right: 16px; display: grid; justify-items: end; gap: 8px; z-index: 1001; max-width: 360px;
}
.toast .item { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); }

.hidden { display: none !important; }
.stack { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { height: 16px; }

/* Mobile */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  }
  .mobile-menu-toggle { display: grid; place-items: center; }
  .mobile-menu-overlay.active { display: block; }
  .header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 560px) {
  .container { padding: 16px; }
  .nav { flex-direction: column; align-items: flex-start; }
  .grid { gap: 12px; }
  .btn { padding: 10px 12px; }
}

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.modal { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.modal-header { display:flex; align-items:center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; }
.modal-footer { display:flex; gap: 8px; justify-content: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); }

/* Loading skeleton - AIDEV-NOTE: Animation goes from right to left (RTL-friendly) */
.skeleton { background: linear-gradient(90deg, var(--muted) 25%, var(--bg) 50%, var(--muted) 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s ease-in-out infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 140px; }
.skeleton-row { height: 48px; }

/* Brand hero fix */
.brand-hero { font-family: 'Sahel VF', 'Sahel', sans-serif !important; font-variation-settings: "wght" 900 !important; font-weight: 900 !important; }

/* Support section in sidebar */
.support-section { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.support-section .support-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 14px; }
.support-section .support-link:hover { background: var(--muted); color: var(--text); }

/* Contact section */
.contact-section { padding: 32px 0; text-align: center; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 16px; }
.contact-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); text-decoration: none; transition: all 0.2s ease; }
.contact-link:hover { border-color: var(--primary); background: var(--muted); }

/* About page */
.about-hero { padding: 48px 0; text-align: center; }
.about-content { padding: 32px 0; }
.about-section { margin-bottom: 32px; }
.about-section h2 { margin: 0 0 16px 0; font-size: 24px; }
.about-section p { color: var(--text-muted); line-height: 1.8; }

/* Fix overflow issues */
html, body { overflow-x: hidden; width: 100%; }
.container { overflow-x: hidden; max-width: 100%; box-sizing: border-box; }
.price-card { word-wrap: break-word; overflow-wrap: break-word; box-sizing: border-box; }
.btn { white-space: nowrap; box-sizing: border-box; }
.grid { width: 100%; box-sizing: border-box; }
.row { flex-wrap: wrap; }

/* Login page consistency */
.login-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; margin-bottom: 24px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }

/* AIDEV-NOTE: Theme toggle dropdown */
.theme-toggle { position: relative; }
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.theme-toggle-btn:hover { background: var(--muted); }
.theme-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 10;
}
.theme-dropdown.active { display: block; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.theme-option:hover { background: var(--muted); }
.theme-option.selected { background: var(--muted); font-weight: 600; }

/* AIDEV-NOTE: Page header for contact/about pages */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.page-header .page-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.page-header .page-brand:hover { opacity: 0.8; }
.page-header .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}

/* AIDEV-NOTE: Plan comparison equal rows */
.plan-features {
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.plan-details {
  min-height: 140px;
}

/* AIDEV-NOTE: Empty state for lists - minimal design without background box */
.empty-state {
  padding: 48px 24px;
  text-align: center;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text);
}
.empty-state p {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 14px;
}


