/* API Documentation CSS with Left Navigation Pane */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, "Lucida Grande", Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #1d1d1d;
    background-color: #ffffff;
    overflow: hidden; /* Prevent body scrolling */
}

/* Layout container */
.doc-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: transparent;
}

/* Left navigation pane */
#leftPane {
    display: flex;
    flex-direction: column;
    width: 25%;
    min-width: 250px;
    max-width: 360px;
    background-color: #ffffff;
    border-right: 1px solid #ccc;
    overflow-y: hidden;
    overflow-x: hidden;
    position: relative;
    z-index: 100;
}

/* Resizer for the left pane */
.pane-resizer {
    width: 6px;
    background-color: #eeeeee;
    border-left: 1px solid #eee;
    border-right: 1px solid #ccc;
    cursor: col-resize;
    position: relative;
    z-index: 101;
}

.pane-resizer:hover {
    background-color: #d3e1f1;
}

/* Content pane */
#contentPane {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
}

/* Navigation tree styling */
#leftPane .nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background-color: #eeeeee;
    border-bottom: 1px solid #cccccc;
    font-weight: bold;
    font-size: 18px;
    color: #295193;
    flex-shrink: 0;
}

#leftPane .nav-header .nav-header-home {
    color: #295193;
    text-decoration: none;
}

#leftPane .nav-header .nav-header-home:hover {
    text-decoration: underline;
}

/* Mobile navigation toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    color: #295193;
    min-width: 44px;
    min-height: 44px;
}

.mobile-nav-toggle:hover {
    background-color: rgba(211, 225, 241, 0.5);
    border-radius: 4px;
}

#leftPane .search-container {
    padding: 12px 14px 0 14px;
    background-color: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

#leftPane .nav-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#leftPane .nav-content .expand-all-btn {
    flex-shrink: 0;
}

#leftPane .search-container.has-query {
    border-bottom-color: #d3e1f1;
}

#leftPane .search-form {
    width: 100%;
}

#leftPane .search-form .textToSearch {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #bbbbbb;
    border-radius: 4px;
    font-size: 15px;
    color: #1d1d1d;
    text-align: center;
}

#leftPane .search-form .textToSearch:focus {
    outline: none;
    border-color: #295193;
    box-shadow: 0 0 0 2px rgba(41, 81, 147, 0.15);
    text-align: left;
}

#leftPane .search-form .textToSearch::-webkit-input-placeholder {
    text-align: center;
}

#leftPane .search-form .textToSearch::-moz-placeholder {
    text-align: center;
}

#leftPane .search-form .textToSearch:-ms-input-placeholder {
    text-align: center;
}

#leftPane .search-form .textToSearch::placeholder {
    text-align: center;
}

#leftPane .search-feedback {
    margin: 8px 0 6px 0;
    font-size: 15px;
    color: #555555;
    text-align: center;
}

#leftPane .search-results {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0 0 8px 0;
}

#leftPane .search-result-item {
    padding: 6px 0;
    border-top: 1px solid #eeeeee;
}

#leftPane .search-result-item:first-child {
    border-top: none;
}

#leftPane .search-result-item a {
    color: #295193;
    font-weight: bold;
    text-decoration: none;
}

#leftPane .search-result-item a:hover {
    text-decoration: underline;
}

#leftPane .search-result-item .result-meta {
    font-size: 15px;
    color: #666666;
    margin-top: 2px;
}

#leftPane ul.nav-tree {
    list-style-type: none;
    margin: 0;
    padding: 12px 0 50px 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

#leftPane ul.nav-tree li {
    margin: 0;
    padding: 0;
}

#leftPane ul.nav-tree li.nav-section {
    border-bottom: 1px solid #eee;
}

#leftPane ul.nav-tree li.nav-section > .nav-section-header {
    padding: 6px 18px;
    background-color: #f5f5f5;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
    color: #295193;
}

#leftPane ul.nav-tree li.nav-section > .nav-section-header:hover {
    background-color: #d3e1f1;
}

#leftPane ul.nav-tree li.nav-section > .nav-section-header.collapsed::before {
    content: "\25B6\0020";
    color: #666666;
}

#leftPane ul.nav-tree li.nav-section > .nav-section-header.expanded::before {
    content: "\25BC\0020";
    color: #666666;
}

#leftPane ul.nav-tree li.nav-section > ul {
    display: none;
    margin-left: 0;
    background-color: #fff;
}

#leftPane ul.nav-tree li.nav-section > ul.expanded {
    display: block;
}

#leftPane ul.nav-tree li.nav-item {
    padding: 3px 26px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
}

#leftPane ul.nav-tree li.nav-item:hover {
    background-color: #d8e4fa;
}

#leftPane ul.nav-tree li.nav-item.selected {
    background-color: #2f5bb7;
    font-weight: bold;
}

#leftPane ul.nav-tree li.nav-item a {
    color: #1f3f86;
    text-decoration: none;
    display: block;
    padding: 2px 0;
}

#leftPane ul.nav-tree li.nav-item a:visited {
    color: #1f3f86;
}

#leftPane ul.nav-tree li.nav-item a:hover {
    text-decoration: underline;
}

#leftPane ul.nav-tree li.nav-item.selected a {
    color: #ffffff;
}

#leftPane ul.nav-tree li.nav-item.selected a:visited {
    color: #ffffff;
}

/* Content area styling */
#contentPane h1.title.topictitle1 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #295193;
}

#contentPane h2.title.sectiontitle {
    font-size: 17px;
    font-weight: bold;
    margin: 15px 0 8px 0;
    color: #000;
}

#contentPane p {
    margin: 5px 0;
    line-height: 1.4;
}

#contentPane p.description {
    margin-bottom: 15px;
    font-style: italic;
}

#contentPane p.quicklinks {
    margin-bottom: 15px;
}

#contentPane a {
    color: #0066cc;
    text-decoration: none;
}

#contentPane a:hover {
    text-decoration: underline;
}

#contentPane a:visited {
    color: #0066cc;
}

/* Tables */
#contentPane table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 15px;
}

#contentPane table.table {
    border: 1px solid #ccc;
}

#contentPane th, #contentPane td {
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
    border: 1px solid #ccc;
}

#contentPane th {
    background-color: #f0f0f0;
    font-weight: bold;
}

#contentPane tr:hover {
    background-color: #f8f8f8;
}

/* Keyword styling */
#contentPane .keyword {
    font-weight: bold;
}

#contentPane .ph.b {
    font-weight: bold;
}

#contentPane .xref {
    color: #0066cc;
}

/* Hide the original navigation from content */
#contentPane .map {
    display: none;
}

/* Expand/Collapse functionality */
.expand-all-btn {
    margin: 0.5rem auto 1rem auto;
    padding: 0.25rem 0.75rem;
    background: #0088ce;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    display: block !important;
    text-align: center;
    max-width: 220px;
}

.expand-all-btn:hover {
    background: #0069a3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .doc-container {
        flex-direction: column;
        height: 100vh;
    }
    
    #leftPane {
        width: 100%;
        min-width: auto;
        max-width: none;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ccc;
        position: relative;
        z-index: 1000;
        flex-shrink: 0;
    }
    
    #leftPane .nav-header {
        position: relative;
        z-index: 1001;
        padding: 12px 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav-toggle {
        display: block !important;
    }
    
    #leftPane .search-container {
        position: sticky;
        top: 60px; /* Account for nav header height */
        z-index: 1000;
        background-color: #fafafa;
        border-bottom: 1px solid #e0e0e0;
        display: block !important;
        max-height: 40vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #leftPane .search-container.has-query {
        border-bottom-color: #d3e1f1;
        max-height: 50vh;
    }
    
    #leftPane .nav-content {
        display: none;
        background-color: #ffffff;
        border-top: 1px solid #e0e0e0;
        max-height: 40vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        z-index: 999;
    }
    
    #leftPane.nav-expanded .nav-content {
        display: block;
    }
    
    #leftPane ul.nav-tree {
        max-height: none;
        overflow-y: visible;
        padding-bottom: 20px;
    }
    
    #contentPane {
        flex: 1;
        height: auto;
        min-height: 0;
        padding: 10px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .pane-resizer {
        display: none;
    }
    
    /* Mobile search feedback styling */
    #leftPane .search-feedback {
        padding: 4px 8px;
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* Improve touch targets */
    #leftPane ul.nav-tree li.nav-section > .nav-section-header {
        padding: 12px 18px;
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    #leftPane ul.nav-tree li.nav-item {
        padding: 8px 26px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    #leftPane ul.nav-tree li.nav-item a {
        padding: 8px 0;
        font-size: 15px;
        line-height: 1.3;
    }
    
    #leftPane .search-form .textToSearch {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 8px 12px;
        min-height: 44px;
    }
    
    .expand-all-btn {
        padding: 8px 16px;
        font-size: 14px;
        margin: 8px auto;
        min-height: 44px;
        display: block !important;
        text-align: center;
        max-width: 240px;
    }
    
    /* Content area improvements */
    #contentPane table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #ccc;
    }
    
    #contentPane table thead,
    #contentPane table tbody {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    #contentPane th,
    #contentPane td {
        padding: 8px 6px;
        word-break: break-word;
        white-space: normal;
        vertical-align: top;
        min-width: 100px;
    }
    
    /* Property table specific styling */
    #contentPane table.table th:first-child,
    #contentPane table.table td:first-child {
        min-width: 120px;
        font-weight: bold;
    }
    
    #contentPane table.table th:nth-child(2),
    #contentPane table.table td:nth-child(2) {
        min-width: 80px;
    }
    
    #contentPane table.table th:nth-child(3),
    #contentPane table.table td:nth-child(3) {
        min-width: 70px;
    }
    
    #contentPane table.table th:last-child,
    #contentPane table.table td:last-child {
        min-width: 150px;
    }
    
    /* Better spacing for mobile */
    #contentPane h1.title.topictitle1 {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 16px;
    }
    
    #contentPane h2.title.sectiontitle {
        font-size: 20px;
        line-height: 1.3;
        margin: 20px 0 12px 0;
    }
    
    #contentPane p {
        line-height: 1.5;
        margin: 8px 0;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    #leftPane .nav-content {
        max-height: 40vh;
    }
    
    #contentPane {
        padding: 8px;
    }
    
    #leftPane ul.nav-tree li.nav-section > .nav-section-header {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    #leftPane ul.nav-tree li.nav-item {
        padding: 6px 22px;
    }
    
    #leftPane ul.nav-tree li.nav-item a {
        font-size: 14px;
    }
    
    #contentPane h1.title.topictitle1 {
        font-size: 20px;
    }
    
    #contentPane h2.title.sectiontitle {
        font-size: 18px;
    }
    
    /* Make tables more mobile friendly */
    #contentPane table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
    }
    
    #contentPane th,
    #contentPane td {
        padding: 6px 4px;
        font-size: 13px;
        min-width: 80px;
    }
    
    /* Better touch targets for mobile */
    .mobile-nav-toggle {
        font-size: 20px;
        padding: 10px;
    }
}

/* Landscape phones and small tablets */
@media (max-width: 768px) and (orientation: landscape) {
    #leftPane {
        max-height: 45vh;
    }
    
    #leftPane ul.nav-tree {
        max-height: 25vh;
    }
    
    #contentPane {
        min-height: 55vh;
    }
}