
/* SDK Help - Modern Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #002D60;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

/* Search Box */
.search-container {
    position: relative;
    margin-top: 15px;
}

#search {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#search:focus {
    outline: 2px solid #005a9e;
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
    z-index: 1000;
    display: none;
}

#search-results.show {
    display: block;
}

.search-result {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background: #f8f9fa;
}

.search-result a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.search-result strong {
    color: #0070c0;
    display: block;
    margin-bottom: 4px;
}

.search-result p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.search-result .category {
    display: inline-block;
    padding: 2px 8px;
    background: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
    color: #555;
}

.search-result .score {
    float: right;
    color: #ff9800;
    font-size: 12px;
    font-weight: bold;
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.breadcrumb a {
    color: #0070c0;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    background: white;
    margin: 20px auto;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 500px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 20px 0 10px;
    color: #222;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p {
    margin: 10px 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f5f5f5;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #fafafa;
}

/* Code */
code, pre {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

pre {
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

/* Code samples in tables (SDK Help format) */
.syntaxtable {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.syntaxtable th {
    background: #e0e0e0;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #ccc;
}

.syntaxtable td {
    width: 100%;
    padding: 12px;
}

.syntaxtable .copyCode {
    float: right;
    cursor: pointer;
    color: #0070c0;
    font-size: 12px;
}

/* Bugfix #23/#26/#27: Prevent code overflow with horizontal scroll */
.syntaxtable {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.CodeContainerTable {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    margin: 10px 0;
}

/* Override nowrap and force scrollable container */
.CodeContainerTable tr,
.CodeContainerTable tbody {
    display: block;
    width: 100%;
}

.CodeContainerTable td {
    display: block;
    width: 100%;
    padding: 0;
    white-space: normal !important;
    overflow-x: auto;
    overflow-y: hidden;
}

.CodeContainerTable td[nowrap] {
    white-space: normal !important;
}

/* Code elements: preserve formatting and enable horizontal scroll */
.CodeContainerTable code {
    display: block;
    width: max-content;
    min-width: 100%;
    white-space: pre !important;
    overflow-x: visible;
    background: #f5f5f5;
    padding: 12px;
    line-height: 1.6;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
}

/* Convert br tags to newlines in code */
.CodeContainerTable code br {
    display: block;
    content: "";
}

/* Ensure parent containers allow scroll */
.section .syntaxtable,
.section .CodeContainerTable,
.LanguageSpecific {
    max-width: 100%;
    overflow-x: auto;
}

/* Links */
a {
    color: #0070c0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

/* Index Page Specific */
.category-section {
    margin: 30px 0;
}

.category-section h2 {
    color: #0070c0;
    border-bottom: 2px solid #0070c0;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.file-card:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-card a {
    color: #333;
    text-decoration: none;
    display: block;
}

.file-card a:hover {
    color: #0070c0;
}

.stats {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.stats .number {
    font-size: 48px;
    font-weight: bold;
    color: #0070c0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 20px;
    }

    main {
        padding: 20px 15px;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }
}
