/* Winixx Support public site: homepage + knowledge base.
   Fonts and images are served from /fonts and /img (copy them from the static site into public/). */

@font-face { font-family: "Gotham"; src: url("/fonts/gotham/Gotham-Book.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/gotham/Gotham-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gotham"; src: url("/fonts/gotham/Gotham-Bold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/fonts/montserrat/Montserrat-SemiBold.woff2") format("woff2"), url("/fonts/montserrat/Montserrat-SemiBold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --winixx-blue: #0B5CFF;
  --winixx-blue-dark: #0044cc;
  --winixx-blue-tint: #EAF1FF;
  --font-body: "Gotham", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --section-bg: #f8f9fa;
  --border-soft: #e9ebef;
  --header-h: 72px;
}

html, body { font-family: var(--font-body); margin: 0; }
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; overflow-x: clip; }
img, video { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--winixx-blue); outline-offset: 2px; }

/* HEADER */
.header { width: 100%; background: #fff; border-bottom: 1px solid #eaeaea; position: sticky; top: 0; z-index: 999; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; flex-shrink: 0; }
.brand-logo img { height: 26px; width: auto; display: block; }
.brand-sep { width: 1px; height: 42px; background: #c9c7c7; }
.brand-support { text-decoration: none; color: #A8A6A6; font-weight: 400; font-size: 21px; line-height: 1; transform: translateY(2px); }
.brand-support:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-right { display: flex; align-items: center; gap: 20px; }

.language-dropdown { position: relative; display: inline-block; }
.language-btn { background: none; border: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: #111; }
.language-icon { width: 20px; height: 20px; }
.dropdown-content { display: none; position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid #eaeaea; border-radius: 12px; min-width: 220px; padding: 8px 0; z-index: 2000; margin-top: 8px; }
.dropdown-content a { display: block; padding: 10px 16px; color: #111; text-decoration: none; font-size: 14px; }
.dropdown-content a:hover { background: #f6f6f6; }
.dropdown-content a[aria-current="true"] { font-weight: 600; color: var(--winixx-blue); }
.dropdown-content hr { margin: 6px 0; border: none; border-top: 1px solid #eaeaea; }
.language-dropdown:hover .dropdown-content, .language-dropdown:focus-within .dropdown-content { display: block; }

/* HEADER SEARCH (article pages) */
.header-search { display: flex; align-items: center; }
.search-toggle { background: none; border: none; cursor: pointer; padding: 8px; display: flex; align-items: center; z-index: 3; }
.search-toggle img { width: 20px; height: 20px; }
.search-expanded { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; opacity: 0; visibility: hidden; width: 0; overflow: visible; transition: opacity .25s ease, width .25s ease; z-index: 2; }
.search-expanded.active { opacity: 1; visibility: visible; width: 320px; background: #fff; }
.search-input-wrapper { position: relative; width: 100%; }
.search-expanded input { border: none; outline: none; background: transparent; font-size: 15px; width: 100%; padding: 8px 40px 8px 0; color: #111; font-family: var(--font-body); }
.search-input-line { position: absolute; left: 0; bottom: 0; height: 2px; background: #ccc; width: 100%; transition: background .3s; }
.search-expanded input:focus + .search-input-line { background: var(--winixx-blue); }
.header-search .search-results { top: calc(100% + 14px); min-width: 340px; right: 0; left: auto; }

/* HERO + SEARCH (homepage) */
.hero { width: 100%; background-color: #0a2a66; background-image: url('/img/background.png'); background-size: cover; background-position: center; padding: 120px 0 100px; text-align: center; color: #fff; }
.hero-content { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.hero h1 { font-family: var(--font-head); font-size: 48px; font-weight: 600; margin: 0 0 16px; }
.hero p { font-size: 20px; margin: 0 auto 40px; max-width: 700px; }
.search-wrapper { position: relative; }
.hero .search-wrapper { max-width: 640px; margin: 0 auto; }
.search-form { display: flex; box-shadow: 0 8px 24px rgba(0,0,0,.2); border-radius: 999px; overflow: hidden; }
.search-form input { flex: 1; min-width: 0; padding: 16px 24px; font-size: 18px; border: none; outline: none; background: #fff; font-family: var(--font-body); }
.search-form button { padding: 16px 32px; background: #fff; color: #000; border: none; cursor: pointer; font-size: 18px; font-weight: 500; transition: background .3s, color .3s; font-family: var(--font-body); }
.search-form button:hover { background: #000; color: #fff; }

.search-results { display: none; position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.18); max-height: 420px; overflow-y: auto; z-index: 100; text-align: left; color: #111; }
.search-results.active { display: block; }
.search-result-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.search-result-item:last-of-type { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus-visible { background: #f8f9fa; }
.search-result-icon { width: 36px; height: 36px; border-radius: 8px; background: #f1f5f9; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.search-result-icon img { width: 22px; height: 22px; object-fit: contain; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-product { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--winixx-blue); margin-bottom: 3px; }
.search-result-title { font-size: 15px; font-weight: 500; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-excerpt { font-size: 13px; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-title mark { background: #fef9c3; color: #111; border-radius: 2px; padding: 0 2px; }
.search-no-results { padding: 24px 20px; text-align: center; color: #999; font-size: 14px; font-style: italic; }
.search-footer { padding: 10px 20px; border-top: 1px solid #f1f5f9; font-size: 12px; color: #aaa; text-align: right; }

/* PRODUCTS */
.products-section { padding: 80px 24px; background: var(--section-bg); text-align: center; }
.products-section h2, .faqs-section h2 { font-family: var(--font-head); font-size: 36px; margin: 0 0 16px; color: #111; }
.products-section > p, .faqs-section > p { font-size: 18px; color: #555; margin: 0 auto 48px; max-width: 800px; }
.products-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 1080px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { .products-grid { grid-template-columns: 1fr; } }
.product-card-wrap { position: relative; }
.product-card { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; border-radius: 20px; padding: 28px 18px; text-decoration: none; color: #111; border: 1px solid var(--border-soft); box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: transform .18s ease, border-color .18s ease; height: 216px; }
.product-card:hover { transform: translateY(-4px); border-color: var(--winixx-blue); }
.product-icon { width: 68px; height: 68px; margin-bottom: 18px; object-fit: contain; }
.product-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.product-desc { font-size: 13px; color: #666; line-height: 1.5; text-align: center; max-width: 168px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-badge { position: absolute; top: 12px; right: 12px; background: var(--winixx-blue); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; z-index: 1; box-shadow: 0 2px 6px rgba(11,92,255,.35); }

/* FAQS */
.faqs-section { padding: 80px 24px; background: #fff; text-align: center; }
.faqs-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; max-width: 900px; margin: 0 auto; text-align: left; }
@media (max-width: 700px) { .faqs-grid { grid-template-columns: 1fr; } }
.faq-item { background: var(--section-bg); border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; transition: border-color .18s ease, background .18s ease; }
.faq-item[open] { background: #fff; border-color: #cfe0ff; box-shadow: 0 8px 20px rgba(16,24,40,.06); }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 16px; font-weight: 500; color: #111; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--winixx-blue); }
.faq-toggle { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; position: relative; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.faq-item[open] .faq-toggle { background: var(--winixx-blue); border-color: var(--winixx-blue); transform: rotate(135deg); }
.faq-toggle::before, .faq-toggle::after { content: ''; position: absolute; background: #111; border-radius: 1px; }
.faq-toggle::before { width: 10px; height: 1.6px; }
.faq-toggle::after { width: 1.6px; height: 10px; }
.faq-item[open] .faq-toggle::before, .faq-item[open] .faq-toggle::after { background: #fff; }
.faq-answer { padding: 0 20px 18px; font-size: 14px; color: #555; line-height: 1.6; margin: 0; }

/* FOOTER */
.subfooter { background: var(--section-bg); color: #000; padding: 32px 24px; font-size: 12px; }
.subfooter-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sub-left { color: #333; }
.sub-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-link { color: #333; text-decoration: none; }
.sub-link:hover { color: #000; text-decoration: underline; text-underline-offset: 3px; }
.sub-sep { color: #888; user-select: none; }

/* KNOWLEDGE BASE LAYOUT */
.kb-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; background: #fff; border-right: 1px solid #eaeaea; padding: 32px 24px; }
.sidebar-product { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.sidebar-product img { width: 40px; height: 40px; flex-shrink: 0; }
.sidebar hr { margin: 16px 0 16px; border: none; border-top: 1px solid #eaeaea; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list a { display: block; padding: 12px 16px; margin: 0 -16px; font-size: 15px; color: #333; text-decoration: none; border-left: 4px solid transparent; transition: background .15s, color .15s; }
.article-list a:hover { color: var(--winixx-blue); background: #f8f9fa; border-left-color: var(--winixx-blue); }
.article-list a.active { font-weight: 600; color: var(--winixx-blue); background: #f0f7ff; border-left-color: var(--winixx-blue); }
.draft-badge { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #92400e; background: #fef3c7; border-radius: 999px; vertical-align: middle; }

.main-content { padding: 40px 48px 100px; max-width: 900px; min-width: 0; }
.breadcrumbs { font-size: 13px; color: #888; margin-bottom: 20px; }
.breadcrumbs a { color: #888; text-decoration: none; }
.breadcrumbs a:hover { color: var(--winixx-blue); text-decoration: underline; }

.article-content h1 { font-size: 34px; margin: 0 0 8px; color: #111; line-height: 1.25; }
.article-meta { font-size: 13px; color: #888; margin: 0 0 28px; }
.article-body h2 { font-size: 24px; margin: 36px 0 14px; color: #111; position: relative; }
.article-body h3 { font-size: 19px; margin: 28px 0 12px; color: #222; position: relative; }
.article-body p { font-size: 16px; line-height: 1.7; margin: 0 0 18px; color: #333; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-inline-start: 28px; }
.article-body li { margin-bottom: 8px; line-height: 1.65; color: #333; }
.article-body a { color: var(--winixx-blue); }
.article-body img { border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.1); margin: 20px 0; }
.article-body blockquote { margin: 20px 0; padding: 12px 18px; background: var(--winixx-blue-tint); border-inline-start: 4px solid var(--winixx-blue); border-radius: 8px; }
.article-body blockquote p { margin: 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid #e5e7eb; padding: 10px 14px; text-align: start; }
.article-body th { background: #f8f9fa; }
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.article-body pre { position: relative; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 20px 20px 20px; overflow-x: auto; margin: 22px 0; font-size: 14px; line-height: 1.6; }
.article-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.1); color: #e2e8f0; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: var(--font-body); }
.copy-btn:hover { background: rgba(255,255,255,.2); }
.anchor-btn { background: none; border: none; color: #b0b6c3; cursor: pointer; font-size: inherit; padding: 0 8px; opacity: 0; transition: opacity .15s; font-family: var(--font-body); }
.article-body h2:hover .anchor-btn, .article-body h3:hover .anchor-btn, .anchor-btn:focus-visible { opacity: 1; }
.anchor-btn:hover { color: var(--winixx-blue); }

/* SHARE */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 40px; padding-top: 24px; border-top: 1px solid #eaeaea; }
.share-label { font-size: 14px; font-weight: 600; color: #555; margin-inline-end: 4px; }
.share-btn { display: inline-block; padding: 7px 16px; border: 1px solid #d0d5dd; border-radius: 999px; background: #fff; color: #333; font-size: 13px; text-decoration: none; cursor: pointer; font-family: var(--font-body); }
.share-btn:hover { border-color: var(--winixx-blue); color: var(--winixx-blue); }

/* ARTICLE FEEDBACK */
.feedback { margin-top: 32px; padding: 32px; background: #f8f9fa; border-radius: 16px; border: 1px solid #eaeaea; }
.feedback h3 { font-size: 20px; margin: 0 0 20px; color: #111; }
.feedback-buttons { display: flex; gap: 16px; }
.feedback-btn { padding: 12px 32px; border: 2px solid; border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 500; transition: all .3s ease; min-width: 100px; background: transparent; font-family: var(--font-body); }
.feedback-yes { color: #4caf50; border-color: #4caf50; }
.feedback-yes:hover { background: #4caf50; color: #fff; }
.feedback-no { color: #f44336; border-color: #f44336; }
.feedback-no:hover { background: #f44336; color: #fff; }
.feedback-success { color: #2e7d32; font-weight: 500; font-size: 16px; margin: 0; }
.feedback-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .feedback-choices { grid-template-columns: 1fr; } }
.choice { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 18px 20px; background: #fff; border: 1px solid #d0d5dd; border-radius: 14px; text-decoration: none; color: #111; cursor: pointer; font-family: var(--font-body); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.choice span { font-size: 13px; color: #666; }
.choice:hover { border-color: var(--winixx-blue); box-shadow: 0 6px 18px rgba(11,92,255,.12); }
.feedback form textarea { width: 100%; padding: 16px; border: 1px solid #ddd; border-radius: 12px; font-family: var(--font-body); font-size: 15px; resize: vertical; margin-bottom: 16px; }
.feedback form textarea:focus { outline: none; border-color: var(--winixx-blue); box-shadow: 0 0 0 3px rgba(11,92,255,.15); }
.feedback-submit, .btn-primary { display: inline-block; padding: 12px 32px; background: var(--winixx-blue); color: #fff; border: none; border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 500; text-decoration: none; font-family: var(--font-body); }
.feedback-submit:hover, .btn-primary:hover { background: var(--winixx-blue-dark); }
.feedback-submit[disabled] { opacity: .6; cursor: progress; }
.form-error { color: #b91c1c; font-size: 14px; margin: 12px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.prev-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.prev-next a { flex: 1; max-width: 48%; padding: 14px 18px; border: 1px solid #e5e7eb; border-radius: 12px; text-decoration: none; color: #111; font-size: 15px; }
.prev-next a span { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.prev-next a:hover { border-color: var(--winixx-blue); }
.prev-next .next { text-align: end; margin-inline-start: auto; }

.empty-state { text-align: center; padding: 100px 24px; max-width: 560px; margin: 0 auto; }
.empty-state h1 { margin: 0 0 12px; }
.empty-state p { color: #555; line-height: 1.6; margin: 0 0 28px; }

/* TOAST */
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #111; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 3000; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* SIGNED-IN "chat" landing */
body.plain { background: var(--section-bg); display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.start-card { background: #fff; border: 1px solid var(--border-soft); border-radius: 20px; padding: 40px; width: 100%; max-width: 560px; }
.start-card h1 { font-size: 24px; margin: 0 0 12px; }
.muted { color: #555; line-height: 1.6; }
.notice { background: var(--winixx-blue-tint); border-radius: 12px; padding: 16px 20px; margin: 20px 0; color: #1e3a8a; }
.notice p { margin: 6px 0 0; line-height: 1.6; font-size: 14px; }
.start-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-secondary { display: inline-block; padding: 10px 22px; border: 1px solid #d0d5dd; border-radius: 999px; color: #111; text-decoration: none; font-size: 14px; }
.btn-secondary:hover { border-color: var(--winixx-blue); color: var(--winixx-blue); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .kb-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid #eaeaea; }
  .main-content { padding: 28px 20px 60px; }
  .hero h1 { font-size: 34px; }
  .search-expanded.active { width: 240px; }
  .header-search .search-results { min-width: 0; width: calc(100vw - 32px); right: -60px; }
}
@media (max-width: 480px) { .container { padding: 0 14px; } .header-right { gap: 8px; } }

/* RTL (Arabic): flip the one asymmetric piece; the rest uses logical properties */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid #eaeaea; }
[dir="rtl"] .article-list a { border-left: none; border-right: 4px solid transparent; }
[dir="rtl"] .article-list a:hover, [dir="rtl"] .article-list a.active { border-right-color: var(--winixx-blue); }
[dir="rtl"] .copy-btn { right: auto; left: 10px; }
