:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #f8f9fa;
    --text-color: #34495e;
    --code-bg: #2d2d2d;
    --code-text: #f8f8f2;
    --border-color: #dee2e6;
}
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}
.container {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 280px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}
.sidebar h1 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}
.back-button {
    margin-bottom: 20px;
    text-align: center;
}
.btn-back {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}
.btn-back:hover {
    background-color: #2980b9;
    text-decoration: none;
    color: white;
}
.sidebar nav ul {
    list-style: none;
    padding: 0;
}
.sidebar nav ul li a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    margin-bottom: 5px;
}
.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    background-color: var(--secondary-color);
    color: #fff;
}
.main-content {
    margin-left: 320px;
    padding: 40px;
    width: calc(100% - 320px);
    box-sizing: border-box;
}
section {
    padding-bottom: 40px;
}
h2 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 2em;
}
h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-size: 1.5em;
    margin-top: 30px;
}
h4 {
    font-size: 1.2em;
    color: var(--secondary-color);
}
code {
    font-family: 'Source Code Pro', monospace;
    background-color: rgba(0,0,0,0.05);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.95em;
}
pre {
    background-color: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.endpoint, .ws-action, .inp-command, .operation-detail {
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--secondary-color);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    background-color: #fff;
}
.method {
    font-weight: 700;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 15px;
}
.get { background-color: #27ae60; }
.post { background-color: #2980b9; }
.ws { background-color: #8e44ad; }
.inp { background-color: #f39c12; }
/* Table wrapper for horizontal scrolling */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Auto-wrap parameter tables */
.parameter-table {
  
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
th, td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
    white-space: nowrap; /* Prevent text wrapping in cells for better mobile experience */
}

th {
    background-color: #f2f2f2;
    font-weight: 700;
}
.param-table .param-name { font-weight: bold; font-family: 'Source Code Pro', monospace; }
.param-table .param-type { color: #e74c3c; }
.param-table .param-req { color: #27ae60; }

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-sizing: border-box;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        box-sizing: border-box;
        padding: 20px;
    }
    
    /* Enhanced table responsiveness for mobile */
    .table-wrapper {
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .parameter-table {
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Force all tables in main content to scroll horizontally on mobile */
    .main-content table {
        white-space: nowrap;
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }
    
    .main-content table thead,
    .main-content table tbody,
    .main-content table tr {
        width: 100%;
        table-layout: fixed;
    }
    
    th, td {
        padding: 8px;
        font-size: 0.9em;
        min-width: 80px; /* Ensure columns don't get too narrow */
        display: table-cell;
    }
    
    /* Make parameter tables more readable on mobile */
    .parameter-table th, 
    .parameter-table td {
        min-width: 100px;
        white-space: normal; /* Allow wrapping in parameter descriptions */
    }
    
    .parameter-table td:last-child {
        white-space: normal; /* Allow description column to wrap */
        min-width: 150px;
    }

    /* Make syntax blocks more readable on mobile */
    .syntax {
        overflow-x: auto;
        background-color: rgba(0,0,0,0.05);
        padding: 10px;
        border-radius: 4px;
        margin: 10px 0;
    }
}

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .endpoint, .ws-action, .inp-command, .operation-detail {
        break-inside: avoid;
    }
}
