/* ============================================
   VericoHub User Guide — Shared Styles
   ============================================ */

/* === Guide Layout Shell === */

.guide-page {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* --- Sidebar --- */

.guide-sidebar {
    flex: 0 0 260px;
    background: #0D2A45;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.guide-sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guide-sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.guide-sidebar-header .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.025em;
}

.guide-sidebar-title {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
}

.guide-sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.guide-sidebar-nav a {
    display: block;
    padding: 0.5rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.guide-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.guide-sidebar-nav a.active {
    background: rgba(31, 106, 225, 0.2);
    color: #fff;
    border-left-color: #1F6AE1;
    font-weight: 600;
}

.guide-sidebar-nav .guide-nav-sub {
    padding-left: 1rem;
}

.guide-sidebar-nav .guide-nav-sub a {
    font-size: 0.8125rem;
    padding: 0.375rem 1.25rem;
    color: rgba(255, 255, 255, 0.6);
}

.guide-sidebar-nav .guide-nav-sub a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.guide-sidebar-nav .guide-nav-sub a.active {
    color: #fff;
}

/* --- Main Content Area --- */

.guide-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.guide-main-header {
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.guide-main-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0D2A45;
    margin: 0;
}

.guide-main-body {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

.guide-main-footer {
    border-top: 1px solid #E5E7EB;
    padding: 1rem 2rem;
    font-size: 0.8125rem;
    color: #6B7280;
    background: #fff;
}

/* --- Mobile Toggle --- */

.guide-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0D2A45;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* === Guide Search === */

.guide-search {
    margin-bottom: 2rem;
}

.guide-search-input {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: border-color 0.15s;
}

.guide-search-input:focus-within {
    border-color: #1F6AE1;
}

.guide-search-icon {
    width: 20px;
    height: 20px;
    color: #9CA3AF;
    flex-shrink: 0;
}

.guide-search-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    color: #0D2A45;
}

.guide-search-input input::placeholder {
    color: #9CA3AF;
}

.guide-search-btn {
    padding: 0.625rem 1.25rem;
    background: #1F6AE1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.guide-search-btn:hover:not(:disabled) {
    background: #1857c2;
}

.guide-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.guide-search-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: guide-spin 0.6s linear infinite;
}

@keyframes guide-spin {
    to { transform: rotate(360deg); }
}

.guide-search-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(214, 69, 69, 0.06);
    border: 1px solid rgba(214, 69, 69, 0.2);
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.9rem;
}

.guide-search-answer {
    margin-top: 0.75rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}

.guide-search-answer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(31, 106, 225, 0.04);
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.875rem;
    color: #0D2A45;
}

.guide-search-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.guide-search-dismiss:hover {
    color: #374151;
}

.guide-search-answer-body {
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
}

.guide-search-answer-body a {
    color: #1F6AE1;
    text-decoration: none;
    font-weight: 500;
}

.guide-search-answer-body a:hover {
    text-decoration: underline;
}

/* === Guide Index Cards === */

.guide-index-hero {
    margin-bottom: 2rem;
}

.guide-index-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0D2A45;
    margin: 0 0 0.5rem 0;
}

.guide-index-hero p {
    font-size: 1.0625rem;
    color: #6B7280;
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

.guide-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.guide-index-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guide-index-card:hover {
    border-color: #1F6AE1;
    box-shadow: 0 4px 12px rgba(31, 106, 225, 0.1);
}

.guide-index-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #0D2A45;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-index-card .card-icon {
    width: 24px;
    height: 24px;
    color: #1F6AE1;
    flex-shrink: 0;
}

.guide-index-card p {
    font-size: 0.875rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

.guide-index-card .card-topics {
    font-size: 0.8125rem;
    color: #9CA3AF;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #F3F4F6;
}

/* Scroll targets — offset for sticky header */
.guide-content [id] {
    scroll-margin-top: 80px;
}

/* === Guide Content Styles (extracted from FormGuide) === */

.guide-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    max-width: 1200px;
}

/* Sticky table of contents */
.guide-toc {
    flex: 0 0 220px;
    position: sticky;
    top: 80px;
    background: white;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
}

.guide-toc h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6B7280);
    margin: 0 0 0.75rem 0;
}

.guide-toc nav ol {
    margin: 0;
    padding-left: 1.25rem;
}

.guide-toc nav li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.guide-toc nav a {
    color: var(--primary-color, #1F6AE1);
    text-decoration: none;
    font-size: 0.8125rem;
}

.guide-toc nav a:hover {
    text-decoration: underline;
}

/* Main content */
.guide-content {
    flex: 1;
    min-width: 0;
}

.guide-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary, #0D2A45);
    margin: 0 0 1rem 0;
    scroll-margin-top: 80px;
}

.guide-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #0D2A45);
    margin: 1.5rem 0 0.5rem 0;
}

.guide-section p, .guide-section li {
    color: var(--text-secondary, #374151);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

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

.guide-section code {
    background: #F4F6F8;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875em;
    color: #0D2A45;
}

/* Tables */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem 0;
    font-size: 0.9rem;
}

.guide-table th {
    background: #F4F6F8;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary, #0D2A45);
    border: 1px solid var(--border-color, #E5E7EB);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.guide-table td {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #E5E7EB);
    color: var(--text-secondary, #374151);
    vertical-align: top;
    line-height: 1.5;
}

.guide-table tr:nth-child(even) td {
    background: #FAFAFA;
}

/* Notes and warnings */
.guide-note, .guide-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 1rem 0;
    line-height: 1.5;
}

.guide-note {
    background: rgba(31, 106, 225, 0.06);
    border: 1px solid rgba(31, 106, 225, 0.2);
    color: #1e40af;
}

.guide-warning {
    background: rgba(214, 69, 69, 0.06);
    border: 1px solid rgba(214, 69, 69, 0.2);
    color: #b91c1c;
}

/* Screenshots */
.guide-screenshot {
    margin: 1rem 0;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    overflow: hidden;
}

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

.guide-screenshot.no-screenshot {
    display: none;
}

.screenshot-caption {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #6B7280);
    background: #F9FAFB;
    border-top: 1px solid var(--border-color, #E5E7EB);
    font-style: italic;
}

/* Tips section */
.guide-tips {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: 1.5rem;
}

.guide-tips h2 {
    color: #166534;
}

.guide-tips li {
    color: #166534;
}

/* Stub / coming soon */
.guide-stub {
    text-align: center;
    padding: 4rem 2rem;
    color: #6B7280;
}

.guide-stub h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0D2A45;
    margin: 0 0 0.75rem 0;
}

.guide-stub p {
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

.guide-stub .stub-icon {
    width: 64px;
    height: 64px;
    color: #D1D5DB;
    margin-bottom: 1rem;
}

/* === Feedback Buttons === */

.guide-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.guide-feedback-label {
    font-size: 0.8125rem;
    color: #9CA3AF;
    margin-right: 0.25rem;
}

.guide-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #fff;
    color: #6B7280;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
}

.guide-feedback-btn:hover:not(:disabled) {
    border-color: #1F6AE1;
    color: #1F6AE1;
    background: rgba(31, 106, 225, 0.04);
}

.guide-feedback-btn.active {
    border-color: #1F6AE1;
    color: #1F6AE1;
    background: rgba(31, 106, 225, 0.08);
    font-weight: 600;
}

.guide-feedback-btn:disabled:not(.active) {
    opacity: 0.5;
    cursor: default;
}

/* === Responsive === */

@media (max-width: 900px) {
    .guide-page {
        flex-direction: column;
    }

    .guide-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 50;
        width: 260px;
        transition: left 0.25s ease;
    }

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

    .guide-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 49;
    }

    .guide-sidebar-overlay.open {
        display: block;
    }

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

    .guide-main-body {
        padding: 1.25rem;
    }

    .guide-layout {
        flex-direction: column;
    }

    .guide-toc {
        position: static;
        flex: none;
        width: 100%;
    }

    .guide-index-grid {
        grid-template-columns: 1fr;
    }
}
