/* InSAR Documentation Styles */

/* Override body padding for documentation page */
body.documentation-page {
    padding-top: 160px !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
}

/* Ensure no parent has overflow hidden which breaks sticky */
body, html {
    overflow-x: visible !important;
}

/* Ensure doc-content doesn't create stacking context issues */
.doc-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    overflow: visible !important;
    height: auto !important;
}

.doc-header {
    background: linear-gradient(135deg, #0556b1d7 0%, #0556b1d7 100%);
    color: white;
    padding: 10px 10px;
    text-align: center;
    border-radius: 0;
    margin-bottom: 0;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.doc-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.doc-header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.version-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-top: 10px;
}

nav.doc-nav {
    background: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 2px solid #e9ecef;
    position: -webkit-sticky;
    position: sticky;
    top: 180px; /* Stick at this position (below site header) when scrolling */
    left: 0;
    right: 0;
    z-index: 100; /* Lower than site header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

nav.doc-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

nav.doc-nav a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

nav.doc-nav a:hover {
    color: #667eea;
}

/* Content section with proper padding */
.content {
    padding: 20px 20px;
}

section {
    margin-bottom: 30px;
    scroll-margin-top: 270px;
}

h2 {
    color: #1e3c72;
    font-size: 2em;
    margin-bottom: 15px;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

h3 {
    color: #2a5298;
    font-size: 1.5em;
    margin: 20px 0 10px;
}

h4 {
    color: #4a5568;
    font-size: 1.2em;
    margin: 15px 0 8px;
}

.highlight-box,
.concept-box,
.info-box {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.example-box {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.analogy-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

/* Code container styling */
.code-container {
    position: relative;
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.code-header {
    background: #21252b;
    color: #abb2bf;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.code-title {
    font-weight: 600;
    color: #61afef;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background: #3e4451;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #4b5363;
}

.copy-btn.copied {
    background: #4CAF50;
}

/* Override default pre/code styling */
.code-container pre {
    margin: 0;
    border-radius: 0;
    background: #282c34;
}

.code-container pre code {
    display: block;
    padding: 25px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    background: transparent;
    overflow-x: auto;
}

/* Simple code blocks without container */
.code-block {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Inline code */
code:not(.code-container code):not(.code-block) {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #ddd;
}

.comparison-table th {
    background: #2a5298;
    color: white;
    font-weight: 600;
}

.comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

.metadata-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

.metadata-table th,
.metadata-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.metadata-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.metadata-table tr:hover {
    background: #f0f7ff;
}

.badge-required {
    background: #dc3545;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
}

.badge-recommended {
    background: #ffc107;
    color: #333;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
}

.structure-diagram,
.visual-diagram {
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    font-family: monospace;
    overflow-x: auto;
}

.tree-line {
    padding: 3px 0;
}

.indent-1 { margin-left: 20px; }
.indent-2 { margin-left: 40px; }
.indent-3 { margin-left: 60px; }
.indent-4 { margin-left: 80px; }

.group { color: #0066cc; font-weight: bold; }
.dataset { color: #009900; }
.attribute { color: #cc6600; font-style: italic; }
.comment { color: #999; font-style: italic; }

@media (max-width: 768px) {            
    .doc-content {
        padding: 20px 10px;
    }
    
    nav.doc-nav {
        padding: 15px 20px;
        top: 160px; /* Adjust for mobile if site header is smaller */
    }
    
    nav.doc-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .content {
        padding: 20px 10px;
    }
    
    section {
        scroll-margin-top: 240px;
    }
    
    .code-container pre code,
    .code-block {
        font-size: 0.85em;
        padding: 15px;
    }
}