AnesKAM commited on
Commit
819cdc6
·
verified ·
1 Parent(s): d15db31

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1061 -477
index.html CHANGED
@@ -23,8 +23,8 @@
23
  --text-main: #12132a;
24
  --text-sub: #6b7280;
25
  --text-faint: #9ca3af;
26
- --shadow-card: 0 2px 12px rgba(91, 94, 244, 0.06), 0 1px 3px rgba(0,0,0,0.03);
27
- --shadow-hover: 0 10px 32px rgba(91, 94, 244, 0.12), 0 2px 8px rgba(0,0,0,0.05);
28
  --radius-nav: 24px;
29
  --radius-card: 20px;
30
  --radius-pill: 100px;
@@ -50,7 +50,12 @@
50
  --shadow-hover: 0 12px 40px rgba(130, 133, 255, 0.18);
51
  }
52
 
53
- * { margin:0; padding:0; box-sizing:border-box; }
 
 
 
 
 
54
  body {
55
  font-family: 'Tajawal', sans-serif;
56
  background: var(--bg-base);
@@ -61,619 +66,1198 @@
61
  position: relative;
62
  }
63
 
64
- /* Animated mesh background with floating orbs */
65
  .bg-mesh {
66
- position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
 
 
 
 
67
  }
68
  .orb {
69
- position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
 
 
 
70
  animation: float 20s ease-in-out infinite alternate;
71
  }
72
  .orb-1 {
73
- width: 60vw; height: 60vw;
74
- background: radial-gradient(circle, rgba(91,94,244,0.18) 0%, transparent 70%);
75
- top: -15%; right: -10%;
 
 
76
  }
77
  .orb-2 {
78
- width: 50vw; height: 50vw;
79
- background: radial-gradient(circle, rgba(224,66,122,0.14) 0%, transparent 70%);
80
- bottom: -10%; left: -5%;
 
 
81
  }
82
  .orb-3 {
83
- width: 35vw; height: 35vw;
84
- background: radial-gradient(circle, rgba(167,139,250,0.12) 0%, transparent 70%);
85
- top: 60%; left: 60%;
 
 
86
  }
87
  @keyframes float {
88
- 0% { transform: translate(0, 0) scale(1); }
89
- 100% { transform: translate(5%, 3%) scale(1.08); }
 
 
 
 
90
  }
91
 
92
- /* Navigation */
93
  .navbar {
94
- position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
95
- width: 95%; max-width: 1280px; min-height: 70px;
96
- background: var(--bg-nav); backdrop-filter: var(--glass-blur);
 
 
 
 
 
 
97
  -webkit-backdrop-filter: var(--glass-blur);
98
  border: 1px solid var(--border);
99
  border-radius: var(--radius-nav);
100
- display: flex; flex-wrap: wrap; align-items: center;
101
- justify-content: space-between; padding: 10px 22px;
 
 
 
102
  z-index: 1000;
103
- box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 0 rgba(255,255,255,0.7) inset;
104
- gap: 14px; transition: background 0.4s, border-color 0.4s, box-shadow 0.3s;
105
- }
106
- .navbar.scrolled {
107
- box-shadow: 0 8px 30px rgba(0,0,0,0.1);
108
  }
109
 
110
  .brand {
111
- font-family: 'Syne', sans-serif; font-weight: 800; font-size: 22px;
112
- text-decoration: none; color: var(--text-main); display: flex; align-items: center; gap: 10px;
113
- letter-spacing: -0.02em; flex-shrink: 0;
 
 
 
 
 
 
 
114
  transition: transform 0.2s;
115
  }
116
- .brand:hover { transform: scale(1.03); }
 
 
117
  .brand-icon {
118
- width: 40px; height: 40px;
 
119
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
120
- border-radius: 12px; display: flex; align-items: center; justify-content: center;
121
- color: #fff; font-size: 18px; box-shadow: 0 6px 18px var(--accent-glow);
 
 
 
 
 
122
  }
123
 
124
- .search-container { flex: 1; max-width: 600px; width: 100%; }
 
 
 
 
125
  .search-bar {
126
- display: flex; align-items: center; background: var(--bg-input);
127
- border: 2px solid transparent; border-radius: var(--radius-pill);
128
- padding: 4px 4px 4px 20px; transition: var(--transition); width: 100%;
129
- box-shadow: 0 2px 8px rgba(0,0,0,0.02);
 
 
 
 
 
130
  }
131
  .search-bar:focus-within {
132
- border-color: var(--accent); background: var(--bg-input-focus);
133
- box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.04);
 
134
  transform: translateY(-1px);
135
  }
136
  .search-bar input {
137
- flex: 1; background: transparent; border: none; padding: 10px 0;
138
- color: var(--text-main); font-family: 'Tajawal', sans-serif; font-size: 15px; min-width: 0;
 
 
 
 
 
 
139
  }
140
  .search-btn {
141
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
142
- border: none; color: #fff; cursor: pointer; width: 44px; height: 40px;
143
- border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center;
144
- font-size: 15px; transition: var(--transition);
 
 
 
 
 
 
 
 
145
  box-shadow: 0 4px 14px var(--accent-glow);
146
  }
147
- .search-btn:hover { transform: scale(1.06); box-shadow: 0 6px 18px var(--accent-glow); }
 
 
 
148
 
149
  #theme-toggle {
150
- background: var(--bg-input); border: 2px solid var(--border);
151
- color: var(--text-sub); cursor: pointer; width: 42px; height: 42px;
152
- border-radius: 50%; display: flex; align-items: center; justify-content: center;
153
- font-size: 16px; transition: var(--transition);
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
- #theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); }
156
 
157
- /* Tabs */
158
  .tabs-bar {
159
- position: fixed; top: 110px; left: 50%; transform: translateX(-50%);
160
- width: 95%; max-width: 1280px; display: flex; gap: 8px; z-index: 999;
161
- overflow-x: auto; padding-bottom: 6px; scrollbar-width: none;
162
- backdrop-filter: blur(10px); padding: 6px 10px; border-radius: 40px;
163
- background: rgba(255,255,255,0.25); border: 1px solid var(--border); margin-top: 8px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
- [data-theme="dark"] .tabs-bar { background: rgba(18,20,46,0.35); }
166
  .tab-pill {
167
- padding: 8px 18px; border-radius: var(--radius-pill);
168
- background: var(--bg-card); border: 1.5px solid var(--border);
169
- color: var(--text-sub); font-family: 'Tajawal', sans-serif;
170
- font-size: 13.5px; font-weight: 500; cursor: pointer;
171
- transition: var(--transition); display: flex; align-items: center; gap: 7px;
172
- white-space: nowrap; box-shadow: var(--shadow-card);
173
- backdrop-filter: blur(10px);
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
- .tab-pill:hover { border-color: var(--border-hover); color: var(--accent); transform: translateY(-1px); }
176
  .tab-pill.active {
177
- background: var(--accent); color: #fff; border-color: var(--accent);
 
 
178
  box-shadow: 0 6px 20px var(--accent-glow);
179
  font-weight: 600;
180
  }
181
 
182
- /* Page Layout */
183
  .page-wrapper {
184
- position: relative; z-index: 1; max-width: 1280px;
185
- margin: 190px auto 60px; padding: 0 20px;
186
- display: flex; flex-direction: column; gap: 28px;
 
 
 
 
 
 
 
 
 
187
  }
188
- .results-area { min-width: 0; width: 100%; }
189
 
190
- /* Loading */
191
  .loading-spinner {
192
- display: flex; align-items: center; gap: 10px; color: var(--text-sub);
193
- font-size: 14px; padding: 24px; justify-content: center;
 
 
 
 
 
194
  }
195
  .spinner {
196
- width: 20px; height: 20px; border: 3px solid var(--border);
197
- border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
 
 
 
 
 
 
 
 
 
198
  }
199
- @keyframes spin { to { transform: rotate(360deg); } }
200
 
201
- /* Cards Animation */
202
- .search-result, .image-card, .video-card, .rich-graph-container {
203
- opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease;
 
 
 
 
 
204
  }
205
- .search-result.visible, .image-card.visible, .video-card.visible, .rich-graph-container.visible {
206
- opacity: 1; transform: translateY(0);
 
 
 
 
207
  }
208
 
209
  .search-result {
210
- background: var(--bg-card); border: 1.5px solid var(--border);
211
- border-radius: var(--radius-card); padding: 20px 22px; margin-bottom: 14px;
212
- transition: var(--transition); box-shadow: var(--shadow-card);
213
- display: flex; gap: 16px; align-items: flex-start;
 
 
 
 
 
 
214
  backdrop-filter: blur(5px);
215
  }
216
  .search-result:hover {
217
- border-color: var(--border-hover); box-shadow: var(--shadow-hover);
 
218
  transform: translateY(-3px);
219
  }
220
  .favicon-wrap {
221
- width: 28px; height: 28px; border-radius: 8px; overflow: hidden;
222
- flex-shrink: 0; margin-top: 2px; background: var(--bg-input);
223
- display: flex; align-items: center; justify-content: center;
224
- box-shadow: 0 2px 6px rgba(0,0,0,0.05);
225
- }
226
- .favicon-wrap img { width: 18px; height: 18px; object-fit: contain; }
227
- .result-content { flex: 1; min-width: 0; }
228
- .result-domain { font-size: 12px; color: var(--text-faint); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  .result-title {
230
- font-size: 17px; font-weight: 700; color: var(--accent); text-decoration: none;
231
- display: inline-block; margin-bottom: 8px; line-height: 1.4; transition: color 0.2s;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
233
- .result-title:hover { color: var(--accent-2); text-decoration: underline; }
234
- .result-snippet { font-size: 14px; color: var(--text-sub); line-height: 1.7; }
235
 
236
- /* Rich Results */
237
- .rich-graph-container { display: flex; flex-direction: column; gap: 22px; margin-bottom: 28px; }
 
 
 
 
 
238
  .rich-images-row {
239
- display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; min-height: 170px; align-items: center;
 
 
 
 
 
 
240
  }
241
  .rich-img-card {
242
- flex-shrink: 0; height: 170px; border-radius: 16px; overflow: hidden;
243
- background: var(--bg-input); border: 1px solid var(--border); box-shadow: var(--shadow-card);
244
- transition: var(--transition); position: relative;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
246
- .rich-img-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow-hover); }
247
- .rich-img-card img { height: 100%; width: auto; object-fit: cover; display: block; }
248
  .img-error-overlay {
249
- position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
250
- background: var(--bg-input); color: var(--text-faint); flex-direction: column; gap: 6px; font-size: 13px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
252
- .img-error-overlay i { font-size: 24px; }
253
-
254
- .wiki-card { margin-bottom: 0 !important; }
255
- .wiki-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
256
- .wiki-domain { font-size: 14px; font-weight: 700; color: var(--text-main); }
257
- .wiki-url { font-size: 12px; color: var(--text-faint); text-decoration: none; }
258
  .rich-section-title {
259
- font-size: 20px; font-weight: 700; margin: 12px 0 8px; color: var(--text-main);
260
- display: flex; align-items: center; gap: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
- .rich-section-title i { font-size: 15px; color: var(--text-faint); margin-right: auto; }
263
-
264
- .rich-videos-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
265
  .rich-vid-card {
266
- flex: 0 0 250px; text-decoration: none; background: var(--bg-card); border-radius: 16px;
267
- overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-card); transition: var(--transition);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  }
269
- .rich-vid-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
270
- .rich-vid-thumb { height: 140px; position: relative; background: var(--bg-input); }
271
- .rich-vid-thumb img { width: 100%; height: 100%; object-fit: cover; }
272
  .rich-vid-play {
273
- position: absolute; bottom: 12px; left: 12px;
274
- background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); color: #fff;
275
- width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
276
- justify-content: center; font-size: 13px; transition: 0.2s;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
- .rich-vid-card:hover .rich-vid-play { background: var(--accent); }
279
- .rich-vid-info { padding: 14px; }
280
  .rich-vid-title {
281
- font-size: 14px; font-weight: 600; color: var(--text-main);
282
- display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  }
284
- .rich-vid-meta { font-size: 12px; color: var(--text-faint); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
285
-
286
- .discover-bubbles { display: flex; flex-direction: column; gap: 10px; }
287
  .discover-bubble {
288
- background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 60px;
289
- padding: 15px 24px; display: flex; align-items: center; gap: 14px;
290
- cursor: pointer; transition: var(--transition); font-family: 'Tajawal', sans-serif;
291
- font-size: 16px; font-weight: 500; color: var(--text-main); text-align: right;
292
- box-shadow: var(--shadow-card); backdrop-filter: blur(5px); width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
294
- .discover-bubble i { color: var(--text-faint); font-size: 16px; transition: 0.2s; }
295
  .discover-bubble:hover {
296
- background: var(--bg-input-focus); border-color: var(--accent); color: var(--accent);
297
- transform: translateX(-6px); box-shadow: var(--shadow-hover);
 
 
 
 
 
 
298
  }
299
- .discover-bubble:hover i { color: var(--accent); }
300
 
301
- /* Image Grid */
302
  .images-grid {
303
- display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; width: 100%;
 
 
 
304
  }
305
  .image-card {
306
- background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-card);
307
- overflow: hidden; transition: var(--transition); box-shadow: var(--shadow-card);
308
- display: flex; flex-direction: column;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
- .image-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-5px); }
311
- .image-card-link { display: block; width: 100%; height: 190px; overflow: hidden; background: var(--bg-input); position: relative; }
312
- .image-card-link img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
313
- .image-card:hover .image-card-link img { transform: scale(1.08); }
314
- .image-info { padding: 10px 14px; font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
315
-
316
- /* Video Grid */
317
  .videos-grid {
318
- display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; width: 100%;
 
 
 
319
  }
320
  .video-card {
321
- background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-card);
322
- overflow: hidden; transition: var(--transition); box-shadow: var(--shadow-card);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  }
324
- .video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
325
- .video-thumb-wrap { position: relative; width: 100%; height: 190px; background: var(--bg-input); display: block; overflow: hidden; }
326
- .video-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
327
  .play-overlay {
328
- position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
329
- width: 50px; height: 50px; background: rgba(91,94,244,0.9); color: white; border-radius: 50%;
330
- display: flex; align-items: center; justify-content: center; font-size: 18px;
331
- box-shadow: 0 0 20px rgba(0,0,0,0.3); transition: var(--transition); z-index: 2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  }
333
- .video-details { padding: 16px; }
334
- .video-title { font-size: 15px; font-weight: 700; color: var(--text-main); text-decoration: none; display: block; line-height: 1.5; }
335
 
336
- /* AI Widget */
337
- .sidebar { width: 100%; order: 2; margin-top: 12px; }
338
- .ai-widget-wrap { position: relative; border-radius: var(--radius-card); }
 
 
 
 
 
 
 
339
  .ai-glow-ring {
340
- position: absolute; inset: -3px; border-radius: calc(var(--radius-card) + 3px);
 
 
341
  background: conic-gradient(from var(--angle, 0deg), var(--accent), var(--accent-2), #a78bfa, var(--accent), var(--accent-2), var(--accent));
342
- z-index: 0; animation: spin-glow 5s linear infinite; filter: blur(1.5px);
 
 
 
 
 
 
 
 
 
 
 
 
343
  }
344
- @property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
345
- @keyframes spin-glow { to { --angle: 360deg; } }
346
  .ai-widget {
347
- position: relative; z-index: 1; background: var(--bg-card);
348
- border-radius: var(--radius-card); padding: 20px 20px 18px;
349
- box-shadow: var(--shadow-card); backdrop-filter: blur(5px);
 
 
 
 
 
 
 
 
 
 
350
  }
351
- .ai-widget-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
352
  .ai-widget-icon {
353
- width: 34px; height: 34px; border-radius: 10px;
 
 
354
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
355
- display: flex; align-items: center; justify-content: center;
356
- color: #fff; font-size: 14px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  }
358
- .ai-widget-badge { margin-right: auto; font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--accent-glow); color: var(--accent); }
359
- .ai-answer-body { font-size: 14px; color: var(--text-sub); line-height: 1.8; min-height: 60px; }
360
- .ai-skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; margin-bottom: 10px; }
361
- @keyframes shimmer { 0%{background-position:200% 0}100%{background-position:-200% 0}}
362
  .ai-copy-btn {
363
- margin-top: 14px; padding: 8px 16px; background: var(--bg-input); border: 1px solid var(--border);
364
- border-radius: 30px; cursor: pointer; font-size: 12px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; transition: var(--transition);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  }
366
- .ai-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
367
 
368
- /* Back to Top */
369
  .back-to-top {
370
- position: fixed; bottom: 30px; right: 30px; z-index: 999;
371
- width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
372
- color: #fff; display: flex; align-items: center; justify-content: center;
373
- font-size: 18px; cursor: pointer; opacity: 0; visibility: hidden;
374
- transition: 0.3s; box-shadow: 0 6px 20px var(--accent-glow); border: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  }
376
- .back-to-top.show { opacity: 1; visibility: visible; }
377
 
378
- /* Mobile */
379
- .ai-mobile-wrap { display: none; border-radius: var(--radius-card); margin-bottom: 20px; position: relative; }
 
 
 
 
380
 
381
  @media (max-width: 767px) {
382
- .navbar { top: 10px; border-radius: 18px; padding: 10px 16px; }
383
- .tabs-bar { top: 140px; gap: 4px; }
384
- .page-wrapper { margin-top: 210px; }
385
- .sidebar { display: none !important; }
386
- .ai-mobile-wrap { display: block; }
387
- .rich-img-card { height: 130px; }
388
- .images-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
389
- .videos-grid { grid-template-columns: 1fr; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  }
391
  @media (min-width: 768px) {
392
- .navbar { flex-wrap: nowrap; padding: 0 24px; height: 70px; }
393
- .page-wrapper { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
394
- .sidebar { order: unset; margin-top: 0; }
395
- .ai-mobile-wrap { display: none !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  }
397
  </style>
398
  </head>
399
  <body>
400
- <div class="bg-mesh">
401
- <div class="orb orb-1"></div>
402
- <div class="orb orb-2"></div>
403
- <div class="orb orb-3"></div>
404
- </div>
405
-
406
- <nav class="navbar" id="navbar">
407
- <a class="brand" href="index.html">
408
- <div class="brand-icon"><i class="fa-solid fa-bolt"></i></div>
409
- <span>SurfGO</span>
410
- </a>
411
- <div class="search-container">
412
- <form class="search-bar" id="search-form">
413
- <input id="main-input" placeholder="ابحث عن أي شيء..." type="text" autocomplete="off" />
414
- <button class="search-btn" type="submit" aria-label="بحث"><i class="fa-solid fa-magnifying-glass"></i></button>
415
- </form>
416
  </div>
417
- <div class="nav-actions">
418
- <button id="theme-toggle" aria-label="تغيير السمة"></button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  </div>
420
- </nav>
421
-
422
- <div class="tabs-bar" role="tablist">
423
- <button class="tab-pill active" data-tab="all" role="tab"><i class="fa-solid fa-globe"></i> الويب</button>
424
- <button class="tab-pill" data-tab="news" role="tab"><i class="fa-solid fa-newspaper"></i> أخبار</button>
425
- <button class="tab-pill" data-tab="images" role="tab"><i class="fa-solid fa-image"></i> صور</button>
426
- <button class="tab-pill" data-tab="videos" role="tab"><i class="fa-solid fa-play"></i> فيديو</button>
427
- </div>
428
-
429
- <div class="page-wrapper">
430
- <main class="results-area" role="main">
431
- <div id="loading-text" class="loading-spinner"><div class="spinner"></div> جاري جلب النتائج…</div>
432
-
433
- <div class="ai-mobile-wrap" id="ai-mobile-wrap">
434
- <div class="ai-glow-ring"></div>
435
- <div class="ai-widget">
436
- <div class="ai-widget-header">
437
- <div class="ai-widget-icon"><i class="fa-solid fa-robot"></i></div>
438
- <span class="ai-widget-title">إجابة الذكاء الاصطناعي</span>
439
- <span class="ai-widget-badge">AI</span>
440
- </div>
441
- <div class="ai-answer-body loading" id="ai-answer-body-mobile">
442
- <div class="ai-skeleton"></div><div class="ai-skeleton"></div><div class="ai-skeleton"></div>
443
  </div>
444
- <button class="ai-copy-btn" id="ai-copy-mobile" style="display:none"><i class="fa-regular fa-copy"></i> نسخ</button>
445
  </div>
446
- </div>
447
 
448
- <div id="results-meta" class="results-meta" style="display:none"></div>
449
- <div id="results-container"></div>
450
- </main>
451
-
452
- <aside class="sidebar">
453
- <div class="ai-widget-wrap">
454
- <div class="ai-glow-ring"></div>
455
- <div class="ai-widget">
456
- <div class="ai-widget-header">
457
- <div class="ai-widget-icon"><i class="fa-solid fa-robot"></i></div>
458
- <span class="ai-widget-title">إجابة الذكاء الاصطناعي</span>
459
- <span class="ai-widget-badge">AI</span>
460
- </div>
461
- <div class="ai-answer-body loading" id="ai-answer-body">
462
- <div class="ai-skeleton"></div><div class="ai-skeleton"></div><div class="ai-skeleton"></div>
 
 
 
 
 
463
  </div>
464
- <button class="ai-copy-btn" id="ai-copy-desktop" style="display:none"><i class="fa-regular fa-copy"></i> نسخ</button>
465
  </div>
466
- </div>
467
- </aside>
468
- </div>
469
-
470
- <button class="back-to-top" id="backToTop"><i class="fa-solid fa-arrow-up"></i></button>
471
-
472
- <script>
473
- (function() {
474
- const SEARXNG_URL = "https://cjj-on-hf-searxng.hf.space/search";
475
-
476
- // Theme
477
- const themeBtn = document.getElementById('theme-toggle');
478
- function setTheme(t) {
479
- document.documentElement.setAttribute('data-theme', t);
480
- localStorage.setItem('surfgo-theme', t);
481
- themeBtn.innerHTML = t === 'dark' ? '<i class="fa-solid fa-sun"></i>' : '<i class="fa-solid fa-moon"></i>';
482
- }
483
- setTheme(localStorage.getItem('surfgo-theme') || 'light');
484
- themeBtn.addEventListener('click', () => setTheme(document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'));
485
-
486
- // State
487
- const params = new URLSearchParams(window.location.search);
488
- let query = params.get('q') || '';
489
- let currentTab = params.get('tab') || 'all';
490
- let allResults = [];
491
-
492
- const inputEl = document.getElementById('main-input');
493
- const resultsEl = document.getElementById('results-container');
494
- const loadingEl = document.getElementById('loading-text');
495
- const metaEl = document.getElementById('results-meta');
496
-
497
- function setActiveTab(tab) {
498
- document.querySelectorAll('.tab-pill').forEach(btn => btn.classList.toggle('active', btn.dataset.tab === tab));
499
- }
500
- setActiveTab(currentTab);
501
-
502
- // Helpers
503
- function escapeHTML(str) { return str ? str.replace(/[&<>'"]/g, t => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', "'": '&#39;', '"': '&quot;' }[t] || t)) : ''; }
504
- function getDomain(url) { try { return new URL(url).hostname.replace('www.', ''); } catch { return url || ''; } }
505
- function proxyImage(url) { return url && !url.startsWith('data:') ? `https://wsrv.nl/?url=${encodeURIComponent(url)}&output=webp&maxage=7d&default=placeholder` : url; }
506
- function faviconURL(domain) { return `https://www.google.com/s2/favicons?domain=${domain}&sz=32`; }
507
- function getBestImageUrl(r) {
508
- const candidates = [r.img_src, r.thumbnail_src, r.thumbnail, r.image, r.url, r.img];
509
- for (const c of candidates) if (c && typeof c === 'string' && c.match(/\.(jpg|jpeg|png|gif|webp)/i)) return c;
510
- return candidates.find(c => c && typeof c === 'string' && c.startsWith('http'));
511
- }
512
-
513
- // AI with copy
514
- let currentAIAnswer = '';
515
- function runAI(q, results) {
516
- const desktop = document.getElementById('ai-answer-body');
517
- const mobile = document.getElementById('ai-answer-body-mobile');
518
- const copyDesktop = document.getElementById('ai-copy-desktop');
519
- const copyMobile = document.getElementById('ai-copy-mobile');
520
- [desktop, mobile].forEach(el => { if(el) { el.classList.add('loading'); el.innerHTML = '<div class="ai-skeleton"></div><div class="ai-skeleton"></div>'; } });
521
- [copyDesktop, copyMobile].forEach(el => { if(el) el.style.display = 'none'; });
522
-
523
- setTimeout(() => {
524
- currentAIAnswer = results[0] ? `بناءً على البحث، ${results[0].content.slice(0, 200)}...` : 'لا توجد معلومات كافية.';
525
- [desktop, mobile].forEach(el => { if(el) { el.classList.remove('loading'); el.textContent = currentAIAnswer; } });
526
- [copyDesktop, copyMobile].forEach(el => { if(el) el.style.display = 'inline-flex'; });
527
- }, 1200);
528
- }
529
- document.getElementById('ai-copy-desktop')?.addEventListener('click', () => navigator.clipboard.writeText(currentAIAnswer));
530
- document.getElementById('ai-copy-mobile')?.addEventListener('click', () => navigator.clipboard.writeText(currentAIAnswer));
531
-
532
- // Intersection Observer for animations
533
- const observer = new IntersectionObserver((entries) => {
534
- entries.forEach(entry => {
535
- if (entry.isIntersecting) {
536
- entry.target.classList.add('visible');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  }
538
- });
539
- }, { threshold: 0.1, rootMargin: '0px 0px -20px 0px' });
540
-
541
- function observeNewElements() {
542
- document.querySelectorAll('.search-result, .image-card, .video-card, .rich-graph-container').forEach(el => observer.observe(el));
543
- }
544
-
545
- // Back to top
546
- const backBtn = document.getElementById('backToTop');
547
- window.addEventListener('scroll', () => { backBtn.classList.toggle('show', window.scrollY > 400); });
548
- backBtn.addEventListener('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }));
549
-
550
- // Search
551
- async function performSearch(q, tab = 'all') {
552
- resultsEl.innerHTML = ''; metaEl.style.display = 'none';
553
- loadingEl.style.display = 'flex';
554
- const category = { all: 'general', news: 'news', images: 'images', videos: 'videos' }[tab] || 'general';
555
-
556
- try {
557
- const response = await fetch(`${SEARXNG_URL}?q=${encodeURIComponent(q)}&format=json&categories=${category}&language=ar&safesearch=1`, { signal: AbortSignal.timeout(15000) });
558
- const data = await response.json();
559
- allResults = data.results || [];
560
- loadingEl.style.display = 'none';
561
-
562
- if (allResults.length > 0) {
563
- metaEl.style.display = 'flex'; metaEl.innerHTML = `تقريباً <span style="color:var(--accent);font-weight:700">${allResults.length}</span> نتيجة`;
564
- runAI(q, allResults);
565
-
566
- if (tab === 'images') renderImages(allResults);
567
- else if (tab === 'videos') renderVideos(allResults);
568
- else renderWeb(q, allResults);
569
- observeNewElements();
570
- } else {
571
- resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-face-frown"></i><p>لا توجد نتائج لـ "${escapeHTML(q)}"</p></div>`;
 
 
 
 
 
 
572
  }
573
- } catch (error) {
574
- loadingEl.style.display = 'none';
575
- resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-triangle-exclamation"></i><p>تعذّر الاتصال بالمحرك.</p></div>`;
576
- }
577
- }
578
-
579
- function renderWeb(q, results) {
580
- resultsEl.innerHTML = '';
581
- let mainCard = results.find(r => r.url.includes('wikipedia.org')) || results.find(r => !r.url.includes('youtube.com'));
582
- const ytResults = results.filter(r => r.url.includes('youtube.com/watch')).slice(0, 4);
583
-
584
- const richContainer = document.createElement('div');
585
- richContainer.className = 'rich-graph-container';
586
-
587
- const imagesRow = document.createElement('div');
588
- imagesRow.className = 'rich-images-row';
589
- imagesRow.innerHTML = '<div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div>';
590
- richContainer.appendChild(imagesRow);
591
-
592
- fetch(`${SEARXNG_URL}?q=${encodeURIComponent(q)}&format=json&categories=images&language=ar`)
593
- .then(res => res.json())
594
- .then(data => {
595
- if (data.results) {
596
- const valid = data.results.filter(r => getBestImageUrl(r)).slice(0, 6);
597
- if (valid.length) {
598
- imagesRow.innerHTML = valid.map(r => {
599
- const img = proxyImage(getBestImageUrl(r));
600
- return `<a href="${escapeHTML(r.url||'#')}" target="_blank" class="rich-img-card">
601
- <img src="${escapeHTML(img)}" alt="صورة" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" />
602
- <div class="img-error-overlay"><i class="fa-solid fa-image-slash"></i> تعذّر التحميل</div>
603
- </a>`;
604
- }).join('');
605
- } else imagesRow.style.display = 'none';
606
- }
607
- }).catch(() => imagesRow.style.display = 'none');
608
-
609
- if (mainCard) {
610
- const dmn = getDomain(mainCard.url);
611
- richContainer.innerHTML += `
612
- <div class="wiki-card search-result">
613
- <div class="wiki-header"><img src="${faviconURL(dmn)}" style="width:26px;height:26px;border-radius:6px" /><div><div class="wiki-domain">${escapeHTML(dmn)}</div><a href="${escapeHTML(mainCard.url)}" target="_blank" class="wiki-url">${escapeHTML(mainCard.url)}</a></div></div>
614
- <a href="${escapeHTML(mainCard.url)}" target="_blank" class="result-title" style="font-size:20px">${escapeHTML(mainCard.title)}</a>
615
- <p class="result-snippet">${escapeHTML(mainCard.content)}</p>
616
- </div>`;
617
- }
618
- if (ytResults.length) {
619
- richContainer.innerHTML += `<h3 class="rich-section-title">فيديوهات <i class="fa-solid fa-chevron-left"></i></h3><div class="rich-videos-row">${ytResults.map(r => {
620
- const vidMatch = r.url.match(/v=([^&]+)/);
621
- const thumb = vidMatch ? `https://img.youtube.com/vi/${vidMatch[1]}/mqdefault.jpg` : proxyImage(r.thumbnail);
622
- return `<a href="${escapeHTML(r.url)}" target="_blank" class="rich-vid-card"><div class="rich-vid-thumb"><img src="${escapeHTML(thumb)}" loading="lazy" /><div class="rich-vid-play"><i class="fa-solid fa-play"></i></div></div><div class="rich-vid-info"><div class="rich-vid-title">${escapeHTML(r.title)}</div><div class="rich-vid-meta"><img src="${faviconURL('youtube.com')}" /> YouTube</div></div></a>`;
623
- }).join('')}</div>`;
624
- }
625
- richContainer.innerHTML += `<h3 class="rich-section-title">استكشف ${escapeHTML(q)} بالتفصيل</h3><div class="discover-bubbles">${['جميلة جدا','أنواع','صور','فيديوهات','معلومات'].map(d => `<button class="discover-bubble" data-query="${escapeHTML(d+' '+q)}"><i class="fa-solid fa-magnifying-glass"></i> ${escapeHTML(d+' '+q)}</button>`).join('')}</div>`;
626
- resultsEl.appendChild(richContainer);
627
-
628
- richContainer.querySelectorAll('.discover-bubble').forEach(btn => {
629
- btn.addEventListener('click', () => {
630
- inputEl.value = btn.dataset.query;
631
- document.getElementById('search-form').dispatchEvent(new Event('submit'));
632
  });
633
- });
634
 
635
- const used = new Set([mainCard?.url, ...ytResults.map(r=>r.url)]);
636
- results.filter(r => !used.has(r.url)).forEach(r => {
637
- const domain = getDomain(r.url);
638
- const article = document.createElement('article');
639
- article.className = 'search-result';
640
- article.innerHTML = `<div class="favicon-wrap"><img src="${faviconURL(domain)}" loading="lazy" /></div><div class="result-content"><div class="result-domain"><i class="fa-solid fa-link"></i> ${escapeHTML(domain)}</div><a class="result-title" href="${escapeHTML(r.url)}" target="_blank">${escapeHTML(r.title)}</a><p class="result-snippet">${escapeHTML(r.content)}</p></div>`;
641
- resultsEl.appendChild(article);
642
- });
643
- }
644
 
645
- function renderImages(results) {
646
- const wrap = document.createElement('div'); wrap.className = 'images-grid';
647
- results.forEach(r => {
648
- const raw = getBestImageUrl(r); if(!raw) return;
649
- wrap.innerHTML += `<div class="image-card"><a class="image-card-link" href="${escapeHTML(r.url)}" target="_blank"><img src="${escapeHTML(proxyImage(raw))}" alt="${escapeHTML(r.title)}" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" /><div class="img-error-overlay"><i class="fa-solid fa-image-slash"></i> تعذّر</div></a><div class="image-info">${escapeHTML(r.title)}</div></div>`;
650
- });
651
- resultsEl.appendChild(wrap);
652
- }
653
 
654
- function renderVideos(results) {
655
- const wrap = document.createElement('div'); wrap.className = 'videos-grid';
656
- results.forEach(r => {
657
- wrap.innerHTML += `<div class="video-card"><a href="${escapeHTML(r.url)}" target="_blank" class="video-thumb-wrap"><img src="${proxyImage(r.thumbnail)}" loading="lazy" /><div class="play-overlay"><i class="fa-solid fa-play"></i></div></a><div class="video-details"><a class="video-title" href="${escapeHTML(r.url)}">${escapeHTML(r.title)}</a></div></div>`;
 
 
 
 
 
 
 
 
 
 
658
  });
659
- resultsEl.appendChild(wrap);
660
- }
661
-
662
- if (query) { inputEl.value = query; performSearch(query, currentTab); }
663
- document.getElementById('search-form').addEventListener('submit', (e) => {
664
- e.preventDefault(); const q = inputEl.value.trim(); if(!q) return;
665
- window.history.pushState({}, '', `?q=${encodeURIComponent(q)}&tab=${currentTab}`);
666
- query = q; performSearch(q, currentTab);
667
- });
668
- document.querySelectorAll('.tab-pill').forEach(btn => {
669
- btn.addEventListener('click', () => {
670
- const tab = btn.dataset.tab; if(tab===currentTab) return;
671
- currentTab = tab; setActiveTab(tab);
672
- window.history.pushState({}, '', `?q=${encodeURIComponent(query)}&tab=${tab}`);
673
- if(query) performSearch(query, tab);
674
  });
675
- });
676
- })();
677
- </script>
678
  </body>
679
  </html>
 
23
  --text-main: #12132a;
24
  --text-sub: #6b7280;
25
  --text-faint: #9ca3af;
26
+ --shadow-card: 0 2px 12px rgba(91, 94, 244, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
27
+ --shadow-hover: 0 10px 32px rgba(91, 94, 244, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
28
  --radius-nav: 24px;
29
  --radius-card: 20px;
30
  --radius-pill: 100px;
 
50
  --shadow-hover: 0 12px 40px rgba(130, 133, 255, 0.18);
51
  }
52
 
53
+ * {
54
+ margin: 0;
55
+ padding: 0;
56
+ box-sizing: border-box;
57
+ }
58
+
59
  body {
60
  font-family: 'Tajawal', sans-serif;
61
  background: var(--bg-base);
 
66
  position: relative;
67
  }
68
 
69
+ /* خلفية متحركة */
70
  .bg-mesh {
71
+ position: fixed;
72
+ inset: 0;
73
+ z-index: 0;
74
+ pointer-events: none;
75
+ overflow: hidden;
76
  }
77
  .orb {
78
+ position: absolute;
79
+ border-radius: 50%;
80
+ filter: blur(80px);
81
+ opacity: 0.4;
82
  animation: float 20s ease-in-out infinite alternate;
83
  }
84
  .orb-1 {
85
+ width: 60vw;
86
+ height: 60vw;
87
+ background: radial-gradient(circle, rgba(91, 94, 244, 0.18) 0%, transparent 70%);
88
+ top: -15%;
89
+ right: -10%;
90
  }
91
  .orb-2 {
92
+ width: 50vw;
93
+ height: 50vw;
94
+ background: radial-gradient(circle, rgba(224, 66, 122, 0.14) 0%, transparent 70%);
95
+ bottom: -10%;
96
+ left: -5%;
97
  }
98
  .orb-3 {
99
+ width: 35vw;
100
+ height: 35vw;
101
+ background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
102
+ top: 60%;
103
+ left: 60%;
104
  }
105
  @keyframes float {
106
+ 0% {
107
+ transform: translate(0, 0) scale(1);
108
+ }
109
+ 100% {
110
+ transform: translate(5%, 3%) scale(1.08);
111
+ }
112
  }
113
 
114
+ /* شريط التنقل */
115
  .navbar {
116
+ position: fixed;
117
+ top: 16px;
118
+ left: 50%;
119
+ transform: translateX(-50%);
120
+ width: 95%;
121
+ max-width: 1280px;
122
+ min-height: 70px;
123
+ background: var(--bg-nav);
124
+ backdrop-filter: var(--glass-blur);
125
  -webkit-backdrop-filter: var(--glass-blur);
126
  border: 1px solid var(--border);
127
  border-radius: var(--radius-nav);
128
+ display: flex;
129
+ flex-wrap: wrap;
130
+ align-items: center;
131
+ justify-content: space-between;
132
+ padding: 10px 22px;
133
  z-index: 1000;
134
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
135
+ gap: 14px;
136
+ transition: background 0.4s, border-color 0.4s, box-shadow 0.3s;
 
 
137
  }
138
 
139
  .brand {
140
+ font-family: 'Syne', sans-serif;
141
+ font-weight: 800;
142
+ font-size: 22px;
143
+ text-decoration: none;
144
+ color: var(--text-main);
145
+ display: flex;
146
+ align-items: center;
147
+ gap: 10px;
148
+ letter-spacing: -0.02em;
149
+ flex-shrink: 0;
150
  transition: transform 0.2s;
151
  }
152
+ .brand:hover {
153
+ transform: scale(1.03);
154
+ }
155
  .brand-icon {
156
+ width: 40px;
157
+ height: 40px;
158
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
159
+ border-radius: 12px;
160
+ display: flex;
161
+ align-items: center;
162
+ justify-content: center;
163
+ color: #fff;
164
+ font-size: 18px;
165
+ box-shadow: 0 6px 18px var(--accent-glow);
166
  }
167
 
168
+ .search-container {
169
+ flex: 1;
170
+ max-width: 600px;
171
+ width: 100%;
172
+ }
173
  .search-bar {
174
+ display: flex;
175
+ align-items: center;
176
+ background: var(--bg-input);
177
+ border: 2px solid transparent;
178
+ border-radius: var(--radius-pill);
179
+ padding: 4px 4px 4px 20px;
180
+ transition: var(--transition);
181
+ width: 100%;
182
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
183
  }
184
  .search-bar:focus-within {
185
+ border-color: var(--accent);
186
+ background: var(--bg-input-focus);
187
+ box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 16px rgba(0, 0, 0, 0.04);
188
  transform: translateY(-1px);
189
  }
190
  .search-bar input {
191
+ flex: 1;
192
+ background: transparent;
193
+ border: none;
194
+ padding: 10px 0;
195
+ color: var(--text-main);
196
+ font-family: 'Tajawal', sans-serif;
197
+ font-size: 15px;
198
+ min-width: 0;
199
  }
200
  .search-btn {
201
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
202
+ border: none;
203
+ color: #fff;
204
+ cursor: pointer;
205
+ width: 44px;
206
+ height: 40px;
207
+ border-radius: var(--radius-pill);
208
+ display: flex;
209
+ align-items: center;
210
+ justify-content: center;
211
+ font-size: 15px;
212
+ transition: var(--transition);
213
  box-shadow: 0 4px 14px var(--accent-glow);
214
  }
215
+ .search-btn:hover {
216
+ transform: scale(1.06);
217
+ box-shadow: 0 6px 18px var(--accent-glow);
218
+ }
219
 
220
  #theme-toggle {
221
+ background: var(--bg-input);
222
+ border: 2px solid var(--border);
223
+ color: var(--text-sub);
224
+ cursor: pointer;
225
+ width: 42px;
226
+ height: 42px;
227
+ border-radius: 50%;
228
+ display: flex;
229
+ align-items: center;
230
+ justify-content: center;
231
+ font-size: 16px;
232
+ transition: var(--transition);
233
+ }
234
+ #theme-toggle:hover {
235
+ border-color: var(--accent);
236
+ color: var(--accent);
237
+ transform: rotate(180deg);
238
  }
 
239
 
240
+ /* علامات التبويب */
241
  .tabs-bar {
242
+ position: fixed;
243
+ top: 110px;
244
+ left: 50%;
245
+ transform: translateX(-50%);
246
+ width: 95%;
247
+ max-width: 1280px;
248
+ display: flex;
249
+ gap: 8px;
250
+ z-index: 999;
251
+ overflow-x: auto;
252
+ padding: 6px 10px;
253
+ scrollbar-width: none;
254
+ backdrop-filter: blur(10px);
255
+ background: rgba(255, 255, 255, 0.25);
256
+ border: 1px solid var(--border);
257
+ border-radius: 40px;
258
+ }
259
+ [data-theme="dark"] .tabs-bar {
260
+ background: rgba(18, 20, 46, 0.35);
261
  }
 
262
  .tab-pill {
263
+ padding: 8px 18px;
264
+ border-radius: var(--radius-pill);
265
+ background: var(--bg-card);
266
+ border: 1.5px solid var(--border);
267
+ color: var(--text-sub);
268
+ font-family: 'Tajawal', sans-serif;
269
+ font-size: 13.5px;
270
+ font-weight: 500;
271
+ cursor: pointer;
272
+ transition: var(--transition);
273
+ display: flex;
274
+ align-items: center;
275
+ gap: 7px;
276
+ white-space: nowrap;
277
+ box-shadow: var(--shadow-card);
278
+ }
279
+ .tab-pill:hover {
280
+ border-color: var(--border-hover);
281
+ color: var(--accent);
282
+ transform: translateY(-1px);
283
  }
 
284
  .tab-pill.active {
285
+ background: var(--accent);
286
+ color: #fff;
287
+ border-color: var(--accent);
288
  box-shadow: 0 6px 20px var(--accent-glow);
289
  font-weight: 600;
290
  }
291
 
 
292
  .page-wrapper {
293
+ position: relative;
294
+ z-index: 1;
295
+ max-width: 1280px;
296
+ margin: 190px auto 60px;
297
+ padding: 0 20px;
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: 28px;
301
+ }
302
+ .results-area {
303
+ min-width: 0;
304
+ width: 100%;
305
  }
 
306
 
 
307
  .loading-spinner {
308
+ display: flex;
309
+ align-items: center;
310
+ gap: 10px;
311
+ color: var(--text-sub);
312
+ font-size: 14px;
313
+ padding: 24px;
314
+ justify-content: center;
315
  }
316
  .spinner {
317
+ width: 20px;
318
+ height: 20px;
319
+ border: 3px solid var(--border);
320
+ border-top-color: var(--accent);
321
+ border-radius: 50%;
322
+ animation: spin 0.7s linear infinite;
323
+ }
324
+ @keyframes spin {
325
+ to {
326
+ transform: rotate(360deg);
327
+ }
328
  }
 
329
 
330
+ /* تأثيرات الظهور */
331
+ .search-result,
332
+ .image-card,
333
+ .video-card,
334
+ .rich-graph-container {
335
+ opacity: 0;
336
+ transform: translateY(20px);
337
+ transition: opacity 0.5s ease, transform 0.5s ease;
338
  }
339
+ .search-result.visible,
340
+ .image-card.visible,
341
+ .video-card.visible,
342
+ .rich-graph-container.visible {
343
+ opacity: 1;
344
+ transform: translateY(0);
345
  }
346
 
347
  .search-result {
348
+ background: var(--bg-card);
349
+ border: 1.5px solid var(--border);
350
+ border-radius: var(--radius-card);
351
+ padding: 20px 22px;
352
+ margin-bottom: 14px;
353
+ transition: var(--transition);
354
+ box-shadow: var(--shadow-card);
355
+ display: flex;
356
+ gap: 16px;
357
+ align-items: flex-start;
358
  backdrop-filter: blur(5px);
359
  }
360
  .search-result:hover {
361
+ border-color: var(--border-hover);
362
+ box-shadow: var(--shadow-hover);
363
  transform: translateY(-3px);
364
  }
365
  .favicon-wrap {
366
+ width: 28px;
367
+ height: 28px;
368
+ border-radius: 8px;
369
+ overflow: hidden;
370
+ flex-shrink: 0;
371
+ margin-top: 2px;
372
+ background: var(--bg-input);
373
+ display: flex;
374
+ align-items: center;
375
+ justify-content: center;
376
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
377
+ }
378
+ .favicon-wrap img {
379
+ width: 18px;
380
+ height: 18px;
381
+ object-fit: contain;
382
+ }
383
+ .fallback-icon {
384
+ color: var(--text-faint);
385
+ font-size: 13px;
386
+ }
387
+ .result-content {
388
+ flex: 1;
389
+ min-width: 0;
390
+ }
391
+ .result-domain {
392
+ font-size: 12px;
393
+ color: var(--text-faint);
394
+ margin-bottom: 5px;
395
+ display: flex;
396
+ align-items: center;
397
+ gap: 5px;
398
+ }
399
  .result-title {
400
+ font-size: 17px;
401
+ font-weight: 700;
402
+ color: var(--accent);
403
+ text-decoration: none;
404
+ display: inline-block;
405
+ margin-bottom: 8px;
406
+ line-height: 1.4;
407
+ transition: color 0.2s;
408
+ }
409
+ .result-title:hover {
410
+ color: var(--accent-2);
411
+ text-decoration: underline;
412
+ }
413
+ .result-snippet {
414
+ font-size: 14px;
415
+ color: var(--text-sub);
416
+ line-height: 1.7;
417
  }
 
 
418
 
419
+ /* ===== الرسم البياني الغني ===== */
420
+ .rich-graph-container {
421
+ display: flex;
422
+ flex-direction: column;
423
+ gap: 22px;
424
+ margin-bottom: 28px;
425
+ }
426
  .rich-images-row {
427
+ display: flex;
428
+ gap: 10px;
429
+ overflow-x: auto;
430
+ scrollbar-width: none;
431
+ padding-bottom: 8px;
432
+ min-height: 170px;
433
+ align-items: center;
434
  }
435
  .rich-img-card {
436
+ flex-shrink: 0;
437
+ height: 170px;
438
+ border-radius: 16px;
439
+ overflow: hidden;
440
+ background: var(--bg-input);
441
+ border: 1px solid var(--border);
442
+ box-shadow: var(--shadow-card);
443
+ transition: var(--transition);
444
+ position: relative;
445
+ }
446
+ .rich-img-card:hover {
447
+ transform: translateY(-5px) scale(1.02);
448
+ box-shadow: var(--shadow-hover);
449
+ }
450
+ .rich-img-card img {
451
+ height: 100%;
452
+ width: auto;
453
+ object-fit: cover;
454
+ display: block;
455
  }
 
 
456
  .img-error-overlay {
457
+ position: absolute;
458
+ inset: 0;
459
+ display: none;
460
+ align-items: center;
461
+ justify-content: center;
462
+ background: var(--bg-input);
463
+ color: var(--text-faint);
464
+ flex-direction: column;
465
+ gap: 6px;
466
+ font-size: 13px;
467
+ }
468
+ .img-error-overlay i {
469
+ font-size: 24px;
470
+ }
471
+ .wiki-card {
472
+ margin-bottom: 0 !important;
473
+ }
474
+ .wiki-header {
475
+ display: flex;
476
+ align-items: center;
477
+ gap: 12px;
478
+ margin-bottom: 10px;
479
+ }
480
+ .wiki-domain {
481
+ font-size: 14px;
482
+ font-weight: 700;
483
+ color: var(--text-main);
484
+ }
485
+ .wiki-url {
486
+ font-size: 12px;
487
+ color: var(--text-faint);
488
+ text-decoration: none;
489
  }
 
 
 
 
 
 
490
  .rich-section-title {
491
+ font-size: 20px;
492
+ font-weight: 700;
493
+ margin: 12px 0 8px;
494
+ color: var(--text-main);
495
+ display: flex;
496
+ align-items: center;
497
+ gap: 10px;
498
+ }
499
+ .rich-section-title i {
500
+ font-size: 15px;
501
+ color: var(--text-faint);
502
+ margin-right: auto;
503
+ }
504
+ .rich-videos-row {
505
+ display: flex;
506
+ gap: 14px;
507
+ overflow-x: auto;
508
+ padding-bottom: 12px;
509
+ scrollbar-width: none;
510
  }
 
 
 
511
  .rich-vid-card {
512
+ flex: 0 0 250px;
513
+ text-decoration: none;
514
+ background: var(--bg-card);
515
+ border-radius: 16px;
516
+ overflow: hidden;
517
+ border: 1px solid var(--border);
518
+ box-shadow: var(--shadow-card);
519
+ transition: var(--transition);
520
+ }
521
+ .rich-vid-card:hover {
522
+ transform: translateY(-5px);
523
+ box-shadow: var(--shadow-hover);
524
+ border-color: var(--accent);
525
+ }
526
+ .rich-vid-thumb {
527
+ height: 140px;
528
+ position: relative;
529
+ background: var(--bg-input);
530
+ }
531
+ .rich-vid-thumb img {
532
+ width: 100%;
533
+ height: 100%;
534
+ object-fit: cover;
535
  }
 
 
 
536
  .rich-vid-play {
537
+ position: absolute;
538
+ bottom: 12px;
539
+ left: 12px;
540
+ background: rgba(0, 0, 0, 0.75);
541
+ backdrop-filter: blur(6px);
542
+ color: #fff;
543
+ width: 36px;
544
+ height: 36px;
545
+ border-radius: 50%;
546
+ display: flex;
547
+ align-items: center;
548
+ justify-content: center;
549
+ font-size: 13px;
550
+ transition: 0.2s;
551
+ }
552
+ .rich-vid-card:hover .rich-vid-play {
553
+ background: var(--accent);
554
+ }
555
+ .rich-vid-info {
556
+ padding: 14px;
557
  }
 
 
558
  .rich-vid-title {
559
+ font-size: 14px;
560
+ font-weight: 600;
561
+ color: var(--text-main);
562
+ display: -webkit-box;
563
+ -webkit-line-clamp: 2;
564
+ -webkit-box-orient: vertical;
565
+ overflow: hidden;
566
+ line-height: 1.5;
567
+ }
568
+ .rich-vid-meta {
569
+ font-size: 12px;
570
+ color: var(--text-faint);
571
+ margin-top: 8px;
572
+ display: flex;
573
+ align-items: center;
574
+ gap: 6px;
575
+ }
576
+ .discover-bubbles {
577
+ display: flex;
578
+ flex-direction: column;
579
+ gap: 10px;
580
  }
 
 
 
581
  .discover-bubble {
582
+ background: var(--bg-card);
583
+ border: 1.5px solid var(--border);
584
+ border-radius: 60px;
585
+ padding: 15px 24px;
586
+ display: flex;
587
+ align-items: center;
588
+ gap: 14px;
589
+ cursor: pointer;
590
+ transition: var(--transition);
591
+ font-family: 'Tajawal', sans-serif;
592
+ font-size: 16px;
593
+ font-weight: 500;
594
+ color: var(--text-main);
595
+ text-align: right;
596
+ box-shadow: var(--shadow-card);
597
+ backdrop-filter: blur(5px);
598
+ width: 100%;
599
+ }
600
+ .discover-bubble i {
601
+ color: var(--text-faint);
602
+ font-size: 16px;
603
+ transition: 0.2s;
604
  }
 
605
  .discover-bubble:hover {
606
+ background: var(--bg-input-focus);
607
+ border-color: var(--accent);
608
+ color: var(--accent);
609
+ transform: translateX(-6px);
610
+ box-shadow: var(--shadow-hover);
611
+ }
612
+ .discover-bubble:hover i {
613
+ color: var(--accent);
614
  }
 
615
 
616
+ /* شبكات الصور والفيديو */
617
  .images-grid {
618
+ display: grid;
619
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
620
+ gap: 16px;
621
+ width: 100%;
622
  }
623
  .image-card {
624
+ background: var(--bg-card);
625
+ border: 1.5px solid var(--border);
626
+ border-radius: var(--radius-card);
627
+ overflow: hidden;
628
+ transition: var(--transition);
629
+ box-shadow: var(--shadow-card);
630
+ display: flex;
631
+ flex-direction: column;
632
+ }
633
+ .image-card:hover {
634
+ border-color: var(--border-hover);
635
+ box-shadow: var(--shadow-hover);
636
+ transform: translateY(-5px);
637
+ }
638
+ .image-card-link {
639
+ display: block;
640
+ width: 100%;
641
+ height: 190px;
642
+ overflow: hidden;
643
+ background: var(--bg-input);
644
+ position: relative;
645
+ }
646
+ .image-card-link img {
647
+ width: 100%;
648
+ height: 100%;
649
+ object-fit: cover;
650
+ transition: transform 0.4s ease;
651
+ }
652
+ .image-card:hover .image-card-link img {
653
+ transform: scale(1.08);
654
+ }
655
+ .image-info {
656
+ padding: 10px 14px;
657
+ font-size: 13px;
658
+ color: var(--text-sub);
659
+ white-space: nowrap;
660
+ overflow: hidden;
661
+ text-overflow: ellipsis;
662
  }
 
 
 
 
 
 
 
663
  .videos-grid {
664
+ display: grid;
665
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
666
+ gap: 22px;
667
+ width: 100%;
668
  }
669
  .video-card {
670
+ background: var(--bg-card);
671
+ border: 1.5px solid var(--border);
672
+ border-radius: var(--radius-card);
673
+ overflow: hidden;
674
+ transition: var(--transition);
675
+ box-shadow: var(--shadow-card);
676
+ }
677
+ .video-card:hover {
678
+ transform: translateY(-4px);
679
+ box-shadow: var(--shadow-hover);
680
+ }
681
+ .video-thumb-wrap {
682
+ position: relative;
683
+ width: 100%;
684
+ height: 190px;
685
+ background: var(--bg-input);
686
+ display: block;
687
+ overflow: hidden;
688
+ }
689
+ .video-thumb-wrap img {
690
+ width: 100%;
691
+ height: 100%;
692
+ object-fit: cover;
693
+ transition: 0.3s;
694
  }
 
 
 
695
  .play-overlay {
696
+ position: absolute;
697
+ top: 50%;
698
+ left: 50%;
699
+ transform: translate(-50%, -50%);
700
+ width: 50px;
701
+ height: 50px;
702
+ background: rgba(91, 94, 244, 0.9);
703
+ color: white;
704
+ border-radius: 50%;
705
+ display: flex;
706
+ align-items: center;
707
+ justify-content: center;
708
+ font-size: 18px;
709
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
710
+ transition: var(--transition);
711
+ z-index: 2;
712
+ }
713
+ .video-details {
714
+ padding: 16px;
715
+ }
716
+ .video-title {
717
+ font-size: 15px;
718
+ font-weight: 700;
719
+ color: var(--text-main);
720
+ text-decoration: none;
721
+ display: block;
722
+ line-height: 1.5;
723
  }
 
 
724
 
725
+ /* مساعد AI */
726
+ .sidebar {
727
+ width: 100%;
728
+ order: 2;
729
+ margin-top: 12px;
730
+ }
731
+ .ai-widget-wrap {
732
+ position: relative;
733
+ border-radius: var(--radius-card);
734
+ }
735
  .ai-glow-ring {
736
+ position: absolute;
737
+ inset: -3px;
738
+ border-radius: calc(var(--radius-card) + 3px);
739
  background: conic-gradient(from var(--angle, 0deg), var(--accent), var(--accent-2), #a78bfa, var(--accent), var(--accent-2), var(--accent));
740
+ z-index: 0;
741
+ animation: spin-glow 5s linear infinite;
742
+ filter: blur(1.5px);
743
+ }
744
+ @property --angle {
745
+ syntax: '<angle>';
746
+ initial-value: 0deg;
747
+ inherits: false;
748
+ }
749
+ @keyframes spin-glow {
750
+ to {
751
+ --angle: 360deg;
752
+ }
753
  }
 
 
754
  .ai-widget {
755
+ position: relative;
756
+ z-index: 1;
757
+ background: var(--bg-card);
758
+ border-radius: var(--radius-card);
759
+ padding: 20px 20px 18px;
760
+ box-shadow: var(--shadow-card);
761
+ backdrop-filter: blur(5px);
762
+ }
763
+ .ai-widget-header {
764
+ display: flex;
765
+ align-items: center;
766
+ gap: 10px;
767
+ margin-bottom: 16px;
768
  }
 
769
  .ai-widget-icon {
770
+ width: 34px;
771
+ height: 34px;
772
+ border-radius: 10px;
773
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
774
+ display: flex;
775
+ align-items: center;
776
+ justify-content: center;
777
+ color: #fff;
778
+ font-size: 14px;
779
+ }
780
+ .ai-widget-badge {
781
+ margin-right: auto;
782
+ font-size: 11px;
783
+ padding: 3px 10px;
784
+ border-radius: 20px;
785
+ background: var(--accent-glow);
786
+ color: var(--accent);
787
+ }
788
+ .ai-answer-body {
789
+ font-size: 14px;
790
+ color: var(--text-sub);
791
+ line-height: 1.8;
792
+ min-height: 60px;
793
+ }
794
+ .ai-skeleton {
795
+ height: 12px;
796
+ border-radius: 6px;
797
+ background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%);
798
+ background-size: 200% 100%;
799
+ animation: shimmer 1.4s ease-in-out infinite;
800
+ margin-bottom: 10px;
801
+ }
802
+ @keyframes shimmer {
803
+ 0% {
804
+ background-position: 200% 0;
805
+ }
806
+ 100% {
807
+ background-position: -200% 0;
808
+ }
809
+ }
810
+ .ai-sources {
811
+ margin-top: 12px;
812
+ display: flex;
813
+ flex-wrap: wrap;
814
+ gap: 6px;
815
+ }
816
+ .ai-source-chip {
817
+ font-size: 11px;
818
+ padding: 3px 10px;
819
+ border-radius: 20px;
820
+ background: var(--bg-input);
821
+ border: 1px solid var(--border);
822
+ color: var(--text-faint);
823
+ text-decoration: none;
824
+ display: flex;
825
+ align-items: center;
826
+ gap: 5px;
827
+ transition: var(--transition);
828
+ }
829
+ .ai-source-chip:hover {
830
+ border-color: var(--accent);
831
+ color: var(--accent);
832
  }
 
 
 
 
833
  .ai-copy-btn {
834
+ margin-top: 14px;
835
+ padding: 8px 16px;
836
+ background: var(--bg-input);
837
+ border: 1px solid var(--border);
838
+ border-radius: 30px;
839
+ cursor: pointer;
840
+ font-size: 12px;
841
+ color: var(--text-sub);
842
+ display: inline-flex;
843
+ align-items: center;
844
+ gap: 6px;
845
+ transition: var(--transition);
846
+ }
847
+ .ai-copy-btn:hover {
848
+ background: var(--accent);
849
+ color: #fff;
850
+ border-color: var(--accent);
851
+ }
852
+ .ai-widget-footer {
853
+ font-size: 10.5px;
854
+ color: var(--text-faint);
855
+ margin-top: 12px;
856
+ padding-top: 10px;
857
+ border-top: 1px solid var(--border);
858
+ display: flex;
859
+ align-items: center;
860
+ gap: 5px;
861
  }
 
862
 
 
863
  .back-to-top {
864
+ position: fixed;
865
+ bottom: 30px;
866
+ right: 30px;
867
+ z-index: 999;
868
+ width: 46px;
869
+ height: 46px;
870
+ border-radius: 50%;
871
+ background: var(--accent);
872
+ color: #fff;
873
+ display: flex;
874
+ align-items: center;
875
+ justify-content: center;
876
+ font-size: 18px;
877
+ cursor: pointer;
878
+ opacity: 0;
879
+ visibility: hidden;
880
+ transition: 0.3s;
881
+ box-shadow: 0 6px 20px var(--accent-glow);
882
+ border: none;
883
+ }
884
+ .back-to-top.show {
885
+ opacity: 1;
886
+ visibility: visible;
887
  }
 
888
 
889
+ .ai-mobile-wrap {
890
+ display: none;
891
+ border-radius: var(--radius-card);
892
+ margin-bottom: 20px;
893
+ position: relative;
894
+ }
895
 
896
  @media (max-width: 767px) {
897
+ .navbar {
898
+ top: 10px;
899
+ border-radius: 18px;
900
+ padding: 10px 16px;
901
+ }
902
+ .tabs-bar {
903
+ top: 140px;
904
+ gap: 4px;
905
+ }
906
+ .page-wrapper {
907
+ margin-top: 210px;
908
+ }
909
+ .sidebar {
910
+ display: none !important;
911
+ }
912
+ .ai-mobile-wrap {
913
+ display: block;
914
+ }
915
+ .rich-img-card {
916
+ height: 130px;
917
+ }
918
+ .images-grid {
919
+ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
920
+ }
921
+ .videos-grid {
922
+ grid-template-columns: 1fr;
923
+ }
924
  }
925
  @media (min-width: 768px) {
926
+ .navbar {
927
+ flex-wrap: nowrap;
928
+ padding: 0 24px;
929
+ height: 70px;
930
+ }
931
+ .page-wrapper {
932
+ display: grid;
933
+ grid-template-columns: 1fr 320px;
934
+ gap: 28px;
935
+ }
936
+ .sidebar {
937
+ order: unset;
938
+ margin-top: 0;
939
+ }
940
+ .ai-mobile-wrap {
941
+ display: none !important;
942
+ }
943
  }
944
  </style>
945
  </head>
946
  <body>
947
+ <div class="bg-mesh">
948
+ <div class="orb orb-1"></div>
949
+ <div class="orb orb-2"></div>
950
+ <div class="orb orb-3"></div>
 
 
 
 
 
 
 
 
 
 
 
 
951
  </div>
952
+
953
+ <nav class="navbar" id="navbar">
954
+ <a class="brand" href="index.html">
955
+ <div class="brand-icon"><i class="fa-solid fa-bolt"></i></div>
956
+ <span>SurfGO</span>
957
+ </a>
958
+ <div class="search-container">
959
+ <form class="search-bar" id="search-form">
960
+ <input id="main-input" placeholder="ابحث عن أي شيء..." type="text" autocomplete="off" />
961
+ <button class="search-btn" type="submit" aria-label="بحث"><i class="fa-solid fa-magnifying-glass"></i></button>
962
+ </form>
963
+ </div>
964
+ <div class="nav-actions">
965
+ <button id="theme-toggle" aria-label="تغيير السمة"></button>
966
+ </div>
967
+ </nav>
968
+
969
+ <div class="tabs-bar" role="tablist">
970
+ <button class="tab-pill active" data-tab="all" role="tab"><i class="fa-solid fa-globe"></i> الويب</button>
971
+ <button class="tab-pill" data-tab="news" role="tab"><i class="fa-solid fa-newspaper"></i> أخبار</button>
972
+ <button class="tab-pill" data-tab="images" role="tab"><i class="fa-solid fa-image"></i> صور</button>
973
+ <button class="tab-pill" data-tab="videos" role="tab"><i class="fa-solid fa-play"></i> فيديو</button>
974
  </div>
975
+
976
+ <div class="page-wrapper">
977
+ <main class="results-area" role="main">
978
+ <div id="loading-text" class="loading-spinner"><div class="spinner"></div> جاري جلب النتائج…</div>
979
+
980
+ <div class="ai-mobile-wrap" id="ai-mobile-wrap">
981
+ <div class="ai-glow-ring"></div>
982
+ <div class="ai-widget">
983
+ <div class="ai-widget-header">
984
+ <div class="ai-widget-icon"><i class="fa-solid fa-robot"></i></div>
985
+ <span class="ai-widget-title">إجابة الذكاء الاصطناعي</span>
986
+ <span class="ai-widget-badge">AI</span>
987
+ </div>
988
+ <div class="ai-answer-body loading" id="ai-answer-body-mobile">
989
+ <div class="ai-skeleton"></div><div class="ai-skeleton"></div><div class="ai-skeleton"></div>
990
+ </div>
991
+ <div class="ai-sources" id="ai-sources-mobile"></div>
992
+ <button class="ai-copy-btn" id="ai-copy-mobile" style="display:none"><i class="fa-regular fa-copy"></i> نسخ</button>
993
+ <div class="ai-widget-footer"><i class="fa-solid fa-bolt"></i> مدعوم بواسطة AnesNT</div>
 
 
 
 
994
  </div>
 
995
  </div>
 
996
 
997
+ <div id="results-meta" class="results-meta" style="display:none"></div>
998
+ <div id="results-container"></div>
999
+ <button id="load-more-btn" class="load-more-btn" style="display:none"><i class="fa-solid fa-chevron-down"></i> تحميل المزيد</button>
1000
+ </main>
1001
+
1002
+ <aside class="sidebar">
1003
+ <div class="ai-widget-wrap">
1004
+ <div class="ai-glow-ring"></div>
1005
+ <div class="ai-widget">
1006
+ <div class="ai-widget-header">
1007
+ <div class="ai-widget-icon"><i class="fa-solid fa-robot"></i></div>
1008
+ <span class="ai-widget-title">إجابة الذكاء الاصطناعي</span>
1009
+ <span class="ai-widget-badge">AI</span>
1010
+ </div>
1011
+ <div class="ai-answer-body loading" id="ai-answer-body">
1012
+ <div class="ai-skeleton"></div><div class="ai-skeleton"></div><div class="ai-skeleton"></div>
1013
+ </div>
1014
+ <div class="ai-sources" id="ai-sources-desktop"></div>
1015
+ <button class="ai-copy-btn" id="ai-copy-desktop" style="display:none"><i class="fa-regular fa-copy"></i> نسخ</button>
1016
+ <div class="ai-widget-footer"><i class="fa-solid fa-bolt"></i> مدعوم بواسطة AnesNT</div>
1017
  </div>
 
1018
  </div>
1019
+ </aside>
1020
+ </div>
1021
+
1022
+ <button class="back-to-top" id="backToTop"><i class="fa-solid fa-arrow-up"></i></button>
1023
+
1024
+ <script>
1025
+ (function() {
1026
+ const SEARXNG_URL = "https://cjj-on-hf-searxng.hf.space/search";
1027
+ const GEMINI_API = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent";
1028
+ const GEMINI_API_KEY = ""; // ضع مفتاح API هنا إن وجد
1029
+
1030
+ // السمة
1031
+ const themeBtn = document.getElementById('theme-toggle');
1032
+ function setTheme(t) {
1033
+ document.documentElement.setAttribute('data-theme', t);
1034
+ localStorage.setItem('surfgo-theme', t);
1035
+ themeBtn.innerHTML = t === 'dark' ? '<i class="fa-solid fa-sun"></i>' : '<i class="fa-solid fa-moon"></i>';
1036
+ }
1037
+ setTheme(localStorage.getItem('surfgo-theme') || 'light');
1038
+ themeBtn.addEventListener('click', () => setTheme(document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'));
1039
+
1040
+ // الحالة
1041
+ const params = new URLSearchParams(window.location.search);
1042
+ let query = params.get('q') || '';
1043
+ let currentTab = params.get('tab') || 'all';
1044
+ let allResults = [];
1045
+
1046
+ const inputEl = document.getElementById('main-input');
1047
+ const resultsEl = document.getElementById('results-container');
1048
+ const loadingEl = document.getElementById('loading-text');
1049
+ const metaEl = document.getElementById('results-meta');
1050
+ const loadMoreBtn = document.getElementById('load-more-btn');
1051
+
1052
+ function setActiveTab(tab) {
1053
+ document.querySelectorAll('.tab-pill').forEach(btn => btn.classList.toggle('active', btn.dataset.tab === tab));
1054
+ }
1055
+ setActiveTab(currentTab);
1056
+
1057
+ // دوال مساعدة
1058
+ function escapeHTML(str) {
1059
+ return str ? str.replace(/[&<>'"]/g, t => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', "'": '&#39;', '"': '&quot;' }[t] || t)) : '';
1060
+ }
1061
+ function getDomain(url) {
1062
+ try { return new URL(url).hostname.replace('www.', ''); } catch { return url || ''; }
1063
+ }
1064
+ function proxyImage(url) {
1065
+ return url && !url.startsWith('data:') ? `https://wsrv.nl/?url=${encodeURIComponent(url)}&output=webp&maxage=7d&default=placeholder` : url;
1066
+ }
1067
+ function faviconURL(domain) {
1068
+ return `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
1069
+ }
1070
+ function getBestImageUrl(r) {
1071
+ const candidates = [r.img_src, r.thumbnail_src, r.thumbnail, r.image, r.url, r.img];
1072
+ for (const c of candidates) if (c && typeof c === 'string' && c.match(/\.(jpg|jpeg|png|gif|webp)/i)) return c;
1073
+ return candidates.find(c => c && typeof c === 'string' && c.startsWith('http'));
1074
+ }
1075
+
1076
+ // نسخ نص AI
1077
+ let currentAIAnswer = '';
1078
+ document.getElementById('ai-copy-desktop')?.addEventListener('click', () => navigator.clipboard.writeText(currentAIAnswer));
1079
+ document.getElementById('ai-copy-mobile')?.addEventListener('click', () => navigator.clipboard.writeText(currentAIAnswer));
1080
+
1081
+ function updateAISources(sources) {
1082
+ const chipsHTML = sources.slice(0, 4).map(s => {
1083
+ let domain = '';
1084
+ try { domain = new URL(s.url).hostname.replace('www.', ''); } catch { domain = s.url; }
1085
+ return `<a class="ai-source-chip" href="${s.url}" target="_blank" rel="noopener"><i class="fa-solid fa-link"></i>${escapeHTML(domain)}</a>`;
1086
+ }).join('');
1087
+ document.getElementById('ai-sources-desktop').innerHTML = chipsHTML;
1088
+ document.getElementById('ai-sources-mobile').innerHTML = chipsHTML;
1089
+ }
1090
+
1091
+ function runAI(q, results) {
1092
+ const desktop = document.getElementById('ai-answer-body');
1093
+ const mobile = document.getElementById('ai-answer-body-mobile');
1094
+ const copyDesktop = document.getElementById('ai-copy-desktop');
1095
+ const copyMobile = document.getElementById('ai-copy-mobile');
1096
+ [desktop, mobile].forEach(el => { if(el) { el.classList.add('loading'); el.innerHTML = '<div class="ai-skeleton"></div><div class="ai-skeleton"></div>'; } });
1097
+ [copyDesktop, copyMobile].forEach(el => { if(el) el.style.display = 'none'; });
1098
+ document.getElementById('ai-sources-desktop').innerHTML = '';
1099
+ document.getElementById('ai-sources-mobile').innerHTML = '';
1100
+
1101
+ const bestResult = results[0];
1102
+ const fallbackText = bestResult ? `بناءً على البحث، ${bestResult.content.slice(0, 200)}...` : 'لا توجد معلومات كافية.';
1103
+ const sources = results.slice(0, 4);
1104
+
1105
+ setTimeout(() => {
1106
+ currentAIAnswer = fallbackText;
1107
+ [desktop, mobile].forEach(el => { if(el) { el.classList.remove('loading'); el.textContent = currentAIAnswer; } });
1108
+ [copyDesktop, copyMobile].forEach(el => { if(el) el.style.display = 'inline-flex'; });
1109
+ updateAISources(sources);
1110
+ }, 1200);
1111
+ }
1112
+
1113
+ // Intersection Observer للرسوم المتحركة
1114
+ const observer = new IntersectionObserver((entries) => {
1115
+ entries.forEach(entry => {
1116
+ if (entry.isIntersecting) entry.target.classList.add('visible');
1117
+ });
1118
+ }, { threshold: 0.1, rootMargin: '0px 0px -20px 0px' });
1119
+
1120
+ function observeNewElements() {
1121
+ document.querySelectorAll('.search-result, .image-card, .video-card, .rich-graph-container').forEach(el => observer.observe(el));
1122
+ }
1123
+
1124
+ // العودة إلى الأعلى
1125
+ const backBtn = document.getElementById('backToTop');
1126
+ window.addEventListener('scroll', () => { backBtn.classList.toggle('show', window.scrollY > 400); });
1127
+ backBtn.addEventListener('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }));
1128
+
1129
+ // البحث
1130
+ async function performSearch(q, tab = 'all') {
1131
+ resultsEl.innerHTML = '';
1132
+ metaEl.style.display = 'none';
1133
+ loadMoreBtn.style.display = 'none';
1134
+ loadingEl.style.display = 'flex';
1135
+ const category = { all: 'general', news: 'news', images: 'images', videos: 'videos' }[tab] || 'general';
1136
+
1137
+ try {
1138
+ const response = await fetch(`${SEARXNG_URL}?q=${encodeURIComponent(q)}&format=json&categories=${category}&language=ar&safesearch=1`, { signal: AbortSignal.timeout(15000) });
1139
+ const data = await response.json();
1140
+ allResults = data.results || [];
1141
+ loadingEl.style.display = 'none';
1142
+
1143
+ if (allResults.length > 0) {
1144
+ metaEl.style.display = 'flex';
1145
+ metaEl.innerHTML = `تقريباً <span style="color:var(--accent);font-weight:700">${allResults.length}</span> نتيجة`;
1146
+ runAI(q, allResults);
1147
+
1148
+ if (tab === 'images') renderAllImages(allResults);
1149
+ else if (tab === 'videos') renderAllVideos(allResults);
1150
+ else renderRichWeb(q, allResults);
1151
+ observeNewElements();
1152
+ } else {
1153
+ resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-face-frown"></i><p>لا توجد نتائج لـ "${escapeHTML(q)}"</p></div>`;
1154
+ }
1155
+ } catch (error) {
1156
+ loadingEl.style.display = 'none';
1157
+ resultsEl.innerHTML = `<div class="empty-state"><i class="fa-solid fa-triangle-exclamation"></i><p>تعذّر الاتصال بالمحرك.</p></div>`;
1158
  }
1159
+ }
1160
+
1161
+ function renderRichWeb(q, results) {
1162
+ resultsEl.innerHTML = '';
1163
+ let mainCard = results.find(r => r.url.includes('wikipedia.org')) || results.find(r => !r.url.includes('youtube.com'));
1164
+ const ytResults = results.filter(r => r.url.includes('youtube.com/watch')).slice(0, 4);
1165
+
1166
+ const richContainer = document.createElement('div');
1167
+ richContainer.className = 'rich-graph-container';
1168
+
1169
+ const imagesRow = document.createElement('div');
1170
+ imagesRow.className = 'rich-images-row';
1171
+ imagesRow.innerHTML = '<div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div><div class="rich-img-skeleton"></div>';
1172
+ richContainer.appendChild(imagesRow);
1173
+
1174
+ fetch(`${SEARXNG_URL}?q=${encodeURIComponent(q)}&format=json&categories=images&language=ar`)
1175
+ .then(res => res.json())
1176
+ .then(data => {
1177
+ if (data.results) {
1178
+ const valid = data.results.filter(r => getBestImageUrl(r)).slice(0, 6);
1179
+ if (valid.length) {
1180
+ imagesRow.innerHTML = valid.map(r => {
1181
+ const img = proxyImage(getBestImageUrl(r));
1182
+ return `<a href="${escapeHTML(r.url||'#')}" target="_blank" class="rich-img-card">
1183
+ <img src="${escapeHTML(img)}" alt="صورة" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" />
1184
+ <div class="img-error-overlay"><i class="fa-solid fa-image-slash"></i> تعذّر التحميل</div>
1185
+ </a>`;
1186
+ }).join('');
1187
+ } else imagesRow.style.display = 'none';
1188
+ }
1189
+ }).catch(() => imagesRow.style.display = 'none');
1190
+
1191
+ if (mainCard) {
1192
+ const dmn = getDomain(mainCard.url);
1193
+ richContainer.innerHTML += `
1194
+ <div class="wiki-card search-result">
1195
+ <div class="wiki-header"><img src="${faviconURL(dmn)}" style="width:26px;height:26px;border-radius:6px" /><div><div class="wiki-domain">${escapeHTML(dmn)}</div><a href="${escapeHTML(mainCard.url)}" target="_blank" class="wiki-url">${escapeHTML(mainCard.url)}</a></div></div>
1196
+ <a href="${escapeHTML(mainCard.url)}" target="_blank" class="result-title" style="font-size:20px">${escapeHTML(mainCard.title)}</a>
1197
+ <p class="result-snippet">${escapeHTML(mainCard.content)}</p>
1198
+ </div>`;
1199
  }
1200
+ if (ytResults.length) {
1201
+ richContainer.innerHTML += `<h3 class="rich-section-title">فيديوهات <i class="fa-solid fa-chevron-left"></i></h3><div class="rich-videos-row">${ytResults.map(r => {
1202
+ const vidMatch = r.url.match(/v=([^&]+)/);
1203
+ const thumb = vidMatch ? `https://img.youtube.com/vi/${vidMatch[1]}/mqdefault.jpg` : proxyImage(r.thumbnail);
1204
+ return `<a href="${escapeHTML(r.url)}" target="_blank" class="rich-vid-card"><div class="rich-vid-thumb"><img src="${escapeHTML(thumb)}" loading="lazy" /><div class="rich-vid-play"><i class="fa-solid fa-play"></i></div></div><div class="rich-vid-info"><div class="rich-vid-title">${escapeHTML(r.title)}</div><div class="rich-vid-meta"><img src="${faviconURL('youtube.com')}" /> YouTube</div></div></a>`;
1205
+ }).join('')}</div>`;
1206
+ }
1207
+ richContainer.innerHTML += `<h3 class="rich-section-title">استكشف ${escapeHTML(q)} بالتفصيل</h3><div class="discover-bubbles">${['جميلة جدا','أنواع','صور','فيديوهات','معلومات'].map(d => `<button class="discover-bubble" data-query="${escapeHTML(d+' '+q)}"><i class="fa-solid fa-magnifying-glass"></i> ${escapeHTML(d+' '+q)}</button>`).join('')}</div>`;
1208
+ resultsEl.appendChild(richContainer);
1209
+
1210
+ richContainer.querySelectorAll('.discover-bubble').forEach(btn => {
1211
+ btn.addEventListener('click', () => {
1212
+ inputEl.value = btn.dataset.query;
1213
+ document.getElementById('search-form').dispatchEvent(new Event('submit'));
1214
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1215
  });
 
1216
 
1217
+ const used = new Set([mainCard?.url, ...ytResults.map(r=>r.url)]);
1218
+ results.filter(r => !used.has(r.url)).forEach(r => {
1219
+ const domain = getDomain(r.url);
1220
+ const article = document.createElement('article');
1221
+ article.className = 'search-result';
1222
+ article.innerHTML = `<div class="favicon-wrap"><img src="${faviconURL(domain)}" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" /><i class="fa-solid fa-globe fallback-icon" style="display:none"></i></div><div class="result-content"><div class="result-domain"><i class="fa-solid fa-link"></i> ${escapeHTML(domain)}</div><a class="result-title" href="${escapeHTML(r.url)}" target="_blank">${escapeHTML(r.title)}</a><p class="result-snippet">${escapeHTML(r.content)}</p></div>`;
1223
+ resultsEl.appendChild(article);
1224
+ });
1225
+ }
1226
 
1227
+ function renderAllImages(results) {
1228
+ const wrap = document.createElement('div'); wrap.className = 'images-grid';
1229
+ results.forEach(r => {
1230
+ const raw = getBestImageUrl(r); if(!raw) return;
1231
+ wrap.innerHTML += `<div class="image-card"><a class="image-card-link" href="${escapeHTML(r.url)}" target="_blank"><img src="${escapeHTML(proxyImage(raw))}" alt="${escapeHTML(r.title)}" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" /><div class="img-error-overlay"><i class="fa-solid fa-image-slash"></i> تعذّر</div></a><div class="image-info">${escapeHTML(r.title)}</div></div>`;
1232
+ });
1233
+ resultsEl.appendChild(wrap);
1234
+ }
1235
 
1236
+ function renderAllVideos(results) {
1237
+ const wrap = document.createElement('div'); wrap.className = 'videos-grid';
1238
+ results.forEach(r => {
1239
+ wrap.innerHTML += `<div class="video-card"><a href="${escapeHTML(r.url)}" target="_blank" class="video-thumb-wrap"><img src="${proxyImage(r.thumbnail)}" loading="lazy" /><div class="play-overlay"><i class="fa-solid fa-play"></i></div></a><div class="video-details"><a class="video-title" href="${escapeHTML(r.url)}">${escapeHTML(r.title)}</a></div></div>`;
1240
+ });
1241
+ resultsEl.appendChild(wrap);
1242
+ }
1243
+
1244
+ // التهيئة
1245
+ if (query) { inputEl.value = query; performSearch(query, currentTab); }
1246
+ document.getElementById('search-form').addEventListener('submit', (e) => {
1247
+ e.preventDefault(); const q = inputEl.value.trim(); if(!q) return;
1248
+ window.history.pushState({}, '', `?q=${encodeURIComponent(q)}&tab=${currentTab}`);
1249
+ query = q; performSearch(q, currentTab);
1250
  });
1251
+ document.querySelectorAll('.tab-pill').forEach(btn => {
1252
+ btn.addEventListener('click', () => {
1253
+ const tab = btn.dataset.tab; if(tab===currentTab) return;
1254
+ currentTab = tab; setActiveTab(tab);
1255
+ window.history.pushState({}, '', `?q=${encodeURIComponent(query)}&tab=${tab}`);
1256
+ if(query) performSearch(query, tab);
1257
+ });
 
 
 
 
 
 
 
 
1258
  });
1259
+ loadMoreBtn.addEventListener('click', () => performSearch(query, currentTab));
1260
+ })();
1261
+ </script>
1262
  </body>
1263
  </html>