-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscholarships.html
More file actions
1225 lines (1186 loc) · 66.2 KB
/
Copy pathscholarships.html
File metadata and controls
1225 lines (1186 loc) · 66.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
{% load static %}
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scholarships</title>
<link rel="icon" type="image/svg+xml" sizes="any" href="{% static 'images/scholarhub-logo.svg' %}" />
<!-- Inter font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
<!-- Tailwind CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: { sans: ['Inter', 'ui-sans-serif', 'system-ui'] },
keyframes: {
'fade-up': {
'0%': { opacity: 0, transform: 'translateY(14px)' },
'100%': { opacity: 1, transform: 'translateY(0)' }
},
'gradient-x': {
'0%, 100%': { backgroundPosition: '0% 50%' },
'50%': { backgroundPosition: '100% 50%' }
}
},
animation: {
'fade-up': 'fade-up 0.75s ease-out both',
'gradient-x': 'gradient-x 8s ease infinite'
}
}
}
};
</script>
<style>
:root {
color-scheme: light;
}
body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background: #f8fafc;
color: #0f172a;
}
.card-surface {
background: #ffffff;
border: 1px solid #e2e8f0;
box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card-surface:hover {
transform: translateY(-6px) scale(1.02);
box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
border-color: rgba(99, 102, 241, 0.3);
}
.navbar-blur {
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.82);
box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.floating-input:focus + label,
.floating-input:not(:placeholder-shown) + label {
transform: translateY(-10px) scale(0.9);
color: #6366f1;
opacity: 0.95;
}
.floating-input:focus {
outline: none;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
border-color: rgba(99, 102, 241, 0.6);
}
.floating-input {
transition: box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.skeleton {
background: linear-gradient(90deg, rgba(226, 232, 240, 0.5) 25%, rgba(203, 213, 225, 0.8) 37%, rgba(226, 232, 240, 0.5) 63%);
background-size: 400% 100%;
animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
/* Shared purple accents */
section h2, section h3 { position: relative; display: inline-block; }
section h2::after, section h3::after { content: ""; display: block; width: 56px; height: 3px; background: linear-gradient(90deg,#6366f1,#8b5cf6); margin-top: 10px; border-radius: 9999px; }
.card-soft, .card-surface, .glass-card { position: relative; overflow: hidden; }
.card-soft::before, .card-surface::before, .glass-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg,#6366f1,#8b5cf6); border-radius: 9999px; opacity: 0.9; }
.bg-gradient-to-r { box-shadow: 0 12px 30px rgba(99,102,241,0.20); transition: transform 150ms ease, box-shadow 150ms ease; }
.bg-gradient-to-r:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(99,102,241,0.26); }
#scholarship-results {
scroll-margin-top: 120px;
}
.filter-panel {
position: relative;
overflow: hidden;
background:
linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
radial-gradient(circle at top right, rgba(129, 140, 248, 0.14), transparent 35%);
border: 1px solid rgba(226, 232, 240, 0.95);
box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}
.filter-panel::before {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
background:
radial-gradient(circle at 12% 18%, rgba(99, 102, 241, 0.08), transparent 24%),
radial-gradient(circle at 88% 20%, rgba(168, 85, 247, 0.08), transparent 22%);
}
.filter-field {
position: relative;
border-radius: 22px;
border: 1px solid rgba(203, 213, 225, 0.95);
background: rgba(255, 255, 255, 0.92);
padding: 0.9rem 1rem 0.95rem;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.filter-field:hover {
transform: translateY(-2px);
border-color: rgba(129, 140, 248, 0.45);
box-shadow: 0 18px 36px rgba(99, 102, 241, 0.1);
}
.filter-field--active {
border-color: rgba(99, 102, 241, 0.45);
background: linear-gradient(180deg, rgba(238, 242, 255, 0.9), rgba(255, 255, 255, 0.98));
box-shadow: 0 18px 36px rgba(99, 102, 241, 0.12);
}
.filter-field:focus-within {
transform: translateY(-2px);
border-color: rgba(99, 102, 241, 0.58);
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.13), 0 22px 42px rgba(99, 102, 241, 0.12);
}
.filter-field__label {
display: block;
margin-bottom: 0.65rem;
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.18em;
text-transform: uppercase;
color: #64748b;
}
.filter-field__body {
position: relative;
display: flex;
align-items: center;
}
.filter-field__icon {
position: absolute;
left: 0;
top: 50%;
z-index: 1;
transform: translateY(-50%);
color: #6366f1;
pointer-events: none;
}
.filter-control {
width: 100%;
border: 0;
outline: 0;
background: transparent;
color: #0f172a;
font-size: 0.98rem;
font-weight: 600;
line-height: 1.5rem;
padding: 0 2.65rem 0 2rem;
}
.filter-control::placeholder {
color: #94a3b8;
font-weight: 500;
}
.filter-select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
cursor: pointer;
}
.filter-select option {
background: #ffffff;
color: #0f172a;
font-weight: 600;
}
.filter-select--placeholder {
color: #94a3b8;
font-weight: 500;
}
.filter-select-wrap::after {
content: "";
position: absolute;
right: 1rem;
top: 50%;
z-index: 2;
width: 0.6rem;
height: 0.6rem;
border-right: 2px solid #ffffff;
border-bottom: 2px solid #ffffff;
transform: translateY(-65%) rotate(45deg);
pointer-events: none;
}
.filter-select-wrap::before {
content: "";
position: absolute;
right: 0.25rem;
top: 50%;
width: 2.3rem;
height: 2.3rem;
transform: translateY(-50%);
border-radius: 9999px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
box-shadow: 0 14px 28px rgba(99, 102, 241, 0.24);
pointer-events: none;
}
.filter-field--active .filter-select-wrap::before,
.filter-field:focus-within .filter-select-wrap::before {
background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.filter-date {
min-height: 1.75rem;
}
.filter-date::-webkit-calendar-picker-indicator {
position: absolute;
right: 0;
width: 2.25rem;
height: 2.25rem;
margin: 0;
opacity: 0;
cursor: pointer;
}
.filter-chip {
display: inline-flex;
align-items: center;
gap: 0.45rem;
border-radius: 9999px;
border: 1px solid rgba(199, 210, 254, 0.95);
background: rgba(255, 255, 255, 0.82);
padding: 0.55rem 0.9rem;
font-size: 0.82rem;
font-weight: 600;
color: #4338ca;
box-shadow: 0 10px 24px rgba(99, 102, 241, 0.08);
}
.filter-chip--subtle {
border-color: rgba(226, 232, 240, 0.95);
color: #475569;
}
@media (max-width: 640px) {
.filter-field {
padding: 0.8rem 0.9rem 0.9rem;
}
.filter-control {
font-size: 0.95rem;
}
}
</style>
</head>
<body class="min-h-screen flex flex-col bg-white text-slate-900 relative overflow-x-hidden" id="top">
<!-- Background -->
<div class="absolute inset-0 -z-10 pointer-events-none overflow-hidden">
<div class="absolute inset-0 bg-[radial-gradient(circle_at_18%_18%,rgba(99,102,241,0.08),transparent_32%),radial-gradient(circle_at_82%_10%,rgba(168,85,247,0.08),transparent_30%),linear-gradient(135deg,#eef2ff,#f8fafc_60%,#ffffff)]"></div>
<div class="absolute inset-0 bg-[linear-gradient(120deg,rgba(15,23,42,0.05)_1px,transparent_1px)] bg-[size:34px_34px] opacity-35"></div>
</div>
<!-- Navbar (reused from about.html) -->
<nav class="fixed top-0 inset-x-0 z-50 bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600 text-white shadow-md transition-all duration-300" id="navbar">
<div class="mx-auto max-w-7xl px-4">
<div class="flex items-center gap-4 h-12">
<a href="{% url 'home' %}" class="flex items-center gap-3 group">
<span class="flex h-10 w-10 items-center justify-center rounded-[18px] bg-white/15 shadow-lg ring-1 ring-white/20 backdrop-blur-sm transition group-hover:-translate-y-0.5 group-hover:bg-white/20">
<img src="{% static 'images/scholarhub-logo.svg' %}" alt="ScholarHub logo" class="h-7 w-7 drop-shadow-sm">
</span>
<span class="text-lg font-semibold tracking-tight text-white group-hover:text-white transition">ScholarHub</span>
</a>
<div class="lg:hidden ml-auto">
<button id="nav-toggle" class="p-2 rounded-lg hover:bg-white/20 transition" aria-label="Toggle navigation">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16M4 17h16"/>
</svg>
</button>
</div>
<div class="hidden lg:flex items-center w-full">
<div class="flex-1 flex items-center justify-end gap-4 text-white/90 font-medium">
<a href="{% url 'home' %}" class="px-3 py-2 rounded-lg hover:bg-white/10 transition">Home</a>
<a href="{% url 'scholarships' %}" class="px-3 py-2 rounded-lg hover:bg-white/10 transition">Scholarships</a>
<a href="{% url 'services' %}" class="px-3 py-2 rounded-lg hover:bg-white/10 transition">Services</a>
<a href="{% url 'about' %}" class="px-3 py-2 rounded-lg hover:bg-white/10 transition">About</a>
<a href="{% url 'contact' %}" class="px-3 py-2 rounded-lg hover:bg-white/10 transition">Contact</a>
</div>
<div class="flex items-center gap-3">
{% if request.user.is_authenticated %}
{% if request.user.is_staff %}
<a href="{% url 'admin_dashboard' %}" class="px-3 py-1.5 rounded-lg bg-white/20 hover:bg-white/30 transition font-medium">Admin</a>
{% else %}
<a href="{% url 'student_dashboard' %}" class="px-3 py-1.5 rounded-lg bg-white/20 hover:bg-white/30 transition font-medium">Dashboard</a>
{% endif %}
<form method="post" action="{% url 'logout' %}" class="m-0">
{% csrf_token %}
<button type="submit" class="px-3 py-1.5 rounded-lg border border-white/30 hover:bg-white/10 transition font-medium">Logout</button>
</form>
{% else %}
<a href="{% url 'login' %}" class="px-3 py-1.5 rounded-lg border border-white/30 hover:bg-white/10 transition font-medium">Login</a>
<a href="{% url 'register' %}" class="px-3 py-1.5 rounded-lg bg-white text-indigo-700 shadow hover:-translate-y-0.5 transition font-medium">Register</a>
{% endif %}
</div>
</div>
</div>
</div>
<div id="mobile-menu" class="hidden lg:hidden bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600">
<div class="flex flex-col gap-2 px-4 pb-4 pt-2">
<a href="{% url 'home' %}" class="text-white hover:text-white/90 transition py-2 rounded-lg hover:bg-white/10">Home</a>
<a href="{% url 'scholarships' %}" class="text-white hover:text-white/90 transition py-2 rounded-lg hover:bg-white/10">Scholarships</a>
<a href="{% url 'services' %}" class="text-white hover:text-white/90 transition py-2 rounded-lg hover:bg-white/10">Services</a>
<a href="{% url 'about' %}" class="text-white hover:text-white/90 transition py-2 rounded-lg hover:bg-white/10">About</a>
<a href="{% url 'contact' %}" class="text-white hover:text-white/90 transition py-2 rounded-lg hover:bg-white/10">Contact</a>
{% if request.user.is_authenticated %}
{% if request.user.is_staff %}
<a href="{% url 'admin_dashboard' %}" class="px-3 py-2 rounded-lg bg-white/15 text-white">Admin</a>
{% else %}
<a href="{% url 'student_dashboard' %}" class="px-3 py-2 rounded-lg bg-white/15 text-white">Dashboard</a>
{% endif %}
<form method="post" action="{% url 'logout' %}" class="m-0">
{% csrf_token %}
<button type="submit" class="px-3 py-2 rounded-lg border border-white/30 text-white hover:bg-white/10 transition w-full text-left">Logout</button>
</form>
{% else %}
<a href="{% url 'login' %}" class="px-3 py-2 rounded-lg border border-white/30 text-white hover:bg-white/10 transition">Login</a>
<a href="{% url 'register' %}" class="px-3 py-2 rounded-lg bg-white text-indigo-700 shadow hover:-translate-y-0.5 transition inline-block text-center">Register</a>
{% endif %}
</div>
</div>
</nav>
<main class="relative flex-1 pt-28 pb-16">
<!-- Hero -->
<section class="mx-auto max-w-6xl px-4 animate-fade-up">
<div class="flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between">
<div class="max-w-2xl space-y-3">
<p class="text-xs uppercase tracking-[0.25em] text-slate-500">Scholarships</p>
<h1 class="text-4xl sm:text-5xl font-semibold text-slate-900 leading-tight">Browse and Apply for Scholarships</h1>
<p class="text-slate-600 text-base sm:text-lg">
Find opportunities by country, level, category, or deadline—tailored for students looking to make the next big move.
</p>
<div class="flex flex-col sm:flex-row gap-3">
<form method="get" action="{% url 'scholarships' %}" class="flex-1 flex gap-2">
<div class="relative flex-1">
<input
class="floating-input w-full rounded-xl bg-white border border-slate-200 text-slate-900 placeholder-transparent py-3 pl-11 pr-4 focus:bg-white"
type="search"
name="q"
id="hero-search"
placeholder="Search scholarships..."
value="{{ q|default:'' }}"
/>
<label class="pointer-events-none absolute left-11 top-3 text-sm text-slate-500 transition-all duration-200 origin-left">
Search scholarships...
</label>
<span class="pointer-events-none absolute left-4 top-3.5 text-slate-400">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 5a6 6 0 1 0 0 12 6 6 0 0 0 0-12Zm8 14-3.5-3.5" />
</svg>
</span>
</div>
<button
class="h-12 px-5 rounded-xl bg-gradient-to-r from-indigo-500 via-purple-500 to-violet-500 text-white font-semibold shadow-lg shadow-indigo-500/30 transition hover:-translate-y-0.5 hover:shadow-indigo-500/50 animate-gradient-x"
type="submit"
>
Search
</button>
</form>
<a
class="h-12 px-5 inline-flex items-center justify-center rounded-xl border border-slate-200 text-slate-800 bg-white hover:bg-slate-50 transition"
href="{% url 'scholarships' %}"
>
Browse All
</a>
</div>
</div>
<div class="card-surface rounded-2xl p-5 w-full max-w-sm">
<div class="flex items-center gap-3 mb-3">
<div class="h-12 w-12 rounded-2xl bg-gradient-to-br from-indigo-500 via-purple-500 to-violet-500 flex items-center justify-center text-white font-semibold shadow-lg shadow-indigo-500/30">∞</div>
<div>
<p class="text-xs uppercase tracking-[0.2em] text-slate-500">Quick stats</p>
<p class="text-lg font-semibold text-slate-900">Opportunities updated weekly</p>
</div>
</div>
<ul class="space-y-2 text-sm text-slate-600">
<li>• Filter by country, level, category, deadline</li>
<li>• Smart image fallbacks keep cards fresh</li>
<li>• Responsive, student-friendly grid</li>
</ul>
</div>
</div>
</section>
<!-- Filters (sticky) -->
<section class="mx-auto max-w-6xl px-4 mt-8 animate-fade-up" style="animation-delay:0.05s;">
<div class="filter-panel rounded-[28px] p-5 sm:p-6 lg:p-7 text-slate-900">
<div class="relative z-10 flex flex-col gap-5 mb-6 lg:flex-row lg:items-end lg:justify-between">
<div class="space-y-2">
<p class="text-xs uppercase tracking-[0.24em] text-indigo-500">Refine Results</p>
<div>
<h2 class="text-2xl font-semibold text-slate-900">Style your shortlist with better filters</h2>
<p class="text-sm text-slate-600 max-w-2xl">
Narrow the list with polished controls for country, study level, category, and a clean deadline cutoff.
</p>
</div>
</div>
<div class="relative z-10 flex flex-wrap gap-2 lg:justify-end">
<span class="filter-chip filter-chip--subtle">Fresh matches</span>
{% if q %}<span class="filter-chip">Search: {{ q }}</span>{% endif %}
{% if country %}<span class="filter-chip">{{ country }}</span>{% endif %}
{% if level %}<span class="filter-chip">{{ level|title }}</span>{% endif %}
{% if category %}<span class="filter-chip">{{ category|title }}</span>{% endif %}
{% if deadline_before %}<span class="filter-chip">By {{ deadline_before }}</span>{% endif %}
</div>
</div>
<form method="get" action="{% url 'scholarships' %}" class="relative z-10 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<div class="filter-field {% if country %}filter-field--active{% endif %}">
<label for="country" class="filter-field__label">Country</label>
<div class="filter-field__body">
<span class="filter-field__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M12 21s7-4.35 7-11a7 7 0 1 0-14 0c0 6.65 7 11 7 11Z" />
<circle cx="12" cy="10" r="2.5" stroke-width="1.7" />
</svg>
</span>
<input
class="filter-control"
type="text"
name="country"
id="country"
placeholder="Type a country"
value="{{ country|default:'' }}"
/>
</div>
</div>
<div class="filter-field {% if level %}filter-field--active{% endif %}">
<label for="level" class="filter-field__label">Level</label>
<div class="filter-field__body filter-select-wrap">
<span class="filter-field__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="m3 9 9-5 9 5-9 5-9-5Z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M6 10.8V15l6 3 6-3v-4.2" />
</svg>
</span>
<select
class="filter-control filter-select"
name="level"
id="level"
>
<option value="">Select level</option>
{% for value,label in level_options %}
<option value="{{ value }}" {% if level == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="filter-field {% if category %}filter-field--active{% endif %}">
<label for="category" class="filter-field__label">Category</label>
<div class="filter-field__body filter-select-wrap">
<span class="filter-field__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<rect x="4" y="4" width="6" height="6" rx="1.4" stroke-width="1.7" />
<rect x="14" y="4" width="6" height="6" rx="1.4" stroke-width="1.7" />
<rect x="4" y="14" width="6" height="6" rx="1.4" stroke-width="1.7" />
<rect x="14" y="14" width="6" height="6" rx="1.4" stroke-width="1.7" />
</svg>
</span>
<select
class="filter-control filter-select"
name="category"
id="category"
>
<option value="">Select category</option>
{% for value,label in category_options %}
<option value="{{ value }}" {% if category == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="filter-field {% if deadline_before %}filter-field--active{% endif %}">
<label for="deadline_before" class="filter-field__label">Deadline Cutoff</label>
<div class="filter-field__body">
<span class="filter-field__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<rect x="3.75" y="5" width="16.5" height="15" rx="2.2" stroke-width="1.7" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M8 3.75V7M16 3.75V7M3.75 9.25h16.5" />
</svg>
</span>
<input
class="filter-control filter-date"
type="date"
name="deadline_before"
id="deadline_before"
value="{{ deadline_before|default:'' }}"
/>
</div>
</div>
<div class="md:col-span-2 lg:col-span-4 flex flex-col gap-3 pt-1 sm:flex-row">
<button
class="flex-1 h-12 rounded-xl bg-gradient-to-r from-indigo-500 via-purple-500 to-violet-500 text-white font-semibold shadow-lg shadow-indigo-500/35 transition duration-200 hover:-translate-y-0.5 hover:shadow-indigo-500/55 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-indigo-400/60 animate-gradient-x"
type="submit"
>
Apply Filters
</button>
<a
class="h-12 px-5 inline-flex items-center justify-center rounded-xl border border-slate-200 text-slate-800 bg-white/90 hover:bg-white transition shadow-sm"
href="{% url 'scholarships' %}"
>
Reset
</a>
</div>
</form>
</div>
</section>
<!-- Featured Scholarships Carousel -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up">
<div class="flex items-center justify-between">
<div>
<p class="text-xs uppercase tracking-[0.2em] text-indigo-500">Highlights</p>
<h2 class="text-2xl font-semibold text-slate-900">Top 5 scholarships this month</h2>
</div>
<div class="flex gap-2">
<button type="button" id="feat-prev" class="h-10 w-10 rounded-full bg-white border border-slate-200 shadow hover:bg-slate-50">‹</button>
<button type="button" id="feat-next" class="h-10 w-10 rounded-full bg-white border border-slate-200 shadow hover:bg-slate-50">›</button>
</div>
</div>
<div id="feat-track" class="flex gap-4 overflow-x-auto scroll-smooth pb-2">
{% if featured_scholarships %}
{% for fs in featured_scholarships|slice:":5" %}
{% cycle 'images/recommendation-global-campus.svg' 'images/recommendation-study-desk.svg' 'images/recommendation-research-lab.svg' 'images/recommendation-passport-route.svg' 'images/recommendation-library-spotlight.svg' as featured_fallback silent %}
<article class="card-surface min-w-[260px] max-w-[280px] rounded-2xl overflow-hidden flex-shrink-0">
<div class="relative h-40 overflow-hidden">
{% if fs.image %}
<img src="{{ fs.image.url }}" alt="{{ fs.title }}" class="w-full h-full object-cover">
{% else %}
<img src="{% static featured_fallback %}" alt="{{ fs.title }}" class="w-full h-full object-cover">
{% endif %}
<div class="absolute inset-0 bg-gradient-to-t from-slate-900/70 via-slate-900/35 to-transparent"></div>
<div class="absolute top-3 left-3 px-3 py-1 rounded-full text-xs font-semibold bg-white/85 text-slate-900 shadow">{{ fs.organization|default:"TBA" }}</div>
</div>
<div class="p-4 space-y-2">
<h3 class="text-lg font-semibold text-slate-900 line-clamp-2">{{ fs.title }}</h3>
<p class="text-sm text-slate-600 line-clamp-2">{{ fs.description|default:"Explore this featured opportunity."|truncatewords:22 }}</p>
<div class="flex justify-between items-center text-xs text-slate-500">
<span>{{ fs.country|default:"Global" }}</span>
{% if fs.deadline %}<span class="font-semibold text-indigo-600">Deadline: {{ fs.deadline }}</span>{% endif %}
</div>
</div>
</article>
{% endfor %}
{% elif scholarships %}
{% for fs in scholarships|slice:":5" %}
{% cycle 'images/recommendation-global-campus.svg' 'images/recommendation-study-desk.svg' 'images/recommendation-research-lab.svg' 'images/recommendation-passport-route.svg' 'images/recommendation-library-spotlight.svg' as featured_fallback silent %}
<article class="card-surface min-w-[260px] max-w-[280px] rounded-2xl overflow-hidden flex-shrink-0">
<div class="relative h-40 overflow-hidden">
{% if fs.image %}
<img src="{{ fs.image.url }}" alt="{{ fs.title }}" class="w-full h-full object-cover">
{% else %}
<img src="{% static featured_fallback %}" alt="{{ fs.title }}" class="w-full h-full object-cover">
{% endif %}
<div class="absolute inset-0 bg-gradient-to-t from-slate-900/70 via-slate-900/35 to-transparent"></div>
<div class="absolute top-3 left-3 px-3 py-1 rounded-full text-xs font-semibold bg-white/85 text-slate-900 shadow">{{ fs.organization|default:"TBA" }}</div>
</div>
<div class="p-4 space-y-2">
<h3 class="text-lg font-semibold text-slate-900 line-clamp-2">{{ fs.title }}</h3>
<p class="text-sm text-slate-600 line-clamp-2">{{ fs.description|default:"Explore this featured opportunity."|truncatewords:22 }}</p>
<div class="flex justify-between items-center text-xs text-slate-500">
<span>{{ fs.country|default:"Global" }}</span>
{% if fs.deadline %}<span class="font-semibold text-indigo-600">Deadline: {{ fs.deadline }}</span>{% endif %}
</div>
</div>
</article>
{% endfor %}
{% else %}
<p class="text-sm text-slate-600">No featured scholarships yet.</p>
{% endif %}
</div>
</section>
<!-- Category Quick Links -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-3 animate-fade-up">
<p class="text-xs uppercase tracking-[0.2em] text-indigo-500">Quick filters</p>
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3">
<button type="button" data-quick-cat="undergraduate" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">Undergraduate</button>
<button type="button" data-quick-cat="postgraduate" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">Postgraduate</button>
<button type="button" data-quick-cat="masters" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">Masters</button>
<button type="button" data-quick-cat="phd" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">PhD</button>
<button type="button" data-quick-cat="fellowship" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">Fellowship</button>
<button type="button" data-quick-cat="grant" class="rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 transition shadow-sm">Grant</button>
</div>
</section>
<!-- Upcoming Deadlines -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-semibold text-slate-900">Upcoming deadlines</h2>
<span class="text-sm text-slate-500">Soonest first</span>
</div>
<div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
{% if upcoming_deadlines %}
{% for up in upcoming_deadlines|slice:":6" %}
<div class="card-surface rounded-2xl p-4 flex items-start gap-3">
<div class="h-10 w-10 rounded-2xl bg-gradient-to-br from-indigo-500 via-purple-500 to-violet-500 text-white flex items-center justify-center font-semibold shadow">
{{ up.deadline|default:"?"|date:"d" }}
</div>
<div class="space-y-1">
<p class="text-sm uppercase tracking-wide text-slate-500">{{ up.deadline|date:"M Y"|default:"TBA" }}</p>
<h3 class="text-base font-semibold text-slate-900 line-clamp-2">{{ up.title }}</h3>
<p class="text-sm text-slate-600 line-clamp-2">{{ up.organization|default:"TBA" }}</p>
</div>
</div>
{% endfor %}
{% elif scholarships %}
{% for up in scholarships|slice:":6" %}
<div class="card-surface rounded-2xl p-4 flex items-start gap-3">
<div class="h-10 w-10 rounded-2xl bg-gradient-to-br from-indigo-500 via-purple-500 to-violet-500 text-white flex items-center justify-center font-semibold shadow">
{{ up.deadline|default:"?"|date:"d" }}
</div>
<div class="space-y-1">
<p class="text-sm uppercase tracking-wide text-slate-500">{{ up.deadline|date:"M Y"|default:"TBA" }}</p>
<h3 class="text-base font-semibold text-slate-900 line-clamp-2">{{ up.title }}</h3>
<p class="text-sm text-slate-600 line-clamp-2">{{ up.organization|default:"TBA" }}</p>
</div>
</div>
{% endfor %}
{% else %}
<p class="text-sm text-slate-600">No upcoming deadlines listed.</p>
{% endif %}
</div>
</section>
<!-- Student Testimonials -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-semibold text-slate-900">Student success stories</h2>
</div>
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{% if testimonials %}
{% for t in testimonials %}
<article class="card-surface rounded-2xl p-5 space-y-3">
<p class="text-sm text-slate-700 italic leading-relaxed">“{{ t.quote }}”</p>
<div class="flex items-center gap-3">
<div class="h-10 w-10 rounded-full bg-gradient-to-br from-indigo-500 via-purple-500 to-violet-500 text-white flex items-center justify-center font-semibold">
{{ t.name|first|default:"S" }}
</div>
<div>
<p class="text-sm font-semibold text-slate-900">{{ t.name }}</p>
<p class="text-xs text-slate-500">{{ t.country|default:"Global" }}</p>
</div>
</div>
</article>
{% endfor %}
{% else %}
<p class="text-sm text-slate-600">Testimonials coming soon.</p>
{% endif %}
</div>
</section>
<!-- Mini Dashboard / Stats -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up">
<div class="flex items-center justify-between">
<div>
<p class="text-xs uppercase tracking-[0.25em] text-indigo-500">At a glance</p>
<h2 class="text-2xl font-semibold text-slate-900">Scholarship insights</h2>
</div>
<span class="px-3 py-1 rounded-full text-xs font-semibold bg-indigo-50 text-indigo-700 border border-indigo-100 shadow-sm">Live data</span>
</div>
<div class="grid gap-4 lg:grid-cols-3">
<div class="card-surface rounded-2xl p-4 border-t-4 border-t-indigo-400">
<div class="flex items-center justify-between mb-3">
<h3 class="text-sm font-semibold text-slate-800">Top Countries</h3>
<span class="text-xs text-slate-500">Distribution</span>
</div>
<canvas id="chartCountry" height="160" aria-label="Scholarships per country" role="img"></canvas>
<div class="mt-3 flex flex-wrap gap-3 text-xs text-slate-600">
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-indigo-500"></span>Kenya</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-purple-500"></span>USA</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-violet-500"></span>UK</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-sky-400"></span>Canada</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-rose-400"></span>Germany</span>
</div>
</div>
<div class="card-surface rounded-2xl p-4 border-t-4 border-t-purple-400">
<div class="flex items-center justify-between mb-3">
<h3 class="text-sm font-semibold text-slate-800">By Level</h3>
<span class="text-xs text-slate-500">Mix</span>
</div>
<canvas id="chartLevel" height="160" aria-label="Scholarships by level" role="img"></canvas>
<div class="mt-3 grid grid-cols-2 gap-2 text-xs text-slate-600">
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-indigo-500"></span>Undergrad</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-purple-500"></span>Masters</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-violet-500"></span>PhD</span>
<span class="flex items-center gap-2"><span class="h-3 w-3 rounded-full bg-cyan-400"></span>Fellowship</span>
</div>
</div>
<div class="card-surface rounded-2xl p-4 border-t-4 border-t-emerald-400 flex flex-col gap-3">
<div class="flex items-center justify-between">
<h3 class="text-sm font-semibold text-slate-800">Status</h3>
<span class="text-xs text-emerald-700 bg-emerald-50 px-2 py-1 rounded-full border border-emerald-100">Realtime</span>
</div>
<canvas id="chartStatus" height="120" aria-label="Active vs expired scholarships" role="img"></canvas>
<div class="grid grid-cols-2 gap-2 text-xs text-slate-600">
<div class="flex items-center gap-2">
<span class="h-3 w-3 rounded-full bg-emerald-500"></span> Active
</div>
<div class="flex items-center gap-2">
<span class="h-3 w-3 rounded-full bg-rose-500"></span> Expired
</div>
</div>
</div>
</div>
</section>
<!-- FAQ -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up" id="faq">
<h2 class="text-2xl font-semibold text-slate-900">FAQ</h2>
<div class="space-y-3">
{% if faq_items %}
{% for q in faq_items %}
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>{{ q }}</span>
<span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">
We provide step-by-step guidance inside each scholarship detail page. Use your dashboard to manage submissions and reminders.
</p>
</details>
{% endfor %}
{% else %}
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>How do I apply?</span><span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">Browse matches, open a scholarship detail page, and follow the application instructions.</p>
</details>
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>How do I track my application?</span><span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">Use your dashboard to monitor status, deadlines, and reminders.</p>
</details>
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>What documents are needed?</span><span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">Common items include transcripts, recommendation letters, ID, and statements of purpose.</p>
</details>
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>Can I save favorites?</span><span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">Yes—bookmark scholarships in your dashboard to revisit later.</p>
</details>
<details class="rounded-2xl bg-white border border-slate-200 p-4 shadow">
<summary class="cursor-pointer text-sm font-semibold text-slate-900 flex items-center justify-between">
<span>Do I get deadline reminders?</span><span class="text-slate-500">+</span>
</summary>
<p class="mt-2 text-sm text-slate-600">Enable notifications in your profile to get reminder emails ahead of deadlines.</p>
</details>
{% endif %}
</div>
</section>
<!-- Blog / Tips -->
<section class="mx-auto max-w-6xl px-4 mt-10 space-y-4 animate-fade-up">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-semibold text-slate-900">Tips & Articles</h2>
</div>
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{% for article in articles %}
<article class="card-surface rounded-2xl p-5 space-y-2">
<p class="text-xs uppercase tracking-wide text-indigo-500">{{ article.tag|default:"Guide" }}</p>
<h3 class="text-lg font-semibold text-slate-900 line-clamp-2">{{ article.title|default:"How to write a winning scholarship essay" }}</h3>
<p class="text-sm text-slate-600 line-clamp-3">{{ article.excerpt|default:"Actionable tips to help you stand out when applying." }}</p>
<a href="{{ article.url|default:'#' }}" class="text-indigo-600 hover:text-indigo-800 text-sm font-semibold inline-flex items-center gap-1">
Read more <span aria-hidden="true">→</span>
</a>
</article>
{% empty %}
<article class="card-surface rounded-2xl p-5 space-y-2">
<p class="text-xs uppercase tracking-wide text-indigo-500">Guide</p>
<h3 class="text-lg font-semibold text-slate-900">How to write a winning scholarship essay</h3>
<p class="text-sm text-slate-600">Actionable tips to help you stand out when applying.</p>
<a href="https://www.scholarships.com/financial-aid/college-scholarships/scholarship-application-strategies/essay-tips/" target="_blank" rel="noopener" class="text-indigo-600 hover:text-indigo-800 text-sm font-semibold inline-flex items-center gap-1">Read more →</a>
</article>
<article class="card-surface rounded-2xl p-5 space-y-2">
<p class="text-xs uppercase tracking-wide text-indigo-500">Checklist</p>
<h3 class="text-lg font-semibold text-slate-900">Scholarship application checklist</h3>
<p class="text-sm text-slate-600">Documents, deadlines, and reviewer expectations in one list.</p>
<a href="https://thescholarshipwhizz.org/the-scholarship-application-checklist-everything-you-need-to-succeed/" target="_blank" rel="noopener" class="text-indigo-600 hover:text-indigo-800 text-sm font-semibold inline-flex items-center gap-1">Read more →</a>
</article>
<article class="card-surface rounded-2xl p-5 space-y-2">
<p class="text-xs uppercase tracking-wide text-indigo-500">Strategy</p>
<h3 class="text-lg font-semibold text-slate-900">Stand out with recommendation letters</h3>
<p class="text-sm text-slate-600">How to brief referees and pick the right stories.</p>
<a href="https://www.indeed.com/career-advice/career-development/recommendation-letter-for-scholarship" target="_blank" rel="noopener" class="text-indigo-600 hover:text-indigo-800 text-sm font-semibold inline-flex items-center gap-1">Read more →</a>
</article>
{% endfor %}
</div>
</section>
<!-- Cards -->
<section id="scholarship-results" class="mx-auto max-w-6xl px-4 mt-10 space-y-8">
<div class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
<div>
<p class="text-xs uppercase tracking-[0.22em] text-indigo-500">Results</p>
<h2 class="text-2xl font-semibold text-slate-900">Available scholarships</h2>
{% if scholarships %}
<p class="text-sm text-slate-600">Showing {{ scholarships.start_index }}-{{ scholarships.end_index }} of {{ scholarships.paginator.count }} scholarships.</p>
{% else %}
<p class="text-sm text-slate-600">Use the filters above to narrow the scholarship list.</p>
{% endif %}
</div>
{% if scholarships %}
<span class="inline-flex items-center justify-center rounded-full border border-indigo-100 bg-indigo-50 px-4 py-2 text-sm font-semibold text-indigo-700 shadow-sm">
Page {{ scholarships.number }} of {{ scholarships.paginator.num_pages }}
</span>
{% endif %}
</div>
{% if scholarships %}
{# Scholarship cards grid #}
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
{% for scholarship in scholarships %}
<article
class="card-surface rounded-2xl overflow-hidden flex flex-col animate-fade-up hover:-translate-y-1 hover:shadow-2xl transition"
style="animation-delay: {{ forloop.counter0|add:'0' }}0ms;"
data-card-category="{{ scholarship.category|default:'general' }}"
>
{# Image with overlay; fallback image injected by JS if missing #}
<div class="relative h-48 overflow-hidden group">
{% if scholarship.image %}
<img
src="{{ scholarship.image.url }}"
alt="{{ scholarship.title }}"
class="w-full h-full object-cover transition duration-500 ease-out group-hover:scale-105"
data-card-image
/>
{% else %}
<img
src=""
alt="{{ scholarship.title }}"
class="w-full h-full object-cover transition duration-500 ease-out group-hover:scale-105"
data-card-image
data-use-fallback="true"
/>
{% endif %}
<div class="absolute inset-0 bg-gradient-to-t from-slate-900/75 via-slate-900/45 to-transparent"></div>
{# Badges top-left: country and category #}
<div class="absolute top-4 left-4 flex flex-wrap gap-2">
<span class="rounded-full px-3 py-1 text-xs font-medium text-emerald-800 bg-emerald-100 border border-emerald-200">
{% if scholarship.country %}{{ scholarship.country }}{% else %}Global{% endif %}
</span>
{% if scholarship.category %}
<span class="rounded-full px-3 py-1 text-xs font-medium text-indigo-800 bg-indigo-100 border border-indigo-200">
{{ scholarship.get_category_display }}
</span>
{% endif %}
</div>
{# Deadline pill bottom-right #}
{% if scholarship.deadline %}
<div class="absolute bottom-3 right-3 rounded-full px-3 py-1 text-xs font-semibold text-slate-900 bg-white/95 border border-slate-200 shadow">
Deadline: {{ scholarship.deadline }}
</div>
{% endif %}
</div>
{# Body #}
<div class="p-5 flex flex-col gap-3">
<div>
<h3 class="text-lg font-semibold text-slate-900">{{ scholarship.title }}</h3>
<p class="text-sm text-slate-600">
{% if scholarship.organization %}{{ scholarship.organization }}{% else %}TBA{% endif %}
</p>
</div>
{# Quick facts row #}
<div class="grid grid-cols-2 gap-3 text-sm text-slate-700">
<div>
<span class="text-slate-500 block text-xs uppercase tracking-wide">Amount</span>
{% if scholarship.amount_display %}
{{ scholarship.amount_display }}
{% elif scholarship.amount %}
{{ scholarship.amount }}
{% else %}
TBA
{% endif %}
</div>
<div>
<span class="text-slate-500 block text-xs uppercase tracking-wide">Level</span>
{% if scholarship.level %}
{{ scholarship.get_level_display|default:scholarship.level }}
{% else %}
TBA
{% endif %}
</div>
<div>
<span class="text-slate-500 block text-xs uppercase tracking-wide">Region</span>
{% if scholarship.country %}{{ scholarship.country }}{% else %}Global{% endif %}
</div>
<div>
<span class="text-slate-500 block text-xs uppercase tracking-wide">Category</span>
{% if scholarship.category %}{{ scholarship.get_category_display }}{% else %}TBA{% endif %}
</div>
</div>
{# Short description #}
{% if scholarship.description %}
<p class="text-sm text-slate-600 line-clamp-2">
{{ scholarship.description|truncatewords:28 }}
</p>
{% endif %}
{# Actions #}
<div class="mt-auto flex gap-2">
{% if request.user.is_authenticated %}
<a
href="{% url 'apply_scholarship' scholarship.id %}"
class="flex-1 h-11 inline-flex items-center justify-center rounded-xl bg-gradient-to-r from-indigo-500 via-purple-500 to-violet-500 text-white font-semibold shadow-lg shadow-indigo-500/35 transition duration-200 hover:-translate-y-0.5 hover:shadow-indigo-500/55 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-indigo-400/60 animate-gradient-x"
>
Apply
</a>
{% else %}
<a
href="{% url 'login' %}?next={% url 'apply_scholarship' scholarship.id %}"
class="flex-1 h-11 inline-flex items-center justify-center rounded-xl bg-gradient-to-r from-indigo-500 via-purple-500 to-violet-500 text-white font-semibold shadow-lg shadow-indigo-500/35 transition duration-200 hover:-translate-y-0.5 hover:shadow-indigo-500/55 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-indigo-400/60 animate-gradient-x"
>
Apply
</a>
{% endif %}
</div>
</div>
</article>
{% endfor %}
</div>
{% else %}
<div class="card-surface rounded-2xl p-6 text-slate-100 animate-fade-up">
No scholarships found{% if q %} for <strong class="font-semibold text-white">{{ q }}</strong>{% endif %}.
</div>
{% endif %}
{# Pagination: modern, responsive, preserves filters/search #}
{% if scholarships.has_other_pages %}
<div class="mt-8 bg-indigo-50 border border-indigo-100 rounded-xl p-4 shadow-lg shadow-indigo-500/20">
<div class="flex flex-wrap items-center justify-center gap-2 overflow-x-auto">
{# Prev button (only when a previous page exists) #}
{% if scholarships.has_previous %}
<a
href="?page={{ scholarships.previous_page_number }}{% for key,value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value|urlencode }}{% endif %}{% endfor %}#scholarship-results"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600 text-white text-sm font-medium hover:from-indigo-500 hover:to-purple-500 transition shadow-sm"
>
<span class="text-xs">‹</span> Prev
</a>
{% endif %}
{# Page numbers: show current ±2 (max 5 total), always using Page object #}
{% for num in scholarships.paginator.page_range %}
{% if num >= scholarships.number|add:'-2' and num <= scholarships.number|add:'2' %}
{% if num == scholarships.number %}
<span class="inline-flex items-center justify-center px-3 py-2 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600 text-white text-sm font-semibold shadow-sm border border-indigo-200">
{{ num }}
</span>
{% else %}
<a
href="?page={{ num }}{% for key,value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value|urlencode }}{% endif %}{% endfor %}#scholarship-results"
class="inline-flex items-center justify-center px-3 py-2 rounded-lg bg-white text-indigo-800 text-sm hover:bg-indigo-50 transition border border-indigo-100"
>
{{ num }}
</a>
{% endif %}
{% endif %}
{% endfor %}
{# Next button (only when a next page exists) #}
{% if scholarships.has_next %}
<a
href="?page={{ scholarships.next_page_number }}{% for key,value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value|urlencode }}{% endif %}{% endfor %}#scholarship-results"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600 text-white text-sm font-medium hover:from-indigo-500 hover:to-purple-500 transition shadow-sm"
>
Next <span class="text-xs">›</span>
</a>
{% endif %}