/* Wisanna Knowledge Hub Styles */

:root {
    --sidebar-width: 280px;
    --header-height: 80px;
}

/* Layout */
.guide-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* Sidebar */
.guide-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--neutral-off-white);
    border-right: 1px solid rgba(13, 44, 84, 0.1);
    padding: 2rem 1.5rem;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

/* Main Content */
.guide-main {
    flex: 1;
    padding: 3rem 4rem;
    max-width: 1000px;
    /* Reading width */
    min-width: 0;
    /* Prevent flex item from overflowing */
    margin: 0 auto;
    /* Centering content in the main area */
}

/* Sidebar Navigation */
.guide-nav-section {
    margin-bottom: 2rem;
}

.guide-nav-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-slate);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.guide-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-nav-item {
    margin-bottom: 0.25rem;
}

.guide-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--primary-navy);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    /* Prepare for active state */
}

.guide-nav-link:hover {
    background: rgba(13, 44, 84, 0.05);
    color: var(--accent-gold);
}

.guide-nav-link.active {
    background: rgba(255, 183, 0, 0.1);
    color: var(--primary-navy);
    font-weight: 600;
    border-left: 3px solid var(--accent-gold);
}

/* Mobile Sidebar Toggle */
.guide-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: var(--primary-navy);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Breadcrumbs */
.guide-breadcrumbs {
    margin-bottom: 2rem;
    color: var(--secondary-slate);
    font-size: 0.9rem;
}

.guide-breadcrumbs a {
    color: var(--secondary-slate);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.guide-breadcrumbs a:hover {
    color: var(--accent-gold);
}

.guide-breadcrumbs span {
    margin: 0 0.5rem;
}

/* Search Bar (Hub) */
.hub-search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.hub-search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-slate);
    pointer-events: none;
}

.hub-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 2px solid rgba(13, 44, 84, 0.1);
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hub-search-input:focus {
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 4px 20px rgba(255, 183, 0, 0.15);
}

/* Quick Start Cards */
.quick-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem;
}

.guide-card {
    background: var(--neutral-white);
    border: 1px solid rgba(13, 44, 84, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-gold);
    text-decoration: none;
    color: inherit;
}

/* Border Variants for Cards */
.guide-card.accent-gold {
    border-left: 4px solid var(--accent-gold);
}

.guide-card.primary-navy {
    border-left: 4px solid var(--primary-navy);
}

.guide-card.success-green {
    border-left: 4px solid #28a745;
}

.guide-card-icon {
    background: rgba(13, 44, 84, 0.05);
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-navy);
    font-size: 1.5rem;
}

.guide-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-navy);
}

.guide-card p {
    color: var(--secondary-slate);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.guide-card-link {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid rgba(255, 183, 0, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    pointer-events: none;
}

.guide-card:hover .guide-card-link {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    border-bottom-width: 2px;
}

/* Prompt Box with Copy */
.prompt-box {
    background: var(--neutral-off-white);
    border: 1px solid rgba(13, 44, 84, 0.1);
    border-radius: 8px;
    padding: 0;
    /* Reset padding, handled by children */
    margin: 1.5rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Clip header background */
}

.prompt-header {
    background: rgba(13, 44, 84, 0.04);
    border-bottom: 1px solid rgba(13, 44, 84, 0.08);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.prompt-content {
    padding: 1.25rem 1.5rem 0.5rem 1.5rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-navy);
    white-space: pre-wrap;
    margin-bottom: 0;
}

.copy-btn {
    position: static;
    /* Reset from absolute */
    background: white;
    border: 1px solid rgba(13, 44, 84, 0.15);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--secondary-slate);
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-navy);
    border-color: var(--accent-gold);
}

/* Try in Wisanna Button */
.try-btn {
    position: static;
    /* Reset from absolute */
    background: var(--primary-navy);
    border: 1px solid var(--primary-navy);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.try-btn:hover {
    background: #1a365d;
    color: white;
    /* Keep white text on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.prompt-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.prompt-tag {
    font-size: 0.75rem;
    background: rgba(13, 44, 84, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    color: var(--primary-navy);
    font-weight: 500;
}

/* Link Styles - Elegant and Consistent */
/* Base style for all content links (excluding navigation, buttons, breadcrumbs, card links) */
.guide-main a:not(.guide-card-link):not(.guide-nav-link):not(.btn):not(.guide-breadcrumbs a):not(.try-btn):not(.copy-btn) {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid rgba(255, 183, 0, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.guide-main a:not(.guide-card-link):not(.guide-nav-link):not(.btn):not(.guide-breadcrumbs a):not(.try-btn):not(.copy-btn):hover {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    border-bottom-width: 2px;
}

/* CTA Links - More prominent */
.guide-main .cta-link,
.guide-main a.cta-link {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 183, 0, 0.4);
    transition: all 0.2s ease;
    padding-bottom: 2px;
}

.guide-main .cta-link:hover,
.guide-main a.cta-link:hover {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    background: rgba(255, 183, 0, 0.1);
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
}

/* Links in lists */
.guide-main ul a,
.guide-main ol a,
.guide-main li a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid rgba(255, 183, 0, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.guide-main ul a:hover,
.guide-main ol a:hover,
.guide-main li a:hover {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    border-bottom-width: 2px;
}

/* Links in info boxes and checklists */
.info-box a,
.checklist a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid rgba(255, 183, 0, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.info-box a:hover,
.checklist a:hover {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    border-bottom-width: 2px;
}

/* External links indicator */
.guide-main a[target="_blank"]:not(.guide-card-link):not(.guide-nav-link):not(.btn):not(.guide-breadcrumbs a)::after {
    content: " ↗";
    font-size: 0.85em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.guide-main a[target="_blank"]:not(.guide-card-link):not(.guide-nav-link):not(.btn):not(.guide-breadcrumbs a):hover::after {
    opacity: 1;
}

/* Email links */
.guide-main a[href^="mailto:"] {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid rgba(255, 183, 0, 0.3);
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.guide-main a[href^="mailto:"]:hover {
    color: var(--primary-navy);
    border-bottom-color: var(--accent-gold);
    border-bottom-width: 2px;
}

/* Table of Contents Box */
.toc-box {
    background: var(--neutral-off-white);
    border: 1px solid rgba(13, 44, 84, 0.1);
    padding: 2rem;
    margin: 2rem 0 3rem;
    border-radius: 8px;
}

.toc-box h2,
.toc-box h3,
.toc-box h4 {
    margin-top: 0;
    font-size: 1.6rem;
    color: var(--primary-navy);
    margin-bottom: 1.25rem;
    /* Increased spacing between header and list */
}

.toc-box h3 {
    font-size: 1.4rem;
}

.toc-box h4 {
    font-size: 1.2rem;
}

.toc-box ol,
.toc-box ul {
    margin-top: 0.5rem;
    /* Additional spacing from header */
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.toc-box li {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-navy);
    padding-left: 0.75rem;
    /* Increased spacing between bullet/number and text */
}

.toc-box a {
    text-decoration: none;
    color: var(--primary-navy);
    font-weight: normal;
    transition: color 0.2s ease;
}

.toc-box a:hover {
    color: var(--accent-gold);
}

/* Doc Content Styles */
.guide-main h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-navy);
}

.guide-main .lead {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--secondary-slate);
    margin-bottom: 2.5rem;
}

.guide-main h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(13, 44, 84, 0.1);
    margin-bottom: 1.5rem;
    color: var(--primary-navy);
    text-align: left;
    /* Ensure left alignment */
}

.guide-main h3 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-navy);
    text-align: left;
    /* Ensure left alignment */
}

.guide-main p,
.guide-main li {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--neutral-dark);
}

.guide-main ul,
.guide-main ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.guide-main li {
    margin-bottom: 0.5rem;
}

/* Timeline Fixes */
.timeline-item ul,
.timeline-item ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.timeline-item {
    padding-left: 2rem;
}

/* Checklist Fixes */
.checklist {
    background: var(--neutral-off-white);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.checklist h3 {
    margin-top: 0;
}

.checklist ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
}

.checklist ol li {
    padding-left: 0.5rem;
    margin-bottom: 0.75rem;
}

.checklist ol li::before {
    content: none;
    /* Remove checkmark for ordered lists */
}

.info-box {
    background: rgba(13, 44, 84, 0.04);
    border: 1px solid rgba(13, 44, 84, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

/* Screenshot container */
.screenshot-container {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(13, 44, 84, 0.1);
}

.screenshot-container img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-caption {
    padding: 0.75rem;
    background: var(--neutral-off-white);
    font-size: 0.9rem;
    color: var(--secondary-slate);
    text-align: center;
    border-top: 1px solid rgba(13, 44, 84, 0.1);
}

/* Interactive Concepts */
.concept {
    border-bottom: 1px dotted var(--accent-gold);
    cursor: help;
    position: relative;
    color: var(--primary-navy);
    font-weight: 500;
}

/* Desktop Tooltip */
.concept::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-navy);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: normal;
    width: 250px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.concept::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--primary-navy);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    z-index: 1000;
}

/* Show tooltip on hover for non-touch devices */
@media (hover: hover) {

    .concept:hover::after,
    .concept:hover::before {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile Toast/Snackbar for concepts */
#concept-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-navy);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#concept-toast.active {
    transform: translateX(-50%) translateY(0);
}

#concept-toast-content {
    font-size: 0.95rem;
    line-height: 1.4;
}

#concept-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    padding: 0 0.5rem;
}

/* Comparison Table */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    border: 1px solid rgba(13, 44, 84, 0.1);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table thead tr {
    background: var(--neutral-off-white);
    border-bottom: 2px solid var(--primary-navy);
}

.comparison-table th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-navy);
}

.comparison-table th.primary-text {
    color: var(--primary-navy);
}

.comparison-table tr {
    border-bottom: 1px solid #eee;
}

.comparison-table tr:last-child {
    border-bottom: none;
}

.comparison-table td {
    padding: 1.2rem;
    color: var(--neutral-dark);
}

/* Utility Classes */
.text-center {
    text-align: center !important;
}

.mb-2rem {
    margin-bottom: 2rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1rem {
    margin-top: 1rem !important;
}

.mt-1-5rem {
    margin-top: 1.5rem !important;
}

.border-none {
    border: none !important;
}

/* Language Switcher - Matching Landing Page Style */
.language-switcher {
    position: relative;
    margin: 0 10px;
}

.language-dropdown {
    position: relative;
    cursor: pointer;
}

.language-current {
    color: var(--accent-gold);
    font-size: 14px;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.language-dropdown:hover .language-current {
    background: rgba(255, 183, 0, 0.08);
    color: var(--primary-navy);
}

.language-current::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-dropdown:hover .language-current::after {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
}

.language-dropdown:hover .language-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    color: #333;
    font-size: 14px;
    font-family: var(--font-body);
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    display: block;
}

.language-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.language-option:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.language-option:hover {
    background-color: rgba(255, 183, 0, 0.1);
    color: var(--primary-navy);
    padding-left: 20px;
    /* Slight shift on hover */
}

.language-option.active {
    background-color: var(--accent-gold);
    color: var(--primary-navy);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 992px) {
    .guide-layout {
        flex-direction: column;
    }

    .guide-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
        width: 80%;
        max-width: 300px;
    }

    .guide-sidebar.active {
        left: 0;
    }

    .guide-main {
        padding: 2rem 1.5rem;
    }

    .guide-sidebar-toggle {
        display: flex;
    }

    .try-btn {
        position: static;
        display: inline-block;
        margin-top: 0;
        margin-right: 0;
    }

    .copy-btn {
        position: static;
        display: inline-block;
        margin-top: 0;
    }

    .language-switcher {
        margin: 0 8px;
    }

    .language-current {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* RTL (Hebrew) overrides */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .guide-layout {
    flex-direction: row-reverse; /* force sidebar to the right */
}

html[dir="rtl"] .guide-sidebar {
    order: 2; /* sidebar on the right */
}

html[dir="rtl"] .guide-main {
    order: 1;
}

html[dir="rtl"] .guide-sidebar {
    border-right: none;
    border-left: 1px solid rgba(13, 44, 84, 0.1);
}

html[dir="rtl"] .guide-nav-link {
    border-left: 0;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .guide-nav-link.active {
    border-left: 0;
    border-right: 3px solid var(--accent-gold);
}

html[dir="rtl"] .hub-search-icon {
    left: auto;
    right: 1.2rem;
}

html[dir="rtl"] .hub-search-input {
    padding: 1rem 3rem 1rem 1.5rem;
}

html[dir="rtl"] .guide-main h2,
html[dir="rtl"] .guide-main h3 {
    text-align: right;
}

html[dir="rtl"] .guide-main ul,
html[dir="rtl"] .guide-main ol {
    padding-left: 0;
    padding-right: 1.5rem;
}

html[dir="rtl"] .toc-box ol,
html[dir="rtl"] .toc-box ul {
    padding-left: 0;
    padding-right: 1.5rem;
}

html[dir="rtl"] .toc-box li {
    padding-left: 0;
    padding-right: 0.75rem;
}

html[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 2rem;
}

html[dir="rtl"] #concept-toast-close {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .language-options {
    left: auto;
    right: 0;
}

html[dir="rtl"] .language-option:hover {
    padding-left: 16px;
    padding-right: 20px;
}

/* Mobile toggle button feels more natural on the left in RTL */
html[dir="rtl"] .guide-sidebar-toggle {
    right: auto;
    left: 20px;
}

@media (max-width: 992px) {
    html[dir="rtl"] .guide-sidebar {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    html[dir="rtl"] .guide-sidebar.active {
        right: 0;
    }
}