/* ===== شرارة — Shared Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&display=swap');

:root {
  --primary:       #1B3A6B;
  --primary-light: #2a52a0;
  --primary-xlight:#e8eef8;
  --innovator:     #E8640A;
  --innovator-bg:  #fff4ec;
  --expert:        #1a9e5c;
  --expert-bg:     #eafaf1;
  --investor:      #1a6db5;
  --investor-bg:   #e8f1fb;
  --accent:        #F4801A;
  --success:       #27AE60;
  --warning:       #F39C12;
  --danger:        #E74C3C;
  --bg:            #f3f6fc;
  --surface:       #ffffff;
  --border:        #dce6f5;
  --text:          #1e2a3a;
  --text-muted:    #6b7fa3;
  --shadow-sm:     0 2px 8px rgba(27,58,107,0.07);
  --shadow:        0 4px 20px rgba(27,58,107,0.11);
  --shadow-lg:     0 8px 40px rgba(27,58,107,0.15);
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --sidebar-w:     260px;
  --topbar-h:      68px;
}

* { font-family: 'Cairo', sans-serif; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); direction: rtl; }
a { text-decoration: none; color: inherit; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ===== TOP NAVBAR (app pages) ===== */
.app-navbar {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
}
.app-navbar .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 900; font-size: 1.4rem; color: var(--primary); white-space: nowrap; }
.app-navbar .brand span { color: var(--accent); }
.nav-search { flex: 1; max-width: 380px; position: relative; }
.nav-search input { width: 100%; padding: 0.5rem 1rem 0.5rem 2.8rem; border: 1.5px solid var(--border); border-radius: 30px; background: var(--bg); font-family: 'Cairo', sans-serif; font-size: 0.9rem; outline: none; transition: border 0.2s; }
.nav-search input:focus { border-color: var(--primary-light); }
.nav-search .si { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.nav-actions { display: flex; align-items: center; gap: 0.7rem; margin-right: auto; }
.nav-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s; font-size: 1.1rem; }
.nav-icon-btn:hover { background: var(--primary-xlight); color: var(--primary); }
.nav-icon-btn .badge-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 1.5px solid white; }
.nav-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--primary-xlight); }
.nav-avatar-wrap { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.nav-avatar-wrap .uname { font-weight: 600; font-size: 0.88rem; }
.role-badge { padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.role-innovator { background: var(--innovator-bg); color: var(--innovator); }
.role-expert    { background: var(--expert-bg);    color: var(--expert); }
.role-investor  { background: var(--investor-bg);  color: var(--investor); }

/* ===== SIDEBAR ===== */
.app-sidebar {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--primary);
  overflow-y: auto; padding: 1.2rem 0;
  border-left: none;
}
.app-sidebar .sidebar-section { padding: 0.3rem 1.2rem; font-size: 0.72rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin-top: 1rem; }
.app-sidebar a.sidebar-link {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1.4rem; color: rgba(255,255,255,0.75);
  font-size: 0.9rem; font-weight: 500; transition: all 0.18s; border-radius: 0;
}
.app-sidebar a.sidebar-link:hover, .app-sidebar a.sidebar-link.active {
  background: rgba(255,255,255,0.1); color: #fff;
}
.app-sidebar a.sidebar-link.active { border-right: 3px solid var(--accent); }
.app-sidebar a.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-badge { margin-right: auto; background: var(--accent); color: white; border-radius: 20px; padding: 1px 8px; font-size: 0.72rem; }

/* ===== MAIN CONTENT ===== */
.app-main { margin-right: var(--sidebar-w); margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); padding: 2rem 2rem 3rem; }

/* ===== CARDS ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header-clean { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header-clean .title { font-weight: 700; font-size: 1rem; }

/* ===== STATS CARDS ===== */
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 1.1rem; }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-val { font-size: 1.7rem; font-weight: 900; line-height: 1; }
.stat-label { font-size: 0.83rem; color: var(--text-muted); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn-primary-main { background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); padding: 0.55rem 1.4rem; font-family: 'Cairo', sans-serif; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; }
.btn-primary-main:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); padding: 0.55rem 1.4rem; font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; }
.btn-accent:hover { background: #d96d0a; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 0.5rem 1.2rem; font-family: 'Cairo', sans-serif; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: all 0.2s; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ===== PROJECT CARD ===== */
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; cursor: pointer; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card .pc-header { padding: 1.2rem 1.3rem 0.8rem; }
.project-card .pc-category { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 0.74rem; font-weight: 700; margin-bottom: 0.5rem; }
.project-card .pc-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.35rem; }
.project-card .pc-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; }
.project-card .pc-footer { padding: 0.8rem 1.3rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.rating-bar { height: 6px; border-radius: 10px; background: var(--border); overflow: hidden; width: 80px; }
.rating-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--warning), var(--success)); }

/* ===== AVATAR ===== */
.avatar { border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 100px; height: 100px; border: 3px solid white; box-shadow: var(--shadow); }

/* ===== PILLS & TAGS ===== */
.tag { display: inline-block; padding: 3px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; font-size: 0.78rem; color: var(--text-muted); }
.tag-primary { background: var(--primary-xlight); border-color: #c0d0ef; color: var(--primary); }

/* ===== FORM INPUTS ===== */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.6rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif; font-size: 0.9rem; color: var(--text); background: var(--surface);
  transition: border 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary-light); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ===== PROGRESS STEPS ===== */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 2rem; }
.step { display: flex; flex-direction: column; align-items: center; flex: 1; }
.step-circle { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; border: 2px solid var(--border); background: var(--surface); color: var(--text-muted); }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: white; }
.step.done .step-circle { background: var(--success); border-color: var(--success); color: white; }
.step-label { font-size: 0.78rem; margin-top: 0.3rem; color: var(--text-muted); }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step-line { flex: 1; height: 2px; background: var(--border); margin-bottom: 1.5rem; }
.step-line.done { background: var(--success); }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 1.8rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 900; margin: 0 0 0.2rem; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.2rem 0; }

/* ===== NOTIFICATION ITEM ===== */
.notif-item { display: flex; gap: 0.8rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.95rem; }
.notif-text { font-size: 0.85rem; line-height: 1.5; }
.notif-time { font-size: 0.76rem; color: var(--text-muted); }

/* ===== CHAT ===== */
.chat-list { border-left: 1px solid var(--border); height: calc(100vh - var(--topbar-h) - 4rem); overflow-y: auto; }
.chat-contact { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1.1rem; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.chat-contact:hover, .chat-contact.active { background: var(--primary-xlight); }
.chat-contact .info .name { font-weight: 600; font-size: 0.88rem; }
.chat-contact .info .last-msg { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.chat-window { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 4rem); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.msg-bubble { max-width: 65%; padding: 0.65rem 1rem; border-radius: 16px; font-size: 0.88rem; line-height: 1.55; }
.msg-in  { background: var(--bg); border-radius: 16px 16px 16px 4px; align-self: flex-start; }
.msg-out { background: var(--primary); color: white; border-radius: 16px 16px 4px 16px; align-self: flex-end; }
.msg-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.chat-input-bar { padding: 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.7rem; align-items: center; }
.chat-input-bar input { flex: 1; padding: 0.6rem 1rem; border: 1.5px solid var(--border); border-radius: 30px; font-family: 'Cairo', sans-serif; font-size: 0.9rem; outline: none; }
.chat-input-bar input:focus { border-color: var(--primary); }

/* ===== NDA BOX ===== */
.nda-box { background: #fffbf0; border: 2px dashed var(--warning); border-radius: var(--radius); padding: 1.5rem; }
.nda-box h5 { color: #8a6000; font-weight: 700; }
.nda-text { font-size: 0.82rem; line-height: 1.8; color: #5a4500; max-height: 200px; overflow-y: auto; }

/* ===== TABLES ===== */
.clean-table { width: 100%; border-collapse: collapse; }
.clean-table th { padding: 0.75rem 1rem; background: var(--bg); font-size: 0.83rem; font-weight: 700; color: var(--text-muted); text-align: right; border-bottom: 2px solid var(--border); }
.clean-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; vertical-align: middle; }
.clean-table tr:last-child td { border-bottom: none; }
.clean-table tr:hover td { background: var(--primary-xlight); }

/* ===== STATUS BADGES ===== */
.status { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 0.76rem; font-weight: 700; }
.status-active   { background: #eafaf1; color: #1a9e5c; }
.status-pending  { background: #fef9e7; color: #b7770d; }
.status-done     { background: #e8f1fb; color: #1a6db5; }
.status-rejected { background: #fdecea; color: #c0392b; }

/* ===== TOGGLE SWITCH ===== */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.toggle-wrap:last-child { border-bottom: none; }
.toggle-info .tl { font-weight: 600; font-size: 0.9rem; }
.toggle-info .td { font-size: 0.8rem; color: var(--text-muted); }
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 26px; transition: 0.3s; }
.toggle-slider:before { content:''; position: absolute; width: 20px; height: 20px; right: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(-20px); }

/* ===== MAP PAGE ===== */
#world-map { height: 450px; border-radius: var(--radius); overflow: hidden; }

/* ===== LANDING PAGE OVERRIDE ===== */
body.landing { background: white; }
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 999; padding: 1rem 3rem; display: flex; align-items: center; justify-content: space-between; transition: background 0.3s; }
.landing-nav.scrolled { background: white; box-shadow: var(--shadow-sm); }
.landing-brand { font-size: 1.8rem; font-weight: 900; color: var(--primary); }
.landing-brand span { color: var(--accent); }
.landing-nav-links { display: flex; gap: 2rem; align-items: center; }
.landing-nav-links a { font-weight: 600; font-size: 0.92rem; color: var(--text); transition: color 0.2s; }
.landing-nav-links a:hover { color: var(--primary); }
.hero-section { min-height: 100vh; background: linear-gradient(135deg, #0d1f3c 0%, #1B3A6B 50%, #1a52a8 100%); display: flex; align-items: center; padding: 7rem 3rem 4rem; position: relative; overflow: hidden; }
.hero-section::before { content:''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-content { position: relative; z-index: 1; max-width: 650px; }
.hero-tag { display: inline-block; padding: 6px 18px; background: rgba(244,128,26,0.2); border: 1px solid rgba(244,128,26,0.4); border-radius: 30px; color: #ffc98a; font-size: 0.85rem; font-weight: 600; margin-bottom: 1.5rem; }
.hero-content h1 { font-size: 3.2rem; font-weight: 900; color: white; line-height: 1.25; margin-bottom: 1.2rem; }
.hero-content h1 span { color: var(--accent); }
.hero-content p { color: rgba(255,255,255,0.8); font-size: 1.05rem; line-height: 1.75; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-hero-primary { padding: 0.85rem 2.2rem; background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer; transition: background 0.2s; }
.btn-hero-primary:hover { background: #d96d0a; }
.btn-hero-outline { padding: 0.85rem 2.2rem; background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); border-radius: var(--radius-sm); font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s; }
.btn-hero-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; }
.hero-stat .val { font-size: 2rem; font-weight: 900; color: white; }
.hero-stat .lbl { font-size: 0.82rem; color: rgba(255,255,255,0.6); }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { font-size: 2rem; font-weight: 900; color: var(--primary); }
.section-title p { color: var(--text-muted); max-width: 600px; margin: 0.5rem auto 0; }
.section-tag { display: inline-block; padding: 5px 16px; background: var(--primary-xlight); color: var(--primary); border-radius: 20px; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.8rem; }
.user-type-card { background: white; border-radius: var(--radius-lg); padding: 2.5rem 2rem; text-align: center; box-shadow: var(--shadow); border: 2px solid transparent; transition: all 0.3s; }
.user-type-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.user-type-card .icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 1.2rem; }
.user-type-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.8rem; }
.user-type-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }
.feature-item { display: flex; gap: 1.2rem; align-items: flex-start; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--primary-xlight); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.feature-item h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.feature-item p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.landing-footer { background: #0d1f3c; color: rgba(255,255,255,0.7); padding: 3rem; text-align: center; }

/* ===== MISC ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; display: block; }
.divider-text { text-align: center; position: relative; margin: 1.5rem 0; }
.divider-text::before { content:''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.divider-text span { position: relative; background: var(--surface); padding: 0 1rem; color: var(--text-muted); font-size: 0.85rem; }
.phase-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 0.8rem; }
.phase-card .phase-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.phase-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: white; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.task-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px dashed var(--border); }
.task-item:last-child { border-bottom: none; }
.task-item i { color: var(--success); }
