/* ===== Attaali - main stylesheet ===== */
:root{
  --brand:#4f46e5; --brand-2:#06b6d4; --brand-dark:#3730a3;
  --surface:#ffffff; --surface-2:#f6f7fb; --ink:#1e2233; --muted:#6b7280; --line:#e6e8f0;
  --radius:16px; --shadow:0 6px 24px rgba(30,34,51,.07); --shadow-lg:0 14px 40px rgba(79,70,229,.18);
  --blog-content-color:#000000; --blog-heading-color:#000000;
}
[data-bs-theme="dark"]{
  --surface:#171a26; --surface-2:#10121b; --ink:#e8eaf3; --muted:#9aa1b5; --line:#282c3d;
  --shadow:0 6px 24px rgba(0,0,0,.35); --shadow-lg:0 14px 40px rgba(0,0,0,.5);
  --bs-body-bg:#10121b; --bs-body-color:#e8eaf3;
  --blog-content-color:#ffffff; --blog-heading-color:#ffffff;
}
html{scroll-behavior:smooth}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:var(--surface-2);color:var(--ink);line-height:1.65}
a{color:var(--brand);text-decoration:none}
a:hover{color:var(--brand-dark);text-decoration:underline}
[data-bs-theme="dark"] a{color:#8b93ff}
.text-gradient{background:linear-gradient(90deg,var(--brand),var(--brand-2));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.btn-primary{--bs-btn-bg:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand-dark);--bs-btn-hover-border-color:var(--brand-dark);--bs-btn-active-bg:var(--brand-dark);--bs-btn-active-border-color:var(--brand-dark);--bs-btn-disabled-bg:var(--brand);--bs-btn-disabled-border-color:var(--brand)}
.btn-outline-primary{--bs-btn-color:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand);--bs-btn-hover-border-color:var(--brand)}
.form-control:focus,.form-select:focus{border-color:var(--brand);box-shadow:0 0 0 .2rem rgba(79,70,229,.18)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}

/* Navbar */
.site-nav{background:var(--surface);border-bottom:1px solid var(--line);box-shadow:0 2px 12px rgba(0,0,0,.03)}
.site-nav .navbar-brand{color:var(--ink);font-size:1.3rem}
.site-nav .nav-link{color:var(--ink);font-weight:500;border-radius:8px;padding:.5rem .8rem}
.site-nav .nav-link:hover{background:var(--surface-2);text-decoration:none}
.brand-mark{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:10px;color:#fff;background:linear-gradient(135deg,var(--brand),var(--brand-2));font-size:1.05rem}
.mega-menu{min-width:min(900px,94vw);border-radius:var(--radius);border:1px solid var(--line);box-shadow:var(--shadow-lg)}
@media(min-width:992px){.mega-menu{left:-120px}.navbar .dropdown:hover>.dropdown-menu{display:block}}
.mega-title{font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.4rem}
.mega-menu .dropdown-item{font-size:.92rem;padding:.35rem .6rem;white-space:normal}
.theme-toggle{border-color:var(--line);color:var(--ink)}

/* Hero */
.hero{position:relative;overflow:hidden;color:#fff;background:linear-gradient(135deg,#4338ca 0%,#4f46e5 45%,#0891b2 100%);padding:4.5rem 0 5rem;border-radius:0 0 40px 40px}
.hero::before,.hero::after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.08)}
.hero::before{width:380px;height:380px;top:-140px;right:-80px}
.hero::after{width:260px;height:260px;bottom:-120px;left:-60px}
.hero h1{font-weight:800;letter-spacing:-.02em}
.hero .lead{opacity:.92}
.hero-search{max-width:640px;margin:1.8rem auto 0}
.hero-search .form-control{border:0;padding:1rem 1.2rem;border-radius:14px 0 0 14px;font-size:1.05rem}
.hero-search .btn{border-radius:0 14px 14px 0;padding:0 1.5rem;background:#111827;border-color:#111827}
.hero-badges span{background:rgba(255,255,255,.15);border-radius:999px;padding:.3rem .9rem;font-size:.85rem;margin:.2rem}

/* Sections */
.section-title{font-weight:800;letter-spacing:-.01em}
.section-sub{color:var(--muted)}
.tool-card{display:block;height:100%;padding:1.25rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);transition:.2s;color:var(--ink)}
.tool-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg);border-color:var(--brand);text-decoration:none;color:var(--ink)}
.tool-icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;font-size:1.5rem;margin-bottom:.9rem}
.tool-icon.c-danger{background:rgba(220,53,69,.12);color:#dc3545}
.tool-icon.c-success{background:rgba(25,135,84,.12);color:#198754}
.tool-icon.c-warning{background:rgba(255,159,0,.15);color:#e08a00}
.tool-icon.c-primary{background:rgba(79,70,229,.12);color:var(--brand)}
.tool-card h3{font-size:1.05rem;font-weight:700;margin-bottom:.35rem}
.tool-card p{font-size:.9rem;color:var(--muted);margin:0}
.cat-pill{display:inline-flex;align-items:center;gap:.4rem;padding:.45rem 1rem;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--ink);font-weight:600;font-size:.9rem;cursor:pointer}
.cat-pill:hover,.cat-pill.active{background:var(--brand);color:#fff;border-color:var(--brand);text-decoration:none}
.feature-box{text-align:center;padding:1.5rem}
.feature-box i{font-size:2rem;color:var(--brand)}

/* Blog */
.post-card{overflow:hidden;height:100%;transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease;box-shadow:0 8px 26px rgba(30,34,51,.05)}
.post-card:hover{transform:translateY(-7px);box-shadow:var(--shadow-lg);border-color:rgba(79,70,229,.35)}
.thumb-wrap{position:relative;background:linear-gradient(135deg,rgba(79,70,229,.12),rgba(6,182,212,.13));overflow:hidden}
.post-thumb{display:block;position:relative;aspect-ratio:2/1;overflow:hidden;background:var(--surface-2)}
.post-card img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .45s ease}
.post-card:hover img{transform:scale(1.045)}
.thumb-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(15,23,42,.03) 35%,rgba(15,23,42,.58) 100%);pointer-events:none}
.thumb-icon{position:absolute;right:1rem;top:1rem;width:42px;height:42px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.5);border-radius:12px;background:rgba(15,23,42,.34);backdrop-filter:blur(7px);color:#fff;font-size:1.1rem}
.post-category{position:absolute;left:1rem;bottom:1rem;z-index:1;display:inline-flex;align-items:center;gap:.4rem;padding:.42rem .75rem;border-radius:8px;background:var(--category-color);color:#fff;box-shadow:0 5px 14px rgba(15,23,42,.18);font-size:.75rem;font-weight:700;letter-spacing:.01em}
.post-category:hover{color:#fff;filter:brightness(.95);text-decoration:none}
.post-card .card-body{padding:1.45rem 1.25rem 1.15rem}
.post-kicker{display:flex;align-items:center;gap:.35rem;margin:.2rem 0 .65rem;color:var(--brand);font-size:.72rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.post-kicker i{font-size:.8rem}
.post-card .card-title{line-height:1.28;min-height:2.56em}
.post-card .card-title a{color:var(--ink)}
.post-card .card-title a:hover{color:var(--brand);text-decoration:none}
.post-card .excerpt{color:var(--muted);font-size:.91rem;line-height:1.65;margin-bottom:1.25rem}
.post-footer{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-top:1rem;border-top:1px solid var(--line)}
.post-author{display:flex;align-items:center;gap:.6rem;min-width:0}
.avatar{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:10px;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;font-size:.9rem}
.post-author .meta{min-width:0}
.post-author .name{font-size:.8rem;font-weight:700;line-height:1.2}
.post-author .time{margin-top:.18rem;color:var(--muted);font-size:.72rem;white-space:nowrap}
.post-author .time i{font-size:.7rem}
.meta-dot{padding:0 .18rem;color:var(--line)}
.post-arrow{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border:1px solid var(--line);border-radius:10px;color:var(--brand);transition:.2s;position:relative;z-index:10;cursor:pointer;text-decoration:none}
.post-card:hover .post-arrow{background:var(--brand);border-color:var(--brand);color:#fff;transform:rotate(45deg)}
.post-meta{font-size:.82rem;color:var(--muted)}
.badge-cat{background:rgba(79,70,229,.12);color:var(--brand);font-weight:600}
.article{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:2rem}
@media(max-width:576px){.article{padding:1.1rem}}
/* Blog Content Adaptive Colors (Black in Light Mode, White in Dark Mode) */
.article-content,
.article-body{
  font-size:1.08rem;
  line-height:1.85;
  color:var(--blog-content-color) !important;
}

.article-content p,
.article-content span,
.article-content li,
.article-content ol,
.article-content ul,
.article-content div:not(.alert):not(.btn):not([class*="code"]):not(.article-callout),
.article-content td,
.article-content th,
.article-content tr,
.article-content caption,
.article-content em,
.article-content i:not([class*="bi"]),
.article-content u,
.article-content s,
.article-content small,
.article-body p,
.article-body span,
.article-body li,
.article-body ol,
.article-body ul,
.article-body div:not(.alert):not(.btn):not([class*="code"]):not(.ad-box),
.article-body td,
.article-body th,
.article-body tr,
.article-body em,
.article-body i:not([class*="bi"]),
.article-body small{
  color:var(--blog-content-color) !important;
  background-color:transparent !important;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6,
.article-content strong,
.article-content b,
.article-content h1 *,
.article-content h2 *,
.article-content h3 *,
.article-content h4 *,
.article-content h5 *,
.article-content h6 *,
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.article-body strong,
.article-body b,
.article-body h1 *,
.article-body h2 *,
.article-body h3 *,
.article-body h4 *,
.article-body h5 *,
.article-body h6 *{
  color:var(--blog-heading-color) !important;
  background-color:transparent !important;
}

.article-content a,
.article-content a *,
.article-body a,
.article-body a *{
  color:var(--brand) !important;
  background-color:transparent !important;
  text-decoration:underline;
}
.article-content a:hover,
.article-content a:hover *,
.article-body a:hover,
.article-body a:hover *{
  color:var(--brand-dark) !important;
}
[data-bs-theme="dark"] .article-content a,
[data-bs-theme="dark"] .article-content a *,
[data-bs-theme="dark"] .article-body a,
[data-bs-theme="dark"] .article-body a *{
  color:#8b93ff !important;
}
[data-bs-theme="dark"] .article-content a:hover,
[data-bs-theme="dark"] .article-content a:hover *,
[data-bs-theme="dark"] .article-body a:hover,
[data-bs-theme="dark"] .article-body a:hover *{
  color:#b4baff !important;
}

.article-content img,
.article-body img{
  max-width:100%;
  height:auto;
  border-radius:12px;
  margin:1rem 0;
}

.article-content h2, .article-body h2{font-size:1.6rem;margin-top:2rem;font-weight:700}
.article-content h3, .article-body h3{font-size:1.25rem;margin-top:1.6rem;font-weight:700}
.article-content h4, .article-body h4{font-size:1.1rem;margin-top:1.3rem;font-weight:700}

.article-content table, .article-body table{width:100%;margin:1rem 0;border-collapse:collapse}
.article-content table td,.article-content table th,
.article-body table td,.article-body table th{border:1px solid var(--line) !important;padding:.6rem .75rem}

.article-content blockquote, .article-body blockquote{
  border-left:4px solid var(--brand) !important;
  padding:.7rem 1.2rem;
  background:var(--surface-2) !important;
  border-radius:0 8px 8px 0;
  margin:1.4rem 0;
}
[data-bs-theme="dark"] .article-content blockquote,
[data-bs-theme="dark"] .article-body blockquote{
  border-left-color:#8b93ff !important;
  background:rgba(255,255,255,.05) !important;
}
.article-content blockquote *,
.article-body blockquote *{
  color:var(--blog-content-color) !important;
}

.article-content pre, .article-body pre{
  background:#0f172a !important;
  color:#e2e8f0 !important;
  padding:1rem;
  border-radius:10px;
  overflow:auto;
}
.article-content pre *, .article-body pre *{
  color:#e2e8f0 !important;
  background-color:transparent !important;
}
.article-content code:not(pre code), .article-body code:not(pre code){
  background:rgba(79,70,229,.1) !important;
  color:var(--brand) !important;
  padding:.15rem .4rem;
  border-radius:4px;
  font-size:.9em;
}
[data-bs-theme="dark"] .article-content code:not(pre code),
[data-bs-theme="dark"] .article-body code:not(pre code){
  background:rgba(139,147,255,.16) !important;
  color:#c7d2fe !important;
}
.sidebar .card-header{background:transparent;font-weight:700}
.share-btn{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .9rem;border-radius:8px;color:#fff !important;font-size:.88rem;text-decoration:none !important}
.share-fb{background:#1877f2}.share-tw{background:#111}.share-wa{background:#25d366}.share-in{background:#0a66c2}

/* Tool page */
.tool-shell{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.5rem}
.tool-header-icon{width:64px;height:64px;font-size:1.8rem;margin:0}
.drop-zone{border:2px dashed var(--line);border-radius:var(--radius);padding:2.2rem 1rem;text-align:center;cursor:pointer;transition:.2s;background:var(--surface-2)}
.drop-zone:hover,.drop-zone.dragover{border-color:var(--brand);background:rgba(79,70,229,.06)}
.drop-zone i{font-size:2.4rem;color:var(--brand)}
.file-item{display:flex;align-items:center;gap:.75rem;padding:.55rem .75rem;border:1px solid var(--line);border-radius:12px;background:var(--surface);margin-bottom:.5rem}
.file-item img{width:52px;height:52px;object-fit:cover;border-radius:8px}
.file-item .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.92rem}
.preview-box{background:repeating-conic-gradient(#d9dbe3 0 25%,#fff 0 50%) 50%/20px 20px;border-radius:12px;padding:.5rem;text-align:center;overflow:auto;max-height:520px}
[data-bs-theme="dark"] .preview-box{background:repeating-conic-gradient(#2a2e40 0 25%,#1c1f2e 0 50%) 50%/20px 20px}
.preview-box canvas,.preview-box img{max-width:100%;height:auto}
.result-thumb{border:1px solid var(--line);border-radius:12px;padding:.6rem;background:var(--surface);text-align:center}
.result-thumb img{max-width:100%;max-height:200px;border-radius:8px}
.stat-box{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:.8rem;text-align:center}
.stat-box .n{font-size:1.5rem;font-weight:800;color:var(--brand)}
.stat-box .l{font-size:.78rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
textarea.tool-text{min-height:220px;font-family:inherit}
.ai-prompt-panel{height:100%;padding:1.25rem;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.tool-mini-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:rgba(79,70,229,.12);color:var(--brand)}
.ai-image-preview{position:relative;display:grid;place-items:center;min-height:430px;padding:1rem;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:repeating-conic-gradient(#e4e7ef 0 25%,#f8f9fc 0 50%) 50%/24px 24px}
[data-bs-theme="dark"] .ai-image-preview{background:repeating-conic-gradient(#292d3b 0 25%,#1c1f2a 0 50%) 50%/24px 24px}
.ai-image-preview img{display:block;max-width:100%;max-height:620px;width:auto;height:auto;border-radius:8px;box-shadow:0 8px 24px rgba(15,23,42,.18)}
.ai-actions{display:flex}
.ai-empty-state,.ai-loading{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.5rem;padding:2rem;text-align:center;color:var(--muted)}
.ai-empty-state i{font-size:3rem;color:var(--brand)}
.ai-empty-state strong,.ai-loading strong{color:var(--ink)}
.ai-loading .spinner-border{width:2.5rem;height:2.5rem;color:var(--brand);margin-bottom:.35rem}
.mono{font-family:SFMono-Regular,Menlo,Consolas,monospace !important;font-size:.9rem}
.steps-list li{margin-bottom:.5rem}
.accordion{--bs-accordion-bg:var(--surface);--bs-accordion-border-color:var(--line);--bs-accordion-btn-bg:var(--surface);--bs-accordion-active-bg:rgba(79,70,229,.08);--bs-accordion-active-color:var(--brand)}
#qrOut canvas,#qrOut img{max-width:100%}
.strength-bar{height:8px;border-radius:99px;background:var(--line);overflow:hidden}
.strength-bar div{height:100%;width:0;transition:.3s}

/* Footer & misc */
.site-footer{background:var(--surface);border-top:1px solid var(--line)}
.footer-links li{margin-bottom:.4rem}
.footer-links a{color:var(--muted)}
.footer-links a:hover{color:var(--brand)}
.social-btn{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line);color:var(--ink)}
.social-btn:hover{background:var(--brand);color:#fff;text-decoration:none}
.cookie-bar{position:fixed;left:0;right:0;bottom:0;z-index:1080;background:var(--surface);border-top:1px solid var(--line);padding:.9rem 0;box-shadow:0 -6px 24px rgba(0,0,0,.1)}
.to-top{position:fixed;right:18px;bottom:18px;width:44px;height:44px;border-radius:50%;border:0;background:var(--brand);color:#fff;z-index:1070;box-shadow:var(--shadow-lg)}
.ad-wrap{overflow:hidden;min-height:0}
.breadcrumb{--bs-breadcrumb-divider-color:var(--muted);font-size:.88rem}
.toast-lite{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#111827;color:#fff;padding:.6rem 1.2rem;border-radius:10px;z-index:2000;font-size:.92rem;box-shadow:var(--shadow-lg)}

/* Admin (shared) */
.admin-body{background:var(--surface-2)}
.admin-side{width:250px;min-height:100vh;background:#111827;color:#cbd5e1}
.admin-side a{color:#cbd5e1;display:flex;align-items:center;gap:.6rem;padding:.65rem 1.2rem;border-radius:10px;margin:2px 10px;text-decoration:none}
.admin-side a:hover,.admin-side a.active{background:rgba(255,255,255,.1);color:#fff}
.admin-side .brand{color:#fff;font-weight:800;font-size:1.15rem;padding:1.2rem 1.4rem}
.admin-main{flex:1;min-width:0}
.stat-card{border-radius:var(--radius);color:#fff;padding:1.2rem}
.stat-card .num{font-size:2rem;font-weight:800;line-height:1}
.g1{background:linear-gradient(135deg,#4f46e5,#7c3aed)}.g2{background:linear-gradient(135deg,#0891b2,#06b6d4)}
.g3{background:linear-gradient(135deg,#059669,#10b981)}.g4{background:linear-gradient(135deg,#d97706,#f59e0b)}
@media(max-width:991px){.admin-side{width:100%;min-height:auto}}

