/* عراق سوفت - template library: luxurious indigo → turquoise gradient, frosted glass */
:root {
    --indigo: #2b2a86;
    --indigo-deep: #1a1850;
    --turq: #12b5b0;
    --grad: linear-gradient(120deg, #3b36b8 0%, #2f5fc0 50%, #12a9b0 100%);
    --title: #26247a;        /* headings on cards: rich indigo */
    --ink: #1f1f4d;
    --text: #5c6080;
    --muted: #8d90ab;
    --glass: rgba(255, 255, 255, .12);
    --glass-strong: rgba(255, 255, 255, .2);
    --glass-line: rgba(255, 255, 255, .26);
    --card: rgba(255, 255, 255, .86);
    --edge: rgba(38, 36, 122, .10);
    --blur: blur(22px) saturate(160%);
    --shadow: 0 18px 44px -18px rgba(8, 6, 50, .55);
    --shadow-lg: 0 30px 64px -20px rgba(8, 6, 50, .65), 0 0 0 1px rgba(255, 255, 255, .5);
    --radius: 20px;
    --font: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--indigo-deep); }
body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.35; color: var(--title); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #7fe6df; outline-offset: 3px; border-radius: 8px; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.icon { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------- Background: indigo → turquoise with soft light and slow waves ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background:
        radial-gradient(800px 600px at 0% 0%, rgba(40, 8, 70, .8), transparent 65%),
        radial-gradient(800px 600px at 100% 0%, rgba(40, 8, 70, .8), transparent 65%),
        radial-gradient(900px 700px at 0% 100%, rgba(18, 160, 160, .32), transparent 60%),
        radial-gradient(700px 500px at 50% 50%, rgba(255, 255, 255, .06), transparent 70%),
        linear-gradient(150deg, #1c0a38 0%, #221150 18%, #27166a 40%, #2b1b7a 60%, #2a1f7e 74%, #1e5a7e 90%, #139b9c 100%);
}
.wave { position: absolute; left: 0; right: 0; background-repeat: repeat-x; background-size: 1600px 100%; will-change: background-position; }
.wave-1 { bottom: 0; height: 46vh; opacity: .55; animation: drift 70s linear infinite;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 400' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='.10'/%3E%3Cstop offset='1' stop-color='%2312b5b0' stop-opacity='.22'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 140 C 270 60 530 60 800 140 S 1330 220 1600 140 V 400 H 0 Z' fill='url(%23a)'/%3E%3C/svg%3E"); }
.wave-2 { bottom: 0; height: 36vh; opacity: .6; animation: drift 52s linear infinite reverse;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 400' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%2312b5b0' stop-opacity='.16'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='.08'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 180 C 260 260 540 260 800 180 S 1340 100 1600 180 V 400 H 0 Z' fill='url(%23b)'/%3E%3C/svg%3E"); }
.wave-3 { top: 0; height: 34vh; opacity: .5; transform: scaleY(-1); animation: drift 90s linear infinite;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 400' preserveAspectRatio='none'%3E%3Cpath d='M0 200 C 270 120 530 120 800 200 S 1330 280 1600 200 V 400 H 0 Z' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"); }
@keyframes drift { to { background-position-x: 1600px; } }

/* ---------- Top bar (glass on indigo) ---------- */
.top { position: sticky; top: 16px; z-index: 50; margin-top: 16px; }
.top-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; padding: 0 12px 0 20px;
    background: rgba(26, 24, 80, .38); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: 0 14px 34px -16px rgba(8, 6, 50, .6), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 42px; width: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.brand strong { display: block; font-size: 18px; font-weight: 700; color: #fff; line-height: 1.3; }
.brand small { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .62); font-weight: 500; }
.top-end { display: flex; align-items: center; gap: 10px; }
.count { font-size: 13px; color: rgba(255, 255, 255, .78); padding: 7px 13px; border-radius: 11px; background: rgba(255, 255, 255, .1); border: 1px solid var(--glass-line); white-space: nowrap; }
.count b { color: #fff; }
.wa { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; background: linear-gradient(120deg, #22c3b8, #12a0b0); color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: 0 8px 20px -6px rgba(18, 181, 176, .6); transition: transform .2s, box-shadow .2s; }
.wa:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(18, 181, 176, .7); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 26px; }
.chip {   /* category chips: white; the selected one turns solid turquoise */
    border: 1px solid #fff; background: #fff; color: var(--title); padding: 8px 18px; border-radius: 12px;
    font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 18px -10px rgba(8, 6, 50, .6); transition: all .2s;
}
.chip span { color: #12a3ad; font-size: 11.5px; margin-inline-start: 6px; }
.chip:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(8, 6, 50, .7); }
.chip.active { background: linear-gradient(120deg, #1fc6bd, #12a3ad); border-color: #3fd8cf; color: #fff; box-shadow: 0 8px 22px -8px rgba(18, 181, 176, .8); }
.chip.active span { color: rgba(255, 255, 255, .8); }

/* ---------- Template cards ---------- */
/* ---------- Templates as name-only links ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px 0 56px; }
.card {
    display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px 14px 14px; border-radius: 16px;
    background: #fff; border: 1px solid #fff; box-shadow: 0 10px 26px -14px rgba(8, 6, 50, .6);
    transition: background .25s, border-color .25s, transform .25s, box-shadow .25s; animation: rise .45s backwards;
}
.card:hover { border-color: #3fd8cf; transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(8, 6, 50, .7), 0 0 0 1px #3fd8cf; }
.card.hide { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.code { flex-shrink: 0; min-width: 50px; text-align: center; padding: 7px 9px; border-radius: 11px; background: linear-gradient(120deg, #1fc6bd, #12a3ad); color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: 1px; direction: ltr; box-shadow: 0 6px 16px -6px rgba(18, 181, 176, .7); }
.card h3 { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; color: var(--title); }
.card .go { color: #b3b5cf; transition: color .25s, transform .25s; }
.card:hover .go { color: #12a3ad; transform: translateX(-4px); }

/* ---------- Footer ---------- */
.foot { text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .6); padding: 6px 0 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) {
    .container { padding: 0 16px; }
    .top { top: 10px; margin-top: 10px; }
    .top-inner { height: 60px; padding: 0 8px 0 14px; }
    .brand img { height: 36px; }
    .brand small, .count, .wa span { display: none; }
    .wa { width: 42px; padding: 0; justify-content: center; }
    .grid { grid-template-columns: 1fr; gap: 20px; }
    .filters { flex-wrap: nowrap; overflow-x: auto; margin: 20px -16px; padding: 2px 16px 6px; scrollbar-width: none; }
    .filters::-webkit-scrollbar { display: none; }
    .chip { flex-shrink: 0; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .top-inner, .chip { background: rgba(26, 24, 80, .85); }
    .card { background: rgba(255, 255, 255, .96); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
