/* Shared CSS for Dutchie API Documentation */

/* Reset and base styles */
* {
    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.7;
    color: #2d3748;
    background: #ffffff;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Documentation layout styles */
body.docs-layout {
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

body.page-layout {
    padding: 40px 50px;
    max-width: 1200px;
    margin: 0 auto;
    background: #fafbfc;
    min-height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: clamp(280px, 25vw, 350px);
    background: #000000;
    border-right: 1px solid #333333;
    overflow-y: auto;
    flex-shrink: 0;
    min-width: 280px;
    max-width: 350px;
    transition: width 0.2s ease;
}

.sidebar-header {
    padding: 20px;
    background: #000000;
    border-bottom: 1px solid #333333;
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 14px;
    color: #cccccc;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 12px 20px 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #333333;
    color: #ffffff;
}

.nav-item.active {
    background: #444444;
    color: #ffffff;
    border-right: 3px solid #ffffff;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 20px 30px;
    background: #0b2034;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid #0b2034;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.banner-logo {
    display: flex;
    align-items: center;
}

.dutchie-logo {
    height: 40px;
    width: auto;
}

.banner-title {
    display: flex;
    align-items: center;
}

.content-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    flex: 1;
    min-height: 0; /* Important for flex children */
}

.content-text {
    padding: 30px;
    line-height: 1.6;
    width: 100%;
}

.content-text h2 {
    color: #1f2937;
    margin-bottom: 16px;
    margin-top: 32px;
}

.content-text h2:first-child {
    margin-top: 0;
}

.content-text p {
    margin-bottom: 16px;
    color: #374151;
}

.content-text code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
}

.content-text pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.content-text pre code {
    background: none;
    padding: 0;
}

.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6b7280;
}

/* Typography - Enhanced modern hierarchy */
h1 {
    color: #1a202c;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    letter-spacing: -0.025em;
}

h2 {
    color: #1a202c;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 48px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    position: relative;
}

h2:first-child {
    margin-top: 0;
}

h2::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 8px;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

h3 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px 0;
    line-height: 1.4;
    letter-spacing: -0.015em;
}

h4 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    line-height: 1.5;
}

h5 {
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    line-height: 1.5;
}

p {
    margin-bottom: 18px;
    color: #4a5568;
    line-height: 1.7;
    font-size: 16px;
}

p:last-child {
    margin-bottom: 0;
}

/* Lead paragraph styling */
.lead {
    font-size: 18px;
    font-weight: 400;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.6;
}



/* Lists - Enhanced spacing and styling */
ul, ol {
    margin: 20px 0;
    padding-left: 24px;
}

ul {
    list-style: none;
    position: relative;
}

ul li {
    position: relative;
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.6;
    padding-left: 20px;
}

ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

ol li {
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.6;
    padding-left: 8px;
}

li ul, li ol {
    margin: 8px 0;
}

strong {
    color: #1a202c;
    font-weight: 600;
}

/* Code and pre-formatted text - Enhanced readability */
code {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    color: #e53e3e;
    border: 1px solid #e2e8f0;
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Code blocks for documentation pages */
.code-block {
    background-color: #2d3748;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    color: #ffffff;
    font-family: 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.code-block strong {
    color: #ffffff;
}

pre {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border: 1px solid #4a5568;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0 32px 0;
    overflow-x: auto;
    font-family: 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

pre::after {
    content: '⚫ ⚫ ⚫';
    position: absolute;
    top: 12px;
    left: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 8px;
    letter-spacing: 4px;
}

pre {
    position: relative;
}

pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    border: none;
    font-size: 14px;
    margin-top: 40px;
    display: block;
}

/* Copy button for code blocks */
.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 4px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.copy-button:active {
    transform: translateY(0);
}

/* Alert boxes - Modern design with icons */
.alert {
    padding: 20px 24px;
    margin: 28px 0;
    border-radius: 12px;
    border: 1px solid;
    position: relative;
    font-weight: 500;
    line-height: 1.6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 20px;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.alert strong {
    font-weight: 600;
}

.alert-info {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-color: #3182ce;
    color: #1e40af;
}

.alert-info::before {
    content: 'ℹ️';
    font-size: 16px;
}

.alert-success {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #38a169;
    color: #22543d;
}

.alert-success::before {
    content: '✅';
    font-size: 16px;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbf0 0%, #faf089 100%);
    border-color: #d69e2e;
    color: #744210;
}

.alert-warning::before {
    content: '⚠️';
    font-size: 16px;
}

.alert-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-color: #e53e3e;
    color: #742a2a;
}

.alert-danger::before {
    content: '🚨';
    font-size: 16px;
}

/* Highlight boxes - Enhanced design */
.highlight {
    background: linear-gradient(135deg, #fefcbf 0%, #fef08a 100%);
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.1);
}

.highlight::before {
    content: '💡';
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 16px;
}

.highlight strong {
    color: #92400e;
    margin-left: 24px;
    display: inline-block;
}

.highlight p {
    margin-left: 24px;
    color: #92400e;
}

/* Tables - Modern design with better spacing */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}

th {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

td {
    color: #4a5568;
    line-height: 1.6;
}

tr:hover {
    background: #f7fafc;
}

tr:last-child td {
    border-bottom: none;
}

table code {
    background: #edf2f7;
    color: #2d3748;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 4px;
}

/* Step numbers (for step-by-step guides) */
.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
    font-size: 13px;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    border: 2px solid #ffffff;
}

/* Larger step numbers (for quick start guides) */
.step-number-large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 16px;
    font-size: 18px;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
    border: 3px solid #ffffff;
    position: relative;
}

.step-number-large::after {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.2;
    z-index: -1;
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
    body.page-layout {
        padding: 30px 40px;
    }
}

@media (max-width: 1024px) {
    body.page-layout {
        padding: 25px 35px;
    }
}

@media (max-width: 768px) {
    body.page-layout {
        padding: 20px 24px;
        font-size: 15px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 24px;
        margin-top: 32px;
    }
    
    h2::before {
        left: -16px;
        width: 3px;
        height: 20px;
    }
    
    h3 {
        font-size: 20px;
        margin: 24px 0 12px 0;
    }
    
    h4 {
        font-size: 16px;
    }
    
    pre {
        padding: 20px 16px 16px 16px;
        font-size: 13px;
        border-radius: 8px;
        margin: 20px 0 28px 0;
    }
    
    pre::before {
        height: 32px;
        border-radius: 8px 8px 0 0;
    }
    
    pre::after {
        top: 8px;
        left: 12px;
    }
    
    pre code {
        margin-top: 32px;
    }
    
    .alert {
        padding: 16px 20px;
        margin: 20px 0;
        border-radius: 8px;
    }
    
    table {
        font-size: 14px;
        border-radius: 8px;
    }
    
    th, td {
        padding: 12px 16px;
    }
    
    .step-number-large {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin-right: 12px;
    }
}

@media (max-width: 480px) {
    body.page-layout {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .alert {
        padding: 14px 16px;
    }
    
    .step-number-large {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    pre {
        font-size: 12px;
        padding: 16px 12px 12px 12px;
        margin: 16px 0 24px 0;
    }
    
    pre::before {
        height: 28px;
    }
    
    pre::after {
        top: 6px;
        left: 10px;
    }
    
    pre code {
        margin-top: 28px;
    }
}
/* Additional modern elements */

/* Links styling */
a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* Focus states for accessibility */
a:focus, button:focus, .nav-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}

/* Improved scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

/* Hamburger Menu and Mobile Navigation */

/* Hide hamburger menu on desktop */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1001;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger animation when active */
.nav-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile navigation overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.overlay-active {
    display: block;
    opacity: 1;
}

/* Sidebar close button (hidden on desktop) */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tablet breakpoint - reduce sidebar slightly */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: clamp(260px, 22vw, 300px);
        min-width: 260px;
        max-width: 300px;
    }
}

/* Mobile responsive styles - hamburger menu activation */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }
    
    /* Show sidebar close button on mobile */
    .sidebar-close {
        display: flex;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 320px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Show sidebar when open */
    .sidebar.sidebar-open {
        left: 0;
    }
    
    /* Adjust main content to take full width on mobile */
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    /* Prevent body scroll when nav is open */
    body.nav-open {
        overflow: hidden;
    }
    
    /* Adjust header layout for mobile */
    .content-header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .banner-title h1 {
        font-size: 20px;
        margin: 0;
    }
    
    .dutchie-logo {
        height: 32px;
    }
    
    /* Ensure content area uses full width */
    .content-body {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 280px;
        left: -300px;
    }
    
    .content-header {
        padding: 12px 16px;
    }
    
    .banner-title h1 {
        font-size: 18px;
    }
    
    .dutchie-logo {
        height: 28px;
    }
}

/* Permissions page styles */
.permission-scope {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.permission-badge {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.permission-badge.basic {
    background: #6c757d;
}

.endpoint-list {
    margin-top: 16px;
}

.endpoint-list h5 {
    margin: 12px 0 8px 0;
    color: #495057;
    font-size: 16px;
}

.endpoint-list ul {
    margin: 8px 0;
}

.endpoint-list li {
    margin: 6px 0;
    font-size: 14px;
}

.endpoint-list code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
}

.use-case-examples {
    margin-top: 32px;
}

.use-case-examples h3 {
    margin: 24px 0 12px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 0 4px 4px 0;
}

.use-case-examples p {
    margin: 8px 0;
}
