/* ===== Colors ===== */
:root {
    --blue: #1a56db;
    --blue-m: #2563eb;
    --blue-l: #eff6ff;
    --blue-b: #bfdbfe;
    --blue-d: #1e40af;

    --green: #0a6640;
    --green-l: #e8f5ee;
    --green-b: #b8dfc9;

    --purple: #6d28d9;
    --purple-l: #f3f0ff;
    --purple-b: #c4b5fd;

    --rose: #e11d48;
    --rose-l: #fff1f2;
    --rose-b: #fecdd3;

    --amber: #d97706;
    --amber-l: #fffbeb;
    --amber-b: #fde68a;

    --teal: #0d9488;
    --teal-l: #f0fdfa;
    --teal-b: #99f6e4;

    --text: #0f172a;
    --text2: #475569;
    --muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --surface: #f1f5f9;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

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

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: 64px;
    transition: box-shadow .2s;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo .dot {
    width: 8px;
    height: 8px;
    background: var(--blue);
    border-radius: 50%;
}

.search-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all .15s;
}

.search-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-l);
}

/* ===== Hero ===== */
.hero {
    padding: 56px 0 48px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: center;
}

.hero-text h1 {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 14px;
    color: var(--text);
}

.hero-text h1 span {
    color: var(--blue);
}

.hero-text p {
    font-size: 16px;
    color: var(--text2);
    line-height: 1.8;
    margin-bottom: 24px;
}

.hero-stats {
    display: flex;
    gap: 28px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .num {
    font-size: 28px;
    font-weight: 900;
    color: var(--blue);
}

.hero-stat .label {
    font-size: 13px;
    color: var(--text2);
}

/* Hero Card */
.hero-card {
    background: var(--blue);
    border-radius: var(--radius-xl);
    padding: 28px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    top: -50px;
    left: -50px;
}

.hero-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -30px;
    right: -30px;
}

.hero-card h3 {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 18px;
    position: relative;
}

.hero-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
}

.hero-shortcut {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    color: var(--white);
    transition: all .15s;
    display: block;
}

.hero-shortcut:hover {
    background: rgba(255,255,255,.2);
    color: var(--white);
    transform: translateY(-1px);
}

.hero-shortcut .emoji {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
}

.hero-shortcut .name {
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-text h1 { font-size: 26px; }
    .hero-stats { gap: 20px; }
    .hero-stat .num { font-size: 22px; }
}

/* ===== Sections ===== */
.section {
    padding: 48px 0;
}

.section-white {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-head h2 {
    font-size: 20px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-head h2 .emoji {
    font-size: 24px;
}

.section-head a {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    transition: opacity .15s;
}

.section-head a:hover { opacity: .7; }

/* ===== Tools Grid ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1024px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tools-grid { grid-template-columns: 1fr; } }

/* ===== Tool Card ===== */
.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: block;
    transition: all .2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tool-card:hover.cat-health { border-color: var(--green); }
.tool-card:hover.cat-islamic { border-color: var(--purple); }
.tool-card:hover.cat-date { border-color: var(--blue); }
.tool-card:hover.cat-creative { border-color: var(--rose); }
.tool-card:hover.cat-utility { border-color: var(--amber); }
.tool-card:hover.cat-finance { border-color: var(--green); }
.tool-card:hover.cat-national { border-color: #16a34a; }
.tool-card:hover.cat-fun { border-color: var(--rose); }

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.tool-icon.cat-health { background: var(--green-l); }
.tool-icon.cat-islamic { background: var(--purple-l); }
.tool-icon.cat-date { background: var(--blue-l); }
.tool-icon.cat-creative { background: var(--rose-l); }
.tool-icon.cat-utility { background: var(--amber-l); }
.tool-icon.cat-finance { background: var(--green-l); }
.tool-icon.cat-national { background: #ecfdf5; }
.tool-icon.cat-fun { background: var(--rose-l); }

.tool-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 13px;
    color: var(--text2); /* improved contrast for accessibility */
    line-height: 1.5;
}

/* ===== Category Filter ===== */
.cat-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cat-filter a {
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text2);
    background: var(--white);
    transition: all .15s;
}

.cat-filter a:hover {
    border-color: var(--blue-b);
    color: var(--blue);
}

.cat-filter a.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* ===== Breadcrumbs ===== */
.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin: 0 8px;
    color: var(--border);
}

.breadcrumb-item a {
    color: var(--muted);
    transition: color .15s;
}

.breadcrumb-item a:hover {
    color: var(--blue);
}

.breadcrumb-item.active {
    color: var(--text2);
}

/* ===== Footer ===== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 48px 0 20px;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand {
    font-size: 22px;
    font-weight: 900;
    color: var(--blue);
    margin-bottom: 10px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.8;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: .3px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    font-size: 14px;
    color: var(--text2);
    transition: color .15s;
}

.footer-col a:hover {
    color: var(--blue);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ===== 404 ===== */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page h1 {
    font-size: 72px;
    font-weight: 900;
    color: var(--blue);
}

.error-page p {
    color: var(--text2);
    margin: 8px 0 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    transition: background .15s;
}

.btn-primary:hover {
    background: var(--blue-d);
    color: var(--white);
}
