/* Tensile Documentation STYLESHEET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #c9d1d9;
    background-color: #0d1117;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Header */
.header {
    background: linear-gradient(135deg, #018340 0%, #047857 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Index page specific header - different structure */
body:has(section.intro) .header {
    display: block;
    text-align: center;
}

body:has(section.intro) .header h1 {
    font-size: 3rem;
    margin: 0;
}

body:has(section.intro) .header .version {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

body:has(section.intro) .header .tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-top: 0.5rem;
}
.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

/* Header branding for non-home pages */
.header-branding {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Index page specific header styles - override for home page */
body:has(section.intro) .header {
    display: block;
    text-align: center;
}

body:has(section.intro) .header h1 {
    font-size: 3rem;
    margin: 0;
}

body:has(section.intro) .header .version {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

body:has(section.intro) .header .tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-top: 0.5rem;
}

.header-branding .brand-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.header-branding .brand-version {
    font-size: 0.75rem;
    opacity: 0.8;
}

.header-branding .brand-tagline {
    font-size: 0.7rem;
    opacity: 0.7;
    font-style: italic;
}

/* Navigation */
.nav {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav a {
    color: #8b949e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav a:hover {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.nav a.active {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.15);
    font-weight: 600;
}

/* Container */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

/* Container for index page - block layout */
body:has(section.intro) .container,
body:has(.quickstart) .container {
    display: block;
    max-width: 1200px;
}

/* Ensure all content respects viewport width */
.content > * {
    max-width: 100%;
}

.content pre,
.content code,
.content table {
    max-width: 100%;
    overflow-x: auto;
}

/* Content area */
.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    flex: 0 0 290px;
    background-color: #161b22;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #30363d;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.sidebar h3 {
    color: #10b981;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    color: #8b949e;
    text-decoration: none;
    display: block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar a:hover {
    background-color: #21262d;
    color: #10b981;
}

.sidebar a.active {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 600;
    border-left: 3px solid #10b981;
}

/* Content */
.content {
    flex: 1;
    min-width: 0;
}

.content h2 {
    color: #10b981;
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #30363d;
}

.content h2:first-child {
    margin-top: 0;
}

.content h3 {
    color: #34d399;
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.content h4 {
    color: #6ee7b7;
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 0.6rem;
}

.content p {
    margin-bottom: 1rem;
    color: #c9d1d9;
}

.content ul, .content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content a {
    color: #10b981;
    text-decoration: none;
    transition: color 0.2s;
}

.content a:hover {
    color: #34d399;
    text-decoration: underline;
}

/* Code Blocks */
pre {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    max-width: 100%;
}

code {
    background-color: #161b22;
    color: #34d399;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    word-wrap: break-word;
}

pre code {
    background: none;
    padding: 0;
    color: #c9d1d9;
    display: block;
    overflow-x: auto;
}

/* Output sections in examples */
.output-section,
pre.output {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-left: 4px solid #10b981;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    color: #8b949e;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
}

.output-section h4,
.output-title {
    color: #10b981;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: normal;
}

/* Override Prism theme for dark mode */
code[class*="language-"],
pre[class*="language-"] {
    color: #c9d1d9;
    background: none;
    text-shadow: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

pre[class*="language-"] {
    background-color: #161b22;
    border: 1px solid #30363d;
}

/* Prism token colors for dark theme with green accents */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6e7681;
}

.token.punctuation {
    color: #c9d1d9;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #79c0ff;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #10b981;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #ff7b72;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #34d399;
}

.token.function,
.token.class-name {
    color: #6ee7b7;
}

.token.regex,
.token.important,
.token.variable {
    color: #ffa657;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: #161b22;
    border-radius: 6px;
    overflow: hidden;
}

th {
    background-color: #21262d;
    color: #10b981;
    padding: 0.8rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #30363d;
}

td {
    padding: 0.8rem;
    border-bottom: 1px solid #30363d;
    color: #c9d1d9;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #21262d;
}

/* Class/Method Signatures */
.class-signature, .method-signature {
    background-color: #161b22;
    border-left: 4px solid #10b981;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #34d399;
    border-radius: 4px;
    overflow-x: auto;
}

/* Quick Reference Box */
.quick-ref {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.quick-ref h2 {
    color: #10b981;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: none;
}

/* Method Cards Grid */
.common-methods {
    margin: 2rem 0;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.method-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.method-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.method-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.method-card a {
    color: #10b981;
    text-decoration: none;
}

.method-card a:hover {
    color: #34d399;
}

/* Parameters & Returns */
.parameters, .returns {
    background-color: #161b22;
    border-left: 3px solid #10b981;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.parameters h5 {
    color: #10b981;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.parameters dl {
    margin: 0;
}

.parameters dt {
    color: #34d399;
    font-weight: 600;
    margin-top: 0.5rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.parameters dd {
    color: #8b949e;
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.returns {
    border-left-color: #34d399;
}

.returns strong {
    color: #34d399;
}

/* API Cards (on hub page) */
.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.api-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
}

.api-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    transform: translateY(-4px);
}

.api-card h3 {
    color: #10b981;
    margin-top: 0;
    font-size: 1.5rem;
}

.api-card p {
    color: #8b949e;
    margin-bottom: 1.5rem;
}

.api-card a {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.api-card a:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: #161b22;
    border-top: 1px solid #30363d;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    color: #8b949e;
}

footer a {
    color: #10b981;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Alerts/Notes */
.note, .warning, .tip {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    border-left: 4px solid;
}

.note {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #c9d1d9;
}

.warning {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #c9d1d9;
}

.tip {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #c9d1d9;
}

/* INDEX PAGE SPECIFIC STYLES */
.header .version {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.header .tagline {
    font-size: 1.3rem;
    margin-top: 1rem;
    font-weight: 300;
}

.intro {
    background-color: #161b22;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    margin-bottom: 2rem;
    border: 1px solid #30363d;
}

.intro h2 {
    color: #10b981;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.intro p {
    font-size: 1.1rem;
    color: #8b949e;
    margin-bottom: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background-color: #161b22;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #30363d;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.feature-card h3 {
    color: #10b981;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.feature-card ul {
    list-style: none;
    padding-left: 0;
}

.feature-card li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #c9d1d9;
}

.feature-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.quickstart {
    background-color: #161b22;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #30363d;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    margin-bottom: 2rem;
}

.quickstart h2 {
    color: #10b981;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.quickstart h3 {
    color: #34d399;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.cta-section {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background-color: transparent;
    border-radius: 8px;
}

.cta-section h2 {
    color: #10b981;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    margin: 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #21262d;
    color: #10b981;
    border: 1px solid #10b981;
}

.btn-secondary:hover {
    background-color: #10b981;
    color: white;
}

/* INSTALLATION PAGE SPECIFIC STYLES */
.installation-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.installation-content {
    background-color: #161b22;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    border: 1px solid #30363d;
}

/* Info boxes */
.info-box, .warning-box, .tip-box {
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.info-box {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.warning-box {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
}

.tip-box {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* WRAPPER FOR PAGES WITH SIDEBAR */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper .container {
    flex: 1;
}

.page-wrapper footer {
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        max-height: none;
        flex: 1;
    }
    
    .methods-grid, .api-cards {
        grid-template-columns: 1fr;
    }
    
    .header-branding {
        position: static;
        transform: none;
        margin-top: 1rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    pre, .output-section {
        font-size: 0.75em;
    }
}
