@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #044;
  --text-primary: #111827;
  --text-secondary: #434960;
  --border-color: #ededed;
  --accent-color: #000000;
  --accent-text-color: #ffffff;
  --interactive-hover-bg: #f3f4f6;
  --interactive-active-bg: #e5e7eb;
  --user-bubble-bg: #1a1b18;
  --user-bubble-text: #ffffff;
  --bot-bubble-bg: #f1f1f1;
  --bot-bubble-text: #1a1b18;
  --danger-color: #d93025;
  --danger-hover-bg: #fce8e6;
  --font-family-ltr: "Bricolage Grotesque", sans-serif;
  --font-family-rtl: "IBM Plex Sans Arabic", sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.5;
  --bg-border: #eee;
  --bg-color-main: #fbfbfb;
  --nav-active: #00a83e;
  --primary-color: #00bc7d;
  --primary-color-hover: #009966;
}


/* -------------------- Base & Reset -------------------- */
.ahc-root,
.ahc-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ahc-root {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

/* --- NEW: Apply Directional Fonts --- */
.ahc-root[dir="ltr"] {
  font-family: var(--font-family-ltr);
}
.ahc-root[dir="rtl"], [dir="rtl"] {
  font-family: var(--font-family-rtl);
}

.ahc-root i {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  font-weight: 500;
}
.ahc-root button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: all .15s cubic-bezier(.4,0,.2,1);
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.loading-placeholder {
  width: 40px;
  height: 40px;
  border: 6px solid #ddd;
  border-top: 6px solid #10b981; 
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto; 
  text-indent: -9999px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------- Main Layout -------------------- */
.main-container {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: 286px;
  flex-shrink: 0;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0px;
  overflow: auto;
  max-width: 96vw;
  z-index: 10000;
  transition: .2s all cubic-bezier(0,0,.2,1);
  flex-wrap: nowrap;
  height: 100dvh;
}
.sidebar i {
    font-size: 1.125rem;
}
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
}
#main-header {
  background: var(--bg-primary);
  z-index: 1000;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-border);
}
.header_links {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-inline-start: auto;
}
.header-link-item {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
  background-color: #fff;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  font-size: .875rem;
  color: #044;
  line-height: 1.5;
  white-space: nowrap;
  text-align: center;
  font-weight: 500;
  text-decoration: none;
  padding: .5rem;
}
.header-link-item:hover {
  background: var(--interactive-hover-bg);
}

.nav-wrapper {
  position: relative;
}
.primary-nav {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}

@media (max-width: 840px) {
    .nav-wrapper {
        order: 2;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        height: 38px;
        width: 38px;
        box-shadow: 0 0 0 0 rgba(0,0,0,0),0 0 0 0 rgba(0,0,0,0),0 0 0 1px #D8DEE4,0 1px 1px 0 rgba(16,17,26,.16);
        border-radius: .5rem;
    }
    .primary-nav {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 250ms ease;
        position: absolute;
        top: calc(100% + .5rem); 
        right: 0;
        left: auto;
        width: min(92vw, 200px);
        gap: .25rem;
    }
    [dir="rtl"] .primary-nav {
        left: 0;
        right: auto;
    }
    .primary-nav.is-open {
        max-height: 400px;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: .75rem;
        box-shadow: 0 4px 8px 0 rgba(0,0,0,.05);
        padding: .25rem;
    }
    .primary-nav .header-link-item {
        padding: .5rem;
        width: 100%;
        justify-content: start;
    }
    .primary-nav .header-link-item:hover {
        background: var(--interactive-hover-bg);
    }
    #language-switcher {
        order: 1;
        width: 38px;
    }
    #language-switcher span, #language-switcher .ri-arrow-down-s-line {
        display: none;
    }
}



.refer-btn {
  font-size: .875rem;
  font-weight: 600;
  color: #240029;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid rgba(41, 0, 41, 0.2);
  border-radius: .5rem;
  background-color: #ffcc11;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  gap: .375rem;
  text-decoration: none;
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.refer-btn:hover {
  background-color: #ffd45e;
}
#language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
  background-color: #fff;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  font-size: .875rem;
  color: #044;
  line-height: 1.5;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 0 0 0 rgba(0,0,0,0),0 0 0 0 rgba(0,0,0,0),0 0 0 1px #D8DEE4,0 1px 1px 0 rgba(16,17,26,.16);
  font-weight: 500;
  text-decoration: none;
  padding: .5rem;
  gap: .25rem;
  height: 38px;
}
#language-switcher:hover {
    background: var(--interactive-hover-bg);
}
#language-switcher i {
  font-size: 1rem;
}
.ahc-header-btn--search {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .5rem;
  cursor: pointer;
  background: #fafafa !important;
  border-radius: 99px;
  border: 1px solid var(--border-color) !important;
}
.ahc-header-btn--search:hover {
  background: #f5f5f5 !important;
}
.ahc-header-btn--search i {
  font-size: 1rem;
  color: var(--text-secondary);
  opacity: .7;
}


.content-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;

}
#article-view,
#chat-view,
#welcome-screen,
#all-topics-view {
  background-image: url(/wp-content/uploads/2025/09/light-bg.png);
  background-size: 100% auto;
  background-position: left top;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
#chat-view {
  display: flex;
  flex-direction: column;
  background-image: none;
}
#all-topics-view {
  padding: 5rem;
}
#article-view .article-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 5rem;
  margin: auto;
  padding: 5rem 0;
  border-bottom: 1px solid var(--border-color);
  width: calc(100% - 22rem);
  max-width: 60rem;
  position: relative;
}
#article-view .category-content {
  min-width: 0;
  width: calc(100% - 22rem);
  max-width: 60rem;
  margin: 5rem auto;
  position: relative;
}
#article-view .category-topics-title {
    margin: 0;
}
#article-view .category-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
#article-view .article-body p {
  margin: 0;
  max-width: 60ch;
}
#article-view .ahc-bc-actions {
    display: none;
}
#article-view .category-topics-list {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0 0;
    display: flex;
    gap: 2.5rem;
}

#article-view .category-topic-item {
    display: flex;
    align-items: center;
    gap: 3rem;
    border: 0;
    border-radius: .75rem;
    transition: all .15s ease;
    cursor: pointer;
    background-color: #fff;
    padding: .25rem !important;
    text-decoration: none;
}

#article-view .category-topic-item:hover {
    background: var(--bg-secondary);
    transform: none !important;
}

#article-view .category-topic-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

#article-view .category-topic-description {
  color: var(--text-secondary);
  font-size: .875rem;
  margin: .375rem 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

#article-view .category-topic-item-image-wrapper {
    flex-shrink: 0;
    width: 276px;
    height: auto;
    overflow: hidden;
    border-radius: .5rem;
    background-color: #fafafa;
    aspect-ratio: 1200/675;
    border: 1px solid var(--border-color);
}

#article-view .category-topic-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


#welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

#main-footer {
  background: var(--bg-primary);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--bg-border);
  z-index: 999;
  position: relative;
  font-size: .75rem;
  color: var(--text-secondary);
  gap: 1.5rem;
}

#main-footer > * {
  flex: 1;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: .75rem;
}

.footer-social a {
  text-decoration: none;
  line-height: 1;
  color: var(--text-secondary);
}

.footer-social a:hover {
  color: var(--text-primary);
}

.footer-social i {
  font-size: 1.125rem;
}

.footer-copyrights {
  text-align: end;
}

.footer-quick-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  list-style: none;
}

.footer-quick-links li {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.footer-quick-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-primary);
}

.footer-quick-links a:hover {
  text-decoration: underline;
  font-weight: 500;
}

.footer-quick-links i {
  font-size: 1.125rem;
  opacity: .7;
}


@media (max-width: 1280px) {
    #article-view .article-header,
    #article-view .category-content {
        width: 100%;
        max-width: 100%;
        padding: 3rem 1.5rem;
        margin: 0;
        gap: 1.25rem;
    }
}

@media (max-width: 840px) {
    #article-view .category-topic-item {
        flex-direction: column;
        gap: 1.25rem;
    }
    #article-view .category-topic-item-image-wrapper {
        width: 100%;
    }
}


@media (max-width: 520px) { 
    #main-footer {
        flex-direction: column;
    }
    #all-topics-view {
        padding: 3rem 1.5rem;
    }
    .category-card {
        max-width: 100% !important;
    }
    .popular-topics {
        flex-direction: column;
    }
    .popular-question-btn {
        max-width: 100% !important;
    }
}



/* -------------------- Sidebar -------------------- */
.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-link {
  text-decoration: none;
  color: inherit;
}
.sidebar-title {
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}
.sidebar-close-btn {
  display: none;
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.sidebar-search-wrapper {
  position: relative;
  margin-bottom: 16px;
}
.sidebar-search-wrapper i {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
}
#sidebar-search-input {
  width: 100%;
  padding: 10px 40px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-family: inherit;
}
#sidebar-search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 0;
  border-radius: .5rem;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  width: 100%;
  line-height: 1;
  color: rgb(222 226 226);
  max-height: 38px;
}
.nav-item .chat-item-main {
  display: flex;
  align-items: center;
  gap: .5rem;
  overflow: hidden;
}
.nav-item .chat-title-span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-placeholder {
  color: rgba(255,255,255,.5);
  font-size: .75rem;
}

.nav-separator {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  padding: .25rem;
  line-height: 1;
}
.chat-options-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  border-radius: 50%;
  aspect-ratio: 1/1;
  width: 24px;
}
.nav-item:hover .chat-options-btn {
  opacity: 1;
  visibility: visible;
}
.chat-options-btn:hover {
  background-color: rgba(255,255,255,.05);
}

.nav-back-btn {
  justify-content: start;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 0;
  border-radius: .5rem;
  font-size: .9375rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7) !important;
  margin-bottom: .5rem;
  width: fit-content;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.5rem;
  position: relative;
}

/* -------------------- Guest & User footer -------------------- */
.sidebar-btn-primary,
.sidebar-btn-secondary {
  text-align: center;
  width: 100%;
  text-decoration: none;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: .5rem;
  line-height: 1;
  min-height: 38px;
}
.sidebar-btn-primary {
  background-color: #fff;
  color: #044;
}
.sidebar-btn-primary:hover {
  background-color: #f5f5f5;
}
.sidebar-btn-secondary {
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.sidebar-btn-secondary:hover {
  background-color: rgba(255,255,255,.1);
}

.footer-separator {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}
.guest-menu,
.user-footer-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.guest-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s cubic-bezier(.4,0,.2,1);
}
.guest-menu-item:hover {
  background-color: var(--interactive-hover-bg);
  color: var(--text-primary);
}
.quick-links {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
}
.quick-links span {
  color: var(--text-secondary);
}
.quick-link {
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all .15s cubic-bezier(.4,0,.2,1);
}
.quick-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  padding: .75rem;
  border-radius: .5rem;
  transition: .2s all cubic-bezier(0,0,.2,1);
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.user-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.user-avatar {
  border-radius: 50%;
}
.user-display-meta {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.user-display-meta span {
    max-width: 18ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-display-name {
  font-weight: 400;
  font-size: .875rem;
  color: #fff;
}
.user-display-email {
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.7);
}


/* --- User credits under user menu toggle --- */
.ahc-user-credits {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .75rem;
  border-radius: .5rem;
  background: #022;
}

.ahc-user-credits-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
}

.ahc-user-credits-bar {
  width: 100%;
  height: .75rem;
  border-radius: .25rem;
  background: rgba(255,255,255,.1);
  overflow: hidden;
  position: relative;
}

.ahc-user-credits-bar .fill {
  height: 100%;
  width: 0%;
  border-radius: .25rem;
  background: var(--primary-color);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}

.ahc-user-credits-pct {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}



/* -------------------- Welcome Screen -------------------- */
.welcome-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 640px;
    width: 100%;
    text-align: center;
    z-index: 1;
}
.main-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: .7;
}
.welcome-title {
    font-size: 4rem;
    font-weight: 700;
}

.welcome-description {
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.circle-wrapper { 
    position: absolute; 
    left: 50%; 
    top: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
} 

.circle { 
    position: absolute; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
}



.circle.smaller {
  height: 812px;
  width: 812px;
  border: 1px solid var(--bg-border);
}

.circle.small {
  height: 1016px;
  width: 1016px;
  border: 1px solid var(--bg-border);
  background-color: var(--bg-primary);
}

.circle.medium-small {
  height: 1270px;
  width: 1270px;
  border: 1px solid var(--bg-border);
  background: var(--bg-color-main);
}

.circle.medium {
  height: 1620px;
  width: 1620px;
  border: 1px solid var(--bg-border);
}

.circle.medium-large {
  height: 1984px;
  width: 1984px;
  border: 1px solid var(--bg-border);
}

.circle.large {
  height: 2480px;
  width: 2480px;
  border: 1px solid var(--bg-border);
}


.main-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: end;
}
.main-search-wrapper .ai-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin-inline-start: .75rem;
  inset-inline-start: 0;
  font-size: 1.25rem;
  color: #22c55e;
}

#main-search-input {
  border: none;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0 2.5rem;
  background-color: var(--bg-primary);
  height: 48px;
  border-radius: 99px;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgb(227, 227, 227);
  font-weight: 400;
  color: var(--text-primary);
}
#main-search-input:focus {
  outline: none;
  box-shadow: 0 0 12px 0 #22c55e40, 0 0 0 1px #22c55e;
}
#main-search-btn {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  position: absolute;
  margin-inline-end: .25rem;
  cursor: auto;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-shortcut {
    margin-inline-start: auto;
    font-size: .75rem;
    font-weight: 400;
    opacity: .5;
}
.popular-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}
.polular-topics-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  width: 100%;
  text-align: start;
}
.popular-question-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem;
    font-size: .875rem;
    font-weight: 500;
    text-align: start;
    border-radius: .5rem;
    max-width: calc((100% - .75rem)/2);
    width: 100%;
}
.popular-question-btn:hover {
    background-color: var(--bg-secondary);
}
.popular-question-btn span {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.ahc-cat-icon {
    height: 1.125rem;
    width: auto;
    border-radius: .25rem;
}

/* -------------------- Article & Category View -------------------- */
/* Base layout */
.article-content {
  margin: 0 auto;
  width: 100%;
  font-family: inherit;
  scroll-margin-top: 8rem;
}

/* Header */
.article-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3.75rem;
}


.article-header i {
  font-size: 32px;
}

/* Title (32–40px, semibold) */
.article-title {
  font-size: clamp(32px, 3.6vw, 40px);
  font-weight: 700; /* semibold */
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text-primary);
}
.article-featured-image {
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  width: 100%;
  max-width: 100%;
}
.article-short-description {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Body (14–16px) */
.article-body {
  line-height: var(--line-height-base);
  font-size: clamp(14px, 1.1vw, 16px);
  color: var(--text-secondary);
  font-family: inherit;
}
.article-body p,
.article-body ul,
.article-body ol {
  margin-bottom: 1rem; /* more vertical space */
}
.article-body li p {
  margin: 0;
}
.article-body li {
    margin: .25rem 0;
}


/* === Blockquote === */
.article-body blockquote,
.ai-reply-container blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  background-color: #f9f9f9;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 2;
  border-inline-start: 4px solid var(--primary-color);
  box-shadow: 0 0 0 1px var(--border-color);
}

.article-body blockquote p,
.ai-reply-container blockquote p {
    margin: 0;
}

.article-body blockquote .author,
.ai-reply-container blockquote .author {
  font-weight: 600;
  font-style: normal;
  color: var(--text-primary);
  font-size: .875rem;
}

.article-body blockquote i,
.ai-reply-container blockquote i {
  font-size: 1.75rem;
  color: var(--primary-color);
}

.article-body hr {
  border-top: 1px solid #e3e3e3;
  border-bottom: 0;
  margin: 3.75rem 0;
  height: 1px;
  outline: none;
  width: 100%;
}

/* === Alert Boxes === */
.article-body .callout {
  position: relative;
  padding: .75rem 1rem;
  border-radius: .5rem;
  margin: 1rem 0;
  font-size: clamp(.75rem, 1.1vw, .875rem);
  font-weight: 500;
  background-color: var(--callout-bg, #f9f9f9);
  border: 1px solid var(--callout-border, #e0e0e0);
  color: var(--text-secondary);
  padding-inline-start: 2.5rem;
}
.article-body .callout i {
  position: absolute;
  inset: .75rem .75rem 0 .75rem;
  width: fit-content;
  height: fit-content;
}

.article-body .callout::before {
  content: "";
  position: absolute;
  inset-block-start: .875rem;
  inset-inline-start: .875rem;
  inline-size: 1rem;
  block-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(67,73,96,1)'%3E%3Cpath d='M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z'%3E%3C/path%3E%3C/svg%3E");
}


/* Variants */
.article-body .callout-info {
  background-color: var(--info-bg, #eff6ff);
  border: 1px solid var(--info-border, #acc9ee);
  color: var(--info-text, #1e40af);
}
.article-body .callout-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(30,64,175,1)'%3E%3Cpath d='M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 9.5C12.8284 9.5 13.5 8.82843 13.5 8C13.5 7.17157 12.8284 6.5 12 6.5C11.1716 6.5 10.5 7.17157 10.5 8C10.5 8.82843 11.1716 9.5 12 9.5ZM14 15H13V10.5H10V12.5H11V15H10V17H14V15Z'%3E%3C/path%3E%3C/svg%3E");
}
.article-body .callout-success {
  background-color: var(--success-bg, #ecfdf5);
  border: 1px solid var(--success-border, #9fe1c2);
  color: var(--success-text, #065f46);
}
.article-body .callout-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(6,95,70,1)'%3E%3Cpath d='M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM17.4571 9.45711L11 15.9142L6.79289 11.7071L8.20711 10.2929L11 13.0858L16.0429 8.04289L17.4571 9.45711Z'%3E%3C/path%3E%3C/svg%3E");
}
.article-body .callout-warning {
  background-color: var(--warning-bg, #fffbeb);
  border: 1px solid var(--warning-border, #e3d7a8);
  color: var(--warning-text, #92400e);
}
.article-body .callout-warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(146,64,14,1)'%3E%3Cpath d='M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z'%3E%3C/path%3E%3C/svg%3E");
}

.article-body .callout-danger {
  background-color: var(--danger-bg, #fef2f2);
  border: 1px solid var(--danger-border, #f6c6c6);
  color: var(--danger-text, #991b1b);
}
.article-body .callout-danger::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(153,27,27,1)'%3E%3Cpath d='M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z'%3E%3C/path%3E%3C/svg%3E");
}

/* === Code & Pre === */
.article-body code {
  font-family: inherit;
  font-size: .875rem;
  background: #9f9fa925;
  padding: .125rem .5rem;
  border-radius: .375rem;
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--callout-border, #e0e0e0);
}

.article-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--surface-alt, #1e1e1e);
  color: #f1f1f1;
  padding: 1rem;
  overflow-x: auto;
  border-radius: .5rem;
  margin: 1rem 0;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: 0;
  font-size: clamp(.75rem, 2vw, .875rem);
  line-height: 2;
}

/* === Images === */
.article-body figure {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  display: flex;
  flex-direction: column;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  gap: .25rem;
  padding: .25rem;
}

.article-body figure img {
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    margin: 1.5rem auto;
    display: block;
    border: 1px solid var(--bg-border);
    padding: .25rem;
    background: var(--bg-secondary);
}

/* Optional: center images when desired */
.article-body img.align-center {
  margin-left: auto;
  margin-right: auto;
}




/* Headings inside article body (semibold, responsive) */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--text-primary);
  scroll-margin-top: 2rem;
}
.article-body h1 {
  font-size: clamp(2rem, 3.6vw, 2.5rem);
}
.article-body h2 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}
.article-body h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}
/* Optional smaller heading */
.article-body h4 {
  font-size: clamp(1.125rem, 1.8vw, 1.25rem);
}
.article-body h5 {
  font-size: clamp(1rem, 2.2vw, 1.125rem);
}
.article-body h6 {
  font-size: clamp(.875rem, 2.2vw, 1rem);
}

/* Lists */
.article-body ul,
.article-body ol {
  list-style-position: inside;
}

.article-body ul li,
.article-body ol li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .375rem;
  flex-wrap: wrap;
}

.article-body ol {
    list-style: none; 
    counter-reset: item;
}

.article-body ol li { 
    counter-increment: item; 
}

.article-body ol li::before {
    content: counters(item, ".") ".\2003";
}


.article-body ul,
.article-body ul.checklist,
.article-body ul.cons-list,
.article-body ul.steps-list {
  list-style: none;
}

.article-body ul li {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(173,184,194,1)'%3E%3Cpath d='M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z'%3E%3C/path%3E%3C/svg%3E");
  background-position: 0 6px;
  background-repeat: no-repeat;
  background-size: .5rem;
  padding-inline-start: 1.5rem;
}
[dir="rtl"] .article-body ul li {
  background-position: right 0 top 6px;
}

.article-body ul[class*="checklist"] li {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(0,187,51,1)'%3E%3Cpath d='M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z'%3E%3C/path%3E%3C/svg%3E");
  background-position: -2px 2px;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-inline-start: 1.5rem;
}
[dir="rtl"] .article-body ul[class*="checklist"] li {
  background-position: right -2px top 2px;
}

.article-body ul[class*="cons-list"] li {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(220,21,21,1)'%3E%3Cpath d='M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z'%3E%3C/path%3E%3C/svg%3E");  background-position: 0 2px;
  background-position: 0 6px;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-inline-start: 1.5rem;
}
[dir="rtl"] .article-body ul[class*="cons-list"] li {
  background-position: right 0 top 6px;
}


.article-body ol.steps-list {
  list-style: none;
  counter-reset: ahcStep;
  position: relative;
  padding-inline-start: 2.5rem;
}

.article-body ol.steps-list::before {
  content: "";
  position: absolute;
  inset: 15px 15px 0 15px;
  bottom: 15px;
  border-inline-start: 2px dashed #e0e0e0;
  z-index: 1;
}

.article-body ol.steps-list li {
  counter-increment: ahcStep;
  margin: 1.25rem 0;
  min-height: 1.875rem;
}

.article-body ol.steps-list li::before {
  content: counter(ahcStep);
  position: absolute;
  inset: 0 -40px 0 -40px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  z-index: 2;
  color: var(--text-primary);
}



/* Media */
.article-body iframe {
  max-width: 100%;
  width: 100%;
  min-height: 378px;
  border-radius: .75rem;
}

/* Links (primary color + underline on hover) */
.article-body a,
.ai-reply-container a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
}
.article-body a:hover,
.ai-reply-container a:hover {
  color: var(--primary-color-hover);
}

/* Category topics */
.category-topics-title {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--text-primary);
  scroll-margin-top: 2rem;
}
.category-topics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 1rem 0;
}
.category-topic-item {
  font-size: clamp(.875rem, 1.1vw, 1rem);
  padding: 1rem !important;
  cursor: pointer;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  background: var(--bg-secondary);
  margin: 0 !important;
  background-image: none !important;
}
.category-topic-item:hover {
  color: var(--text-primary);
  transform: scale(1.02);
  border-color: var(--primary-color);
}

/* Typography colors for emphasis */
strong,
b {
  color: var(--text-primary);
}

/* === Tables (responsive) === */
/* Optional: sticky header works best inside .table-responsive */
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Base table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(.875rem, 1.1vw, 1rem);
  color: var(--text-secondary);
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

caption {
  caption-side: top;
  text-align: start;
  font-weight: 700;
  color: var(--text-primary);
  padding: .75rem 0 !important;
  font-size: clamp(1.125rem, 1.8vw, 1.25rem);
}

thead th {
  text-align: start;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: .75rem 1rem !important;
  white-space: nowrap;
}

tbody td {
  padding: .75rem 1rem !important;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

tbody tr:hover {
  background: var(--bg-color-main);
}

/* Compact tables */
.table-condensed td,
.table-condensed th {
  padding: .5rem .75rem;
}

/* ===== Stacked (card) layout for very small screens =====
   Add data-label="Column name" on each <td> for accessibility.
*/
@media (max-width: 520px) {
  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tbody tr {
    border-bottom: 1px solid var(--border-color);
    margin: .5rem 0;
    background: var(--bg-secondary);
    border-radius: .5rem;
    overflow: hidden;
  }

  tbody td {
    border: 0;
    display: grid;
    grid-template-columns: 40% 1fr; /* label | value */
    gap: .5rem;
    padding: .75rem 1rem;
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-primary);
  }
}



/* -------------------- Chat View -------------------- */
.chat-messages {
  flex-grow: 1;
  padding: 3rem;
}
.chat-block {
  max-width: 760px;
  margin: 0 auto 3rem auto;
}
.user-question-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.wawp_ai_avatar {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  gap: .5rem;
  font-size: .875rem;
  font-weight: 600;
}
.wawp_ai_avatar i {
  font-size: 1rem;
}
.ai-reply-container {
  line-height: 1.5;
  font-size: 15px;
  color: var(--text-secondary);
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: .75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-list {
  list-style: none;
  padding: 0;
}
.ai-list-item {
  display: flex;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.5;
  font-size: 15px;
  color: #333;
}
.ai-list-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.ai-list-number {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background-color: var(--interactive-active-bg);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  margin-inline-end: 12px; /* logical */
  flex-shrink: 0;
}
.ai-list-text {
  flex-grow: 1;
}

.ai-reply-container.typing {
  padding: 12px 18px;
}

.related-topics-container {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.related-topics-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}
.related-topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-topic-btn {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.related-topic-btn i {
  font-size: 16px;
}
.related-topic-btn:hover {
  background-color: var(--interactive-hover-bg);
}

.sources-container {
  margin-top: 16px;
  font-size: 13px;
}
.sources-title-toggle {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
}
.sources-list {
  list-style: none;
  margin-top: 8px;
  border-inline-start: 2px solid var(--border-color); /* logical */
  padding-inline-start: 12px;
}
.source-item {
  padding: 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.source-item:hover {
  color: var(--accent-color);
}
.source-item i {
  font-size: 16px;
}

.chat-area {
  position: fixed;
  bottom: max(0px, env(safe-area-inset-bottom));
  left: auto;
  right: 0;
  z-index: 999;
  padding: 1rem;
  margin: auto;
  min-width: 42rem;
  width: 100%;
}

[dir="rtl"] .chat-area {
    left: 0;
    right: auto;
}

.chat-input-wrapper {
  position: relative;
  width: min(28rem, 100% - 2rem);
  margin: auto;
  display: flex;
  align-items: start;
  justify-content: center;
}

.chat-input-area {
}


#chat-input {
  width: 100%;
  padding: .75rem 0;
  border-radius: .5rem;
  border: 0;
  background-color: var(--bg-primary);
  font-size: .875rem;
  resize: none;
  font-family: inherit;
  box-shadow: 0 4px 12px 0 rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.1);
  color: var(--text-primary);
  font-weight: 400;
  padding-inline-start: 2.5rem;
  padding-inline-end: 3rem;
  min-height: 46px;
}
#chat-input:focus {
  outline: none;
  box-shadow: 0 0 12px 0 #22c55e40, 0 0 0 1px #22c55e;
}
#send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  margin-inline-end: .375rem;
  inset-inline-end: 0;
  height: 2.125rem;
  width: 2.125rem;
  background: #22c55e;
  border-radius: .375rem;
  color: #fff;
  margin-bottom: .375rem;
  align-self: end;
}
#send-btn.sending,
#send-btn:disabled {
  background: #ebeef1;
  color: #adb7c6;
  cursor: default;
}
#send-btn:not(:disabled):hover {
  background: #12ac4b;
}
.chat-input-wrapper .ai-icon {
  position: absolute;
  margin-inline-start: .75rem;
  inset-inline-start: 0;
  margin-top: .875rem;
  font-size: 1rem;
  color: #22c55e;
}

/* -------------------- Popovers & Menus -------------------- */

.language-menu-popover {
    position: absolute;           
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    z-index: 1000000;
    padding: .125rem;
    width: 240px;         
}
.chat-options-menu {
  position: absolute;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  z-index: 4000;
  padding: .125rem;
  width: 160px;
  z-index: 1000000;
}

.user-menu-popover {
    position: absolute;
    background: #033;
    border-radius: .75rem;
    z-index: 4000;
    padding: .25rem;
    width: 240px;
    z-index: 1000000;
}

.language-menu-search {
    padding: .5rem;
    border-bottom: 1px solid var(--border-color);
}

.language-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: .25rem;
  outline: none;
  font-family: inherit;
  font-size: .875rem;
}

.ai-translation-notice {
  padding: .75rem 1rem;
  border-radius: .375rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 500;
  background-color: #eff6ff;
  border: 1px solid #acc9ee;
  color: #1e40af;
}
.ai-translation-notice i {
    font-size: 1rem;
}
.chat-options-menu button {
  width: 100%;
  text-align: start;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  transition: all .2s cubic-bezier(0,0,.2,1);
  font-size: .875rem;
  color: var(--text-primary);
  line-height: 1;
  border-radius: .5rem;
  text-decoration: none;
  font-weight: 500;
}
.chat-options-menu button:hover {
  background-color: var(--interactive-hover-bg);
}
.chat-options-menu .delete-btn:hover {
  background-color: var(--danger-hover-bg);
  color: var(--danger-color);
}
.chat-options-menu i {
  font-size: 1rem;
}
.rename-input {
  width: 100%;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 4px;
  font-size: inherit;
}
.popover-separator {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  transition: all .2s cubic-bezier(0,0,.2,1);
  font-size: .875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  border-radius: .5rem;
  text-decoration: none;
}
.user-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.user-menu-item i {
  font-size: .875rem;
}
.user-details {
  padding: 8px;
}
.user-popover-name {
  font-weight: 600;
  display: block;
  font-size: 14px;
}
.user-popover-email {
  color: var(--text-secondary);
  font-size: 13px;
}
.language-menu-list {
  max-height: 250px;
  overflow-y: auto;
  padding: .375rem;
}
.language-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem;
  border-radius: .25rem;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
}
.language-menu-item:hover {
  background-color: var(--interactive-hover-bg);
}
.language-menu-item.selected {
  color: var(--accent-color);
}
.language-menu-item .ri-check-line {
  opacity: 0;
}
.language-menu-item.selected .ri-check-line {
  opacity: 1;
}
.language-menu-footer {
  padding-top: 8px;
}

/* -------------------- Responsive -------------------- */
.sidebar-toggle-btn {
  display: none;
  z-index: 50;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1280px) {
  .main-container {
    height: 100vh;
    max-height: 100vh;
    border: none;
    border-radius: 0;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    min-width: 320px;
  }
  [dir="rtl"] .sidebar {
      left: auto;
      right: 0;
      transform: translateX(100%);
  }
  .sidebar.visible {
    transform: translateX(0);
  }
  .sidebar-toggle-btn {
    display: flex;
  }
  .sidebar-close-btn {
    display: block;
    padding: 4px;
    color: #fff !important;
    opacity: .5;
  }
  .welcome-title {
    font-size: 32px;
  }
  .chat-block,
  .chat-input-area {
    max-width: 100%;
    padding: 0;
  }
  .chat-area {
    min-width: 30rem;
    max-width: 30rem;
    left: 0 !important;
    right: 0 !important;
  }
  .chat-input-wrapper {
    width: 100%;
  }
  .ahc-topic-main {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
  }
}

@media (max-width: 520px) {
  .chat-area {
    min-width: 0;
    width: 100%;
  }
  .chat-messages {
    max-width: 100%;
  }
  .sidebar {
    min-width: 90vw;
    width: 90%;
  }
  .welcome-title {
    font-size: 28px;
  }
  #main-search-input {
    font-size: 15px;
  }
  .user-menu-popover {
      width: calc(100% - 3rem);
  }
  .article-title {
    font-size: 26px;
  }
  .ahc-social-share .ai-btn {
      width: 2rem;
      padding: 0 !important;
      justify-content: center;
  }
  .ahc-social-share .ai-btn span {
      display: none;
  }
}

/* -------------------- Animations preference -------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}


/* Sources list handled via logical props above */

/* Category submenu indentation */
.nav-sublist {
    display: none;
    padding: 0;
    border-inline-start: 1px solid rgba(255,255,255,.1);
}


/* -------------------- Nav section title -------------------- */

#nav-view-topics {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex-wrap: nowrap;
}

.nav-section-title {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  padding: .25rem;
  line-height: 1;
}

/* -------------------- Article Footer (updated + feedback + prev/next) -------------------- */
.ahc-root .article-footer {
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.ahc-root .article-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280; /* gray-500 */
}
.ahc-root .article-updated i {
  font-size: 16px;
  color: #9ca3af;
}
.ahc-root .article-help {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  flex: 1;
}
.ahc-root .article-help-actions {
  display: inline-flex;
  gap: .75rem;
}
.ahc-root .ahc-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid #e5e7eb; /* gray-200 */
  background: #fff;
  color: #374151; /* gray-700 */
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.ahc-root .ahc-help-btn i {
  font-size: 16px;
}
.ahc-root .ahc-help-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.ahc-root .ahc-help-btn:active {
  transform: translateY(1px);
}
.ahc-root .footer-separator {
  border: 0;
  height: 1px;
  background: #eef2f7;
  margin: 0;
}
.ahc-root .ahc-prev-next {
  display: flex;
  gap: .75rem;
}
.ahc-root .ahc-prev-next a {
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 1px solid #edf1f5;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.08s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.ahc-root .ahc-prev-next a:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.ahc-root .ahc-prev-next a.disabled {
  opacity: 0.55;
  pointer-events: none;
  display: none;
}
.ahc-root .ahc-prev-next a small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 6px;
}
.ahc-root .ahc-prev-next .link-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
  word-break: break-word;
}
@media (max-width: 520px) {
  .ahc-root .ahc-prev-next {
    flex-direction: column;
  }
}


/* -------------------- Category row with caret -------------------- */
.nav-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-cat-main {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.nav-cat-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-category-item .nav-cat-caret {
  transition: transform 0.2s ease;
}
.nav-category-item.open .nav-cat-caret {
  transform: rotate(180deg);
}

/* -------------------- Submenu list (post titles) -------------------- */
.nav-subitem {
    display: flex;
    align-items: start;
    gap: .5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-topic-item {
  padding: .375rem 1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  font-size: .875rem;
  color: rgba(255,255,255,.5);
  font-weight: 400;
  line-height: 1.4;
  border-inline-start: 1px solid transparent;
}
.nav-subitem i {
  font-size: 1.125rem;
  line-height: 1.2;
}
.nav-subitem:hover a {
  color: rgba(255,255,255,.7);
  border-inline-start: 1px solid rgba(255,255,255,.2);
}
.nav-subitem a.active {
    border-inline-start: 1px solid #22c55e;
    color: #22c55e;
}
.nav-subitem.active a {
}

/* -------------------- All Topics page -------------------- */
.alltopics-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.alltopics-wrap .article-header {
    gap: .5rem;
    margin-bottom: 3rem;
    text-align: center;
}
.alltopics-wrap .article-header .description {
  font-size: 1rem;
  color: var(--text-secondary);
}
.alltopics-search {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  max-width: 600px;
  margin: auto;
}
.alltopics-input-wrap {
  position: relative;
}
.alltopics-input-wrap .search-shortcut {
  position: absolute;
  inset-inline-end: .75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: .25rem;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: .375rem;
}
.alltopics-input-wrap i {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}
#alltopics-search {
    width: 100%;
    padding: .75rem;
    border-radius: .5rem;
    border: 0;
    font-size: .875rem;
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 0 rgba(0,0,0,0),0 0 0 0 rgba(0,0,0,0),0 0 0 1px #D8DEE4,0 1px 1px 0 rgba(16,17,26,.16);
    font-family: inherit;
    font-weight: 500;
    line-height: 1.5;
    padding-inline-start: 2.5rem;
    height: 3rem;
}
#alltopics-search:focus {
    outline: none;
    box-shadow: rgba(0, 238, 119, 0.25) 0px 0px 12px 0px, rgb(0, 187, 119) 0px 0px 0px 1px;
}
.advanced_filters {
  position: relative;
}
.alltopics-search .alltopics-filters-btn {
  padding: .25rem .5rem;
  width: fit-content;
  font-size: .75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .25rem;
  border-radius: .5rem;
  border: 1px solid transparent;
}
.alltopics-search .alltopics-filters-btn:hover {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
.alltopics-search .alltopics-filters-btn i {
  font-size: 1rem;
}
.alltopics-search .alltopics-filters-btn[aria-expanded="true"] {
  box-shadow: inset 0 0 0 1px #D8DEE4, inset 0 1px 2px rgba(16,17,26,.18);
}


.alltopics-results {
  margin-top: 16px;
}
.alltopics-empty {
  color: var(--text-secondary);
  padding: .5rem;
  font-size: .875rem;
  text-align: center;
  background: var(--bg-primary);
}
.live_search_wrapper {
  position: relative;
}
#alltopics-live {
  width: 100%;
  z-index: 999;
  position: absolute;
  top: calc(100% + .5rem);
}
.alltopics-list {
  list-style: none;
  padding: .125rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--bg-primary);
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.05);
  border-radius: .5rem;
  border: 1px solid var(--border-color);
}
.alltopics-item {
  display: flex;
  gap: .5rem;
  padding: .5rem;
  border-radius: .5rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: .875rem;
}
.alltopics-item:hover {
  background-color: var(--interactive-hover-bg);
}
.alltopics-item-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  padding: .75rem;
}
.alltopics-item-link:hover {
  background: var(--bg-secondary);
}
.alltopics-item-link i {
  font-size: 1.125rem;
}
.alltopics-text {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}
.alltopics-cat {
  font-size: .75rem;
  opacity: .6;
}
.alltopics-snippet {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Popular categories grid */
.all-topics-section {
  max-width: 960px;
  margin: 3rem auto 0;
}
.all-topics-section .section-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
}
.popular-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: .75rem;
}
.category-card {
  display: flex;
  gap: .75rem;
  width: 100%;
  padding: 1.25rem;
  border: 1px solid var(--border-color) !important;
  border-radius: .75rem;
  background: var(--bg-primary) !important;
  text-align: start;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease !important;
  flex-direction: column;
  max-width: calc((100% - .75rem)/2);
}
.category-card:hover {
  background: var(--interactive-hover-bg);
  border-color: #ddd;
  transform: scale(1.02);
}
.category-card .card-icon i {
  font-size: 28px;
  color: var(--text-secondary);
}
.category-card .card-meta {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}
.category-card .card-title {
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.5;
}
.category-card .card-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  height: 100%;
}
.category-card .card-count {
  font-size: .75rem;
  opacity: 0.7;
}

.ahc-sb-badge,
.alltopics-badge {
  font-size: 10px;
  line-height: 1;
  padding: .125rem .375rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 1;
  text-transform: uppercase;
  margin-inline-start: .25rem;
}
.alltopics-badge {
    
}
.home.wp-singular.page-template-default.page.page-id-7.wp-theme-Wawp-Ai-theme {
  margin: 0px !important;
}


.ahc-root .sidebar .sidebar-header .sidebar-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
}
.ahc-root .sidebar .sidebar-header .ahc-logo-img {
  width: auto;
  height: 28px;
}

.nav-item.recent-chat-item {
    justify-content: space-between;
    padding: .375rem .75rem;
    font-size: .875rem;
}

.nav-item.recent-chat-item:hover {
  background: rgba(255,255,255,.1);
}

.nav-item.recent-chat-item i {
    font-size: 1rem;
    line-height: 1.2;
}

/* -------------------- End -------------------- */

/* -------------------- Topic Page Layout (Main Content + TOC Sidebar) -------------------- */
.ahc-topic-layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: auto;
  justify-content: space-between;
}

.ahc-topic-main {
    flex: 1;
    min-width: 0;
    width: calc(100% - 22rem);
    max-width: 42rem;
    margin: auto;
    position: relative;
}

.ahc-topic-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 1.5rem;
  max-width: 19rem;
  width: 100%;
  padding-inline-start: 3rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.side_cta_banner {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  background-image: radial-gradient( at top center, #044 75%, #0bff80, #66ff82, #dfd);
  border-radius: .75rem;
  margin-top: 3rem;
}
.cta_title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.cta_desc {
  font-size: .75rem;
  color: #fff;
  opacity: .8;
}
.cta_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
  background-color: #fff;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  font-size: .875rem;
  color: #044;
  line-height: 1.5;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 0 0 0 rgba(0,0,0,0),0 0 0 0 rgba(0,0,0,0),0 0 0 1px #D8DEE4,0 1px 1px 0 rgba(16,17,26,.16);
  font-weight: 500;
  text-decoration: none;
  padding: .5rem;
  gap: .25rem;
  margin-top: .5rem;
}
.cta_btn:hover {
  background: var(--interactive-hover-bg);
}


/* On smaller screens, stack the layout with the TOC on top */
@media (max-width: 1280px) {
    .chat-messages {
        padding: 1.5rem;
        max-width: 760px;
        margin: auto;
    }
    .ahc-topic-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .ahc-topic-main {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    .ahc-topic-sidebar {
        order: -1;
        position: relative;
        width: 100%;
        max-width: 100vw;
        flex-basis: auto;
        padding: 1rem;
        top: 0;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: .5rem;
        box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    }
    .ahc-toc[hidden] { 
        display: none; 
    }
    .ahc-toc.is-open { 
        display: flex; 
    }
    #toc-panel .ahc-btt, #toc-panel .ahc-toc-hr {
        display: none;
    }
    .side_cta_banner {
        display: none;
    }
    #welcome-screen {
        padding: 1.5rem;
    }
}




/* -------------------- AI Action in Search Results -------------------- */
.alltopics-item--ai {
  background: #f4f3ff;
  justify-content: space-between;
  font-size: .875rem;
  display: flex;
  align-items: center;
  padding: .75rem;
  gap: .5rem;
  border-radius: .375rem;
  flex-wrap: wrap;
}
.alltopics-item--ai:hover {
  background: #ebe9ff;
}
.alltopics-item--ai i {
  color: #6d28d9;
  font-size: 1rem;
}
.alltopics-item--ai .alltopics-text {
  flex-grow: 1;
}
.alltopics-item--ai .alltopics-title {
  display: flex;
  align-items: center;
  justify-content: start;
  flex-wrap: wrap;
  gap: .5rem;
  font-weight: 500;
}
.alltopics-item--ai .ai-query {
  opacity: 1;
}
.alltopics-item--ai .ai-prompt {
  color: #4c1d95;
}
.ai-powered-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
  background-color: #ede9fe;
  color: #6d28d9;
  text-transform: uppercase;
  white-space: nowrap;
}

/* -------------------- All Topics Filters -------------------- */
.alltopics-filters {
  display: flex;
  gap: .75rem;
  width: 100%;
  box-shadow: 0 0 0 0 rgba(0,0,0,0),0 0 0 0 rgba(0,0,0,0),0 0 0 1px #D8DEE4,0 1px 1px 0 rgba(16,17,26,.16);
  padding: .75rem;
  background: var(--bg-secondary);
  border-radius: .5rem;
  position: absolute;
  top: 0;
}
.alltopics-filters.hidden { display: none; }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-group select {
    padding: 6px 8px;
    border-radius: .375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    font-size: .875rem;
    font-family: inherit;
}
/* -------------------- Content Area Background -------------------- */

/* -------------------- Sidebar Action Buttons -------------------- */
.ahc-sidebar-actions {
    display: flex;
    gap: .5rem;
    padding: 1.5rem 1.5rem;
    flex-direction: column;
}

.sidemenu-divider {
  border-top-color: rgba(221, 255, 221, 0.2);
  border-bottom: 0;
  width: calc(100% - 3rem);
  margin: auto;
}

.ahc-sidebar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: .5rem;
  line-height: 1;
}

.ahc-sidebar-btn--search {
  justify-content: start;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  max-height: 38px;
  color: rgba(255, 255, 255, 0.7) !important;
}
.ahc-sidebar-btn--search:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.ahc-sidebar-btn svg {
    height: 1rem;
    width: 1rem;
}

.ahc-sidebar-btn--ask-ai {
    background: #22c55e !important;
    color: #fff !important;
    box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.00), 0px 0px 0px 0px rgba(0, 0, 0, 0.00), 0px 1px 1px 0px rgba(20, 19, 78, 0.32), 0px 0px 0px 1px #36AE46;
    min-height: 36px;
}
.ahc-sidebar-btn--ask-ai:hover {
  background-color: #12ac4b !important;
}


/* --- Standardized Icon Container --- */
.category-card .card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Fit SVG Image within the container --- */
.category-card .card-icon img.ahc-cat-icon-img {
    width: 100%;
    max-width: 100%; 
    max-height: 100%;
    object-fit: contain;
}

/* --- Size the fallback font icon --- */
.category-card .card-icon i {
    font-size: 24px;
    color: #555;
}

/* Styles the new icon in the category page header */
.article-header .ahc-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-header .ahc-header-icon-img {
    width: 8rem;
    border-radius: .75rem;
}

.article-header .ahc-header-icon i {
    font-size: 28px;
    color: #444;
}

/* --- Styles for Voted/Muted Feedback Buttons --- */
.ahc-root .ahc-help-btn.picked.green {
    background-color: #d1fae5; /* A light green */
    border-color: #10b981;
    color: #065f46;
}
.ahc-root .ahc-help-btn.picked.green i {
    color: #065f46;
}

.ahc-root .ahc-help-btn.picked.black {
    background-color: #e5e7eb; /* A light gray */
    border-color: #9ca3af;
    color: #1f2937;
}
.ahc-root .ahc-help-btn.picked.black i {
    color: #1f2937;
}

.ahc-root .article-help.voted .ahc-help-btn.muted {
    opacity: 0.6;
    background-color: #f9fafb;
    pointer-events: none;
}
.article-help { position: relative; z-index: 1; }
.article-help .ahc-help-btn { cursor: pointer; }


#filter-date-to {
    padding: 6px 8px;
    border-radius: .375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    font-size: .875rem;
    font-family: inherit;
}

#filter-date-from {
    padding: 6px 8px;
    border-radius: .375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    font-size: .875rem;
    font-family: inherit;
}
/* --- Download file shortcode --- */
/* Wrapper */
.download-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  background: var(--bg-secondary);
  margin: 1rem 0;
}

/* Icon */
.download-box i {
  font-size: 1.75rem;
  color: var(--primary-color);
}

/* Meta (filename + size) */
.download-box .download-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.download-box .download-filename {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1;
}

.download-box .download-size {
  font-size: .75rem;
  color: var(--text-secondary);
  opacity: .7;
  line-height: 1.5;
}

/* Button */
.download-box .download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: .5rem;
  line-height: 1.5;
  background: #22c55e;
  color: #fff;
  box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.00), 0px 0px 0px 0px rgba(0, 0, 0, 0.00), 0px 1px 1px 0px rgba(20, 19, 78, 0.32), 0px 0px 0px 1px #36AE46;
  min-width: 100px;
}

.download-box .download-button:hover {
  background: #12ac4b;
  color: #fff;
}
/* --- Hide Like/Dislike Counts --- */
.ahc-reply-actions .ahc-ra-btn .cnt {
  display: none;
}

.category-topic-item-details {
    flex-grow: 1;
}

.category-topic-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d2327;
}

.category-topic-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #50575e;
    opacity: 0.8;
}

.category-topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.category-topic-meta i {
    font-size: 1.1em;
}

/* --- 404 Page Styles --- */
.ahc-404-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    height: 100%;
}

.ahc-404-icon {
    font-size: 64px;
    color: var(--danger-color, #d93025);
    margin-bottom: 24px;
    opacity: 0.8;
}

.ahc-404-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.ahc-404-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 450px;
}

.ahc-404-home-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    background-color: var(--accent-color);
    color: var(--accent-text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.ahc-404-home-btn:hover {
    background-color: #333;
}
/* --- Homepage Category Links --- */
.homepage-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
}
.homepage-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border-radius: .75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}
.homepage-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #ccc;
}
.homepage-category-card .card-icon {
    margin-bottom: 0.75rem;
}
.homepage-category-card .card-icon img {
    width: 32px;
    height: 32px;
}
.homepage-category-card .card-icon i {
    font-size: 32px;
    color: var(--text-secondary);
}
.homepage-category-card .card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* --- Social Share Buttons --- */
.ahc-social-share {
    padding: .75rem 0;
    margin: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.ahc-social-share .share-title {
    font-weight: 500;
    font-size: .875rem;
    color: var(--text-secondary);
}
.ahc-social-share .share-buttons {
    display: flex;
    gap: 0.5rem;
}
/* Styling for the container of the AI buttons */
.ahc-social-share .ai-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Base style for the new AI buttons */
.ahc-social-share .ai-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2rem; /* Match the height of the social buttons */
    padding: 0 1rem;
    border-radius: .5rem; /* This makes it pill-shaped */
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

/* Hover effect for the new AI buttons */
.ahc-social-share .ai-btn:hover {
    opacity: 0.85;
}

/* Branding colors for the new buttons */
.ahc-social-share .ai-btn-chatgpt {
    background-color: #10a37f;
}
.ahc-social-share .ai-btn-perplexity {
    background-color: #111827;
}

/* Style the SVG icons to match the size of the Remix Icons */
.ahc-social-share .ai-btn svg {
    width: 18px; 
    height: 18px;
    vertical-align: middle;
}
.ahc-social-share .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.ahc-social-share .share-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.ahc-social-share .share-btn i {
    font-size: 1.125rem;
}

/* --- AI Summarize Buttons --- */

.ai-summarize-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-summarize-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background-color: #3d4653; /* A neutral dark gray */
    border: 1px solid #3d4653;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.ai-summarize-button:hover {
    background-color: #555e69;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Specific button styles (optional but good for branding) */
.ai-summarize-chatgpt {
    background-color: #10a37f;
    border-color: #10a37f;
}

.ai-summarize-chatgpt:hover {
    background-color: #0b8064;
    border-color: #0b8064;
}

.ai-summarize-perplexity {
    background-color: #111827;
    border-color: #111827;
}

.ai-summarize-perplexity:hover {
    background-color: #000000;
    border-color: #000000;
}
/* Add styling for the new AI buttons */
.share-btn.chatgpt {
    background-color: #10a37f;
}
.share-btn.perplexity {
    background-color: #111827;
}

/* Style the SVG icons to match the size of the Remix Icons */
.share-btn.chatgpt svg,
.share-btn.perplexity svg {
    width: 18px; /* Match the font-size of the Remix Icons */
    height: 18px;
    vertical-align: middle;
}

.ahc-breadcrumbs{ 
    display: flex;
    gap: 1.5rem;
    flex-direction: column;
    width: 100%;
}
.ahc-bc-trail{ 
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex: 1 1 auto;
    white-space: nowrap;
    font-size: .875rem;
    font-weight: 500;
    flex-wrap: wrap;
}
.bc-item.bc-item--current {
    display: inline-block;
    max-width: 20ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
.bc-sep {
    opacity: .3;
    font-weight: 600;
}
.bc-link {
    color: var(--primary-color);
    text-decoration: none;
}
.bc-link:hover {
    color: var(--primary-color-hover);
}
.ahc-bc-meta{
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    opacity: .6;
    font-size: .75rem;
    white-space: nowrap;
}
.ahc-bc-dot{
    opacity:.5; 
    margin:0 2px
}
.ahc-bc-meta i{
    font-size:14px;
    margin-right:4px;
    opacity:.9
}
.ahc-bc-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
}
.ahc-ai-action, .ahc-copy-link {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.5;
  color: var(--text-secondary) !important;
  opacity: .7;
  position: relative;
}
.ahc-ai-action:hover, .ahc-copy-link:hover{
  opacity: 1; 
}
.ahc-copy-link.copied::after {
  content: 'Copied!';
  position: absolute;
  transform: translateY(-50%);
  inset: calc(100% + .75rem) auto auto auto;
  white-space: nowrap;
  font-size: .75rem;
  padding: 2px 6px;
  border-radius: .375rem;
  background: rgb(4, 123, 93);
  color: #fff;
  pointer-events: none;
  min-width: fit-content;
}
[dir="rtl"] .ahc-copy-link.copied::after {
    content: 'تم النسخ!';
}
.ahc-bc-actions i {
    font-size: 1rem;
}
.ahc-bc-actions svg {
    height: 1rem;
}
.ahc-bc-actions .v-sep {
  color: var(--text-secondary);
  opacity: .3;
  font-weight: 100;
}
.ahc-toc{
display: flex;
flex-direction: column;
gap: .75rem;
}
.ahc-rtl .ahc-toc {
    direction:rtl
}
.ahc-toc-title {
    font-weight:600;
    font-size:.875rem;
    opacity:1;
    display:flex;
    align-items:center;
    gap:.5rem;
}
.ahc-toc-title i, .ahc-btt i {
    font-size:inherit;
}
.ahc-btt {
    font-weight:600;
    font-size:.875rem;
    opacity:1;
    display:flex;
    align-items:center;
    gap:.5rem;
    width:fit-content;
    cursor:pointer;
}
.ahc-toc-hr {
    border-top: 1px solid var(--border-color);
    border-bottom: 0;
}
.ahc-toc ul {
    list-style:none;
    margin:0;
    padding:0;
    border-inline-start: 1px solid var(--border-color);
}
.ahc-toc a {
  display: inline-block;
  text-decoration: none;
  font-size: .875rem;
  color: var(--text-secondary);
  width: 100%;
  padding: .375rem 1rem;   
  max-width: 100%;
}
.ahc-toc a:hover {
    color:var(--text-primary);
}
.ahc-toc a[aria-current="location"] {
  color: var(--primary-color);
  border-inline-start: 1px solid var(--primary-color);
}
.ahc-toc .toc-list .toc-level-3 a { padding-inline-start: 2rem; }



/*
 * Wawp Sites Callout v1.2.0
 * Styles updated to match the AI Help Center design system.
 */

/* -------------------- Callout Card -------------------- */

.wawp-callout {
    /* Inherit the correct LTR/RTL font from the parent theme */
    font-family: inherit;

    /* Use CSS variables for consistency */
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #ededed);
    border-radius: 1rem; /* 16px, consistent with larger elements */
    padding: 1.25rem; /* 20px */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 1rem; /* 16px gap */
}

/* Icon Wrapper: Updated to use the primary green color theme */
.wawp-callout .icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e6f8f2; /* A light version of the primary green */
    color: var(--primary-color, #00bc7d);
    font-size: 20px;
    flex-shrink: 0;
}

.wawp-callout .title {
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: var(--text-primary, #111827);
}

.wawp-callout .desc-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: var(--text-secondary, #434960);
    flex-wrap: wrap;
}

/* CTA Button: Style the Bootstrap button to match the theme's primary color */
.wawp-callout .cta.btn-primary {
    background-color: var(--primary-color, #00bc7d);
    border-color: var(--primary-color, #00bc7d);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.wawp-callout .cta.btn-primary:hover {
    background-color: var(--primary-color-hover, #009966);
    border-color: var(--primary-color-hover, #009966);
}

.wawp-callout .meta-note {
    font-size: 0.875rem;
    color: var(--text-secondary, #434960);
    margin-top: 6px;
    opacity: 0.8;
}

/* -------------------- Modal List -------------------- */

.wawp-sites-modal .modal-content {
    border-radius: 1rem;
    border: 1px solid var(--border-color, #ededed);
}

.wawp-sites-modal .domain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color, #ededed);
}

.wawp-sites-modal .favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.wawp-sites-modal .domain-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wawp-sites-modal .domain {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #111827);
}

.wawp-sites-modal .search {
    border-radius: 10px;
}

/* Feedback animation for copy button */
.wawp-sites-modal .copied {
    pointer-events: none;
    opacity: 0.85;
}

.wawp-sites-modal .copied i {
    animation: wawpPop 0.35s ease;
}

@keyframes wawpPop {
    0% {
        transform: scale(0.9);
    }
    60% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

