/* Base styles */
:root {
    /* Mach1 Color Palette */
    --hl-yellow: #F2FF5F;
    --hl-blue: #14DFBA;
    --hl-green: #38F708;
    --gray-zero: #181818;
    --gray-one: #282828;
    --gray-one-faded: #4E4E4E4E;
    --gray-two: #363636;
    --gray-three: #404040;
    --gray-four: #707070;
    --gray-five: #E4E4E4;
    --gray-six: #18181888;
    --gray-seven: #E5E5E5;
    --off-white: #FBFBFB;
    --new-white: #FAFAFA;
    --v2-yellow: #F3C635;

    /* Updated to match website colors */
    --m1yellow: #FFC61E;
    --mach1-yellow: #FFC61E;
    --mach1-yellow-dark: #e6b100;
    --mach1-yellow-light: #ffd24d;
    --dark-bg: #1A1A1A;
    --dark-bg-lighter: #282828;
    --dark-bg-lightest: #363636;
    --text-primary: #eaeaea;
    --text-secondary: #626161;
    --text-muted: #999999;
    --link: #eaeaea;
    --link-hover: #fff;
    --border-color: #333333;
    --accent-color: var(--gray-five);
    --transition-speed: 0.3s;
    --sidebar-width: 270px;
    --toc-width: 250px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'ProximaNova', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Link styling - matching research blog exactly */
a {
    color: var(--link);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px dotted rgba(234, 234, 234, 0.3);
}

a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* Navigation and special links don't have underlines */
.toc-sidebar a, .sidebar-logo a, .product-list a, .btn, .product-title a,
.search-result, .no-underline {
    border-bottom: none;
}

/* Interactive controls use accent color - matching research blog */
.btn, button, .interactive, .action-link {
    color: var(--mach1-yellow);
    border-bottom: none;
}

.btn:hover, button:hover, .interactive:hover, .action-link:hover {
    color: #ffd54f;
}

/* Layout */
.container {
    display: flex;
    flex: 1;
}

/* TOC Sidebar */
.toc-sidebar {
    width: var(--toc-width);
    background-color: var(--dark-bg-lightest);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--dark-bg-lightest);
}

.toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: var(--dark-bg-lightest);
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 6px;
}

.toc-sidebar-inner {
    padding: 0 15px;
}

.toc-sidebar h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.toc-sidebar h3::before {
    content: '\f02e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--accent-color);
}

.toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar li {
    margin-bottom: 4px;
}

.toc-sidebar a {
    display: block;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--text-primary);
    border-left: 3px solid transparent;
    transition: all var(--transition-speed);
    font-size: 0.95rem;
    position: relative;
}

.toc-sidebar a:hover, 
.toc-sidebar a.active {
    background-color: rgba(255, 193, 7, 0.15);
    border-left: 3px solid var(--accent-color);
    transform: translateX(5px);
    font-weight: bold;
}

/* Active link styling */
.toc-sidebar a.active {
    background-color: rgba(255, 193, 7, 0.25);
    color: var(--accent-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Accordion styling */
.toc-sidebar .has-submenu {
    margin-bottom: 8px;
}

.toc-sidebar .has-submenu > a {
    font-weight: 600;
    border-radius: 4px;
}

.toc-sidebar .has-submenu > a::after {
    content: '\f078'; /* Chevron down */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.7rem;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    opacity: 1;
}

.toc-sidebar .has-submenu.collapsed > a::after {
    content: '\f054'; /* Chevron right */
}

.toc-sidebar .has-submenu:not(.collapsed) > a {
    font-weight: bold;
    color: var(--accent-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.toc-sidebar ul ul {
    padding-left: 10px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.toc-sidebar .collapsed > ul {
    max-height: 0;
}

.toc-sidebar li.has-submenu > a {
    cursor: pointer;
}

/* Top-level sections */
.toc-sidebar > .toc-sidebar-inner > ul > li.has-submenu {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.1);
    padding-bottom: 10px;
}

.toc-sidebar > .toc-sidebar-inner > ul > li.has-submenu > a {
    font-size: 1.05rem;
    padding: 8px 10px;
    border-radius: 4px;
}

.toc-sidebar > .toc-sidebar-inner > ul > li.has-submenu > a:hover {
    background-color: rgba(255, 193, 7, 0.15);
}

.toc-sidebar > .toc-sidebar-inner > ul > li.has-submenu:not(.collapsed) > a {
    background-color: rgba(255, 193, 7, 0.2);
}

.sidebar-logo {
    text-align: center;
    padding: 5px 0;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
    max-width: 60%;
    height: auto;
    margin-top: 5px;
}

.sidebar-logo a {
    display: inline-block;
    border-left: none;
    padding: 0;
}

.sidebar-logo a:hover, 
.sidebar-logo a:focus, 
.sidebar-logo a:active {
    background-color: transparent;
    border-left: none;
    transform: none;
    color: inherit;
    font-weight: normal;
}

.toc-sidebar .sidebar-logo a:hover {
    background-color: transparent;
    border-left: none;
    transform: none;
}

/* Main content area */
.main-content {
    flex: 1;
    background-color: var(--dark-bg-lighter);
    padding: 40px;
    min-height: 100vh;
    margin-left: var(--toc-width);
}

/* Product sections */
.product-section {
    margin-bottom: 40px;
}

.product-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.product-title .tm {
    font-size: 0.7rem;
    vertical-align: super;
    margin-left: 2px;
    color: var(--text-secondary);
}

.product-list {
    list-style: none;
    margin: 0 0 0 20px;
}

.product-list li {
    margin-bottom: 15px;
    transition: transform var(--transition-speed);
}

.product-list li:hover {
    transform: translateX(5px);
}

.product-list a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
    display: block;
    font-size: 1.1rem;
    padding-left: 10px;
    border-left: 2px solid transparent;
}

.product-list a:hover,
.product-list a.active {
    color: var(--accent-color);
    border-left: 2px solid var(--accent-color);
}

.product-list a.active {
    font-weight: bold;
}

/* Doc content */
.doc-content {
    padding: 0;
    margin: 0;
    min-height: 400px;
}

/* Product content sections */
.product-content {
    display: none; /* Hide all content sections by default */
    padding: 0;
    margin: 0;
}

/* Active product content */
.product-content.active {
    display: block;
    padding: 0;
    margin: 0;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product content typography */
.product-content h2 {
    margin-top: 0;
    padding-top: 0;
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

/* Removed h2 underline - .product-content h2::after */

.product-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 30px 0 15px;
}

.product-content p {
    margin-bottom: 20px;
    line-height: 1.7;
}

.product-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.product-content li {
    margin-bottom: 10px;
}

/* Documentation sections */
.doc-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.doc-section h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    margin: 30px 0 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    position: relative;
}

.doc-section h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.doc-section h4 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin: 25px 0 10px;
}

.doc-section p, .doc-subsection p {
    margin: 15px 0;
    line-height: 1.7;
}

.doc-section strong {
    color: var(--accent-color);
    font-weight: 600;
}

.doc-section ul, .doc-subsection ul {
    margin: 15px 0;
    padding-left: 25px;
    list-style-type: none;
}

.doc-section ul li, .doc-subsection ul li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.doc-section ul li::before, .doc-subsection ul li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Special styles */
.doc-section .note, .doc-section .warning {
    background-color: var(--dark-bg-lightest);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.doc-section .note {
    border-left: 4px solid var(--accent-color);
}

.doc-section .warning {
    border-left: 4px solid #e74c3c;
}

.doc-section .parameter {
    margin-bottom: 25px;
    padding: 15px;
    background-color: var(--dark-bg-lightest);
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
    transition: all var(--transition-speed);
}

.doc-section .parameter:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.doc-section .parameter-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.doc-section .parameter-range {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.doc-section .parameter-description {
    color: var(--text-primary);
}

.doc-section .image-caption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Doc subsection styling */
.doc-subsection {
    margin: 25px 0 20px;
    padding-left: 15px;
    border-left: 2px solid var(--border-color);
}

.doc-subsection h4 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin: 15px 0 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--dark-bg-lightest);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    cursor: pointer;
    margin-right: 10px;
}

.btn:hover {
    background-color: var(--accent-color);
    color: var(--dark-bg);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    border: 1px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--gray-one-faded);
}

/* Image and tooltip styling */
.image-container {
    margin: 20px 0;
    text-align: center;
}

.tooltip-area {
    position: absolute;
    cursor: pointer !important;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.tooltip-area:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
}

#custom-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    max-width: 250px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .toc-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        position: relative;
        overflow-y: auto;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .product-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 15px 0;
    }
    
    .product-list li {
        margin-bottom: 5px;
    }
    
    .product-list a {
        font-size: 0.95rem;
        padding: 5px 10px;
        background-color: var(--dark-bg-lightest);
        border-radius: 4px;
        border-left: none;
    }
    
    .product-list a.active {
        background-color: var(--accent-color);
        color: var(--dark-bg);
    }
    
    /* Improve mobile image display */
    .image-container img {
        max-width: 100%;
        height: auto;
    }
    
    /* Make parameters more readable on small screens */
    .parameter {
        padding: 10px;
    }
    
    /* Adjust format list grid for mobile */
    .format-list {
        grid-template-columns: 1fr;
    }
    
    /* Adjust flexible containers for mobile */
    [style*="display: flex"] {
        flex-direction: column;
    }
    
    [style*="flex: 0 0"] {
        flex: 1 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Subheadings for sections */
.subheading {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
    display: flex;
    align-items: center;
}

.subheading::before {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.8rem;
    margin-right: 8px;
    color: var(--accent-color);
}

/* Format list styling */
.format-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px 20px;
    margin: 15px 0;
    list-style-position: inside;
}

.format-list li {
    padding: 5px 0;
    border-bottom: 1px dotted var(--border-color);
}

.format-list li::before {
    content: '\f1c7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    margin-right: 8px;
    color: var(--gray-three);
} 

/* Search functionality */
#search-container {
    margin: 15px 0 20px;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 198, 30, 0.2);
}

#search-input {
    flex: 1;
    background-color: transparent;
    border: none;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

#search-input:focus {
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#clear-search {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 10px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
}

#clear-search:hover {
    opacity: 1;
    color: var(--accent-color);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dark-bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-top: 5px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-speed);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#search-results.active {
    max-height: 400px;
    opacity: 1;
    overflow-y: auto;
}

.search-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.search-section-title {
    padding: 0 12px 5px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-color);
    text-transform: uppercase;
}

#search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#search-results li {
    margin: 0;
    padding: 0;
}

.search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color var(--transition-speed);
}

.search-result:hover {
    background-color: var(--dark-bg-lightest);
}

.result-text {
    flex: 1;
    font-size: 0.9rem;
}

.result-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    background-color: var(--dark-bg);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.search-highlight {
    animation: highlight-pulse 2s;
}

@keyframes highlight-pulse {
    0% { background-color: rgba(255, 198, 30, 0.3); }
    100% { background-color: transparent; }
}

/* Print button */
#print-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: var(--dark-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
    z-index: 100;
}

#print-button:hover {
    background-color: var(--gray-one-faded);
    transform: scale(1.1);
}

/* Print styles */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    .toc-sidebar, #print-button, #search-container {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }
    
    .product-content {
        display: block !important;
        page-break-after: always;
    }
    
    .product-content h2 {
        color: #000;
    }
    
    .product-content h3 {
        color: #333;
    }
    
    .product-content h4 {
        color: #555;
    }
    
    .doc-section {
        page-break-inside: avoid;
    }
    
    .doc-section h3::after {
        background-color: #333;
    }
    
    .parameter {
        border: 1px solid #ddd;
        background-color: #f9f9f9;
        color: #333;
    }
    
    .parameter-title {
        color: #000;
    }
    
    .note, .warning {
        border: 1px solid #ddd;
        background-color: #f9f9f9;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    img {
        max-width: 100% !important;
    }
    
    .tooltip-area {
        border: none !important;
    }
    
    .tooltip-area::after {
        display: none !important;
    }
}

/* Print modal */
.print-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.print-modal-content {
    background-color: var(--dark-bg-lighter);
    border-radius: 6px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.print-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-modal-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.print-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.print-modal-close:hover {
    color: var(--accent-color);
}

.print-modal-body {
    padding: 20px;
}

.print-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.print-option {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.print-option input[type="radio"] {
    margin-right: 10px;
}

.custom-sections {
    margin-left: 25px;
    margin-bottom: 20px;
    padding: 10px;
    border-left: 2px solid var(--border-color);
}

.print-checkbox {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.print-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.print-tips {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--dark-bg-lightest);
    border-radius: 4px;
    font-size: 0.9rem;
}

.print-tips ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.print-tips li {
    margin-bottom: 5px;
}

/* Printing class */
body.printing {
    background-color: white;
    color: black;
}

body.printing .toc-sidebar,
body.printing #print-button {
    display: none !important;
}

body.printing .main-content {
    margin-left: 0;
    padding: 0;
    width: 100%;
}