/* ==========================================================================
   User Guide Page Specific Styles (user-guide.html)
   ========================================================================== */

/* Override section padding for user guide */
section#user-guide {
    padding: 0 !important;
}

/* Header Navigation - scoped to site-nav class only */
.site-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 0;
}

/* Guide container layout - sidebar on left, content on right */
.guide-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2rem;
    max-width: 1400px;
    margin: 3rem auto 0;
    padding: 2rem;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

/* Sidebar - fixed width, sticky positioning */
.guide-sidebar {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
    width: 260px;
    padding: 2rem 1.5rem 2rem 0;
    margin: 0;
    border-right: 1px solid var(--border-color);
    align-self: flex-start;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 10;
    box-sizing: border-box;
}

.sidebar-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-nav li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.sidebar-nav li a.active {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}

/* Main content area - MUST appear to the right of sidebar */
.guide-content {
    flex: 1 1 auto !important;
    min-width: 0;
    max-width: 900px;
    margin: 0;
    padding: 0 0 2rem 2rem;
    width: auto;
    box-sizing: border-box;
}

.guide-section {
    margin-bottom: 4rem;
    scroll-margin-top: 120px; /* anchors account for fixed header */
}

.guide-heading {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.guide-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Guide Steps */
.guide-steps {
    margin-top: 2rem;
}

.guide-step-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.guide-step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), #001F3F);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.3);
}

.guide-step-content h4 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.guide-step-content p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Settings List */
.settings-list {
    margin-top: 2rem;
}

.setting-item {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.setting-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(8px);
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.setting-name {
    font-size: 1.25rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0;
}

.setting-badge {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-description {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.setting-options {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.setting-options li {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.setting-default {
    color: var(--success-color);
    font-weight: 600;
    margin-top: 0.75rem;
    font-style: italic;
}

.setting-note {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 4px;
}

/* Guide Feature List */
.guide-feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.guide-feature {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s;
}

.guide-feature:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.feature-icon-small {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.guide-feature h4 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.guide-feature p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Keyboard Shortcuts Table */
.shortcuts-table {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 2rem;
}

.shortcut-row:last-child {
    border-bottom: none;
}

.shortcut-row:hover {
    background: white;
}

.shortcut-key {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.shortcut-key kbd {
    background: var(--secondary-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: inline-block;
    margin: 0 0.25rem;
}

.shortcut-action {
    color: var(--text-light);
    line-height: 1.6;
}

.shortcut-action a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.shortcut-action a:hover {
    color: var(--secondary-color);
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tip-card {
    background: linear-gradient(to bottom right, #FFF5F0, #FFFAF5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.tip-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.15);
    transform: translateY(-4px);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tip-card h4 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.tip-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Troubleshooting List */
.troubleshooting-list {
    margin-top: 2rem;
}

.troubleshooting-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.troubleshooting-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(247, 184, 1, 0.15);
}

.troubleshooting-item h4 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.troubleshooting-item h4::before {
    content: "⚠️";
    font-size: 1.5rem;
}

.troubleshooting-item ul {
    list-style: none;
    padding-left: 0;
}

.troubleshooting-item li {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.troubleshooting-item li::before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .guide-container {
        flex-direction: column !important;
        padding: 1rem;
    }

    .guide-sidebar {
        position: static !important;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        margin-bottom: 2rem;
        overflow-y: visible;
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 1 auto !important;
    }

    .guide-content {
        padding: 0;
        max-width: 100%;
    }

    .guide-heading {
        font-size: 1.5rem;
    }

    .guide-step-item {
        flex-direction: column;
        gap: 1rem;
    }

    .guide-step-number {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .setting-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .shortcuts-table {
        overflow-x: auto;
    }

    .shortcut-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .guide-feature-list {
        grid-template-columns: 1fr;
    }
}

/* Keyboard Shortcut Tooltip */
.shortcut-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted var(--secondary-color);
    text-decoration: none;
}

.shortcut-tooltip:hover {
    border-bottom-color: var(--primary-color);
}

.shortcut-tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    position: absolute;
    z-index: 100;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

/* Invisible hover bridge to prevent tooltip from disappearing */
.shortcut-tooltip .tooltip-text::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    pointer-events: auto;
}

.shortcut-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--secondary-color) transparent transparent transparent;
    pointer-events: auto;
}

.shortcut-tooltip:hover .tooltip-text,
.shortcut-tooltip .tooltip-text:hover {
    visibility: visible;
    opacity: 1;
}

.shortcut-tooltip a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 600;
}

.shortcut-tooltip a:hover {
    color: #FFD700;
}

/* Instruction boxes for the customization section */
.instruction-box {
    background: var(--bg-light);
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.instruction-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-box h4::before {
    content: "🔑";
    font-size: 1.25rem;
}

.instruction-box ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.instruction-box ol li {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.instruction-box code {
    background: rgba(0, 78, 137, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--secondary-color);
}

.chrome-url {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    font-family: monospace;
    background: rgba(255, 107, 53, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
    min-width: fit-content;
}

.chrome-url:hover {
    background: rgba(255, 107, 53, 0.2);
    color: var(--secondary-color);
}

/* ========================================================================
   DEFENSIVE SAFEGUARD (placed last to win cascade)
   Protects against any global nav rules from other stylesheets
   ======================================================================== */
.guide-sidebar nav,
.guide-sidebar .sidebar-navwrap {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    z-index: auto !important;
}

