/* Default state for mobile menu elements */
.menu-toggle, .overlay { display: none; }


/* General API Docs Layout */
body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background-color: var(--color-card);
    padding: 20px;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-secondary);
    padding-bottom: 15px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 10px 15px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content Styles */
.content {
    flex-grow: 1;
    padding-left: 30px;
    min-width: 0; /* Prevents flex items from overflowing */
}

.content h1, .content h3 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
}

/* API Section Styling */
.api-section {
    margin-bottom: 2rem;
    padding-top: 1rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--color-secondary);
    margin: 2.5rem 0;
}

/* API Endpoint Display */
.api-endpoint {
    display: flex;
    align-items: center;
    background-color: var(--color-card-alt);
    border: 1px solid var(--color-secondary);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 1rem 0;
    font-family: 'Courier New', Courier, monospace;
}

.api-endpoint .method {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    margin-right: 15px;
    color: #fff;
    font-size: 0.9em;
}

.api-endpoint .method.get { background-color: #007bff; }
.api-endpoint .endpoint-url {
    font-size: 1.1em;
    color: var(--color-text);
    word-break: break-all;
}

/* Code Block Wrapper */
.code-block-wrapper {
    border: 1px solid var(--color-secondary);
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-card-alt);
    padding: 8px 15px;
    font-size: 0.9em;
    color: var(--color-label);
    border-bottom: 1px solid var(--color-secondary);
}

.copy-code-btn {
    background: none;
    border: 1px solid var(--color-secondary);
    color: var(--color-label);
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}
.copy-code-btn:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}
.copy-code-btn:disabled {
    cursor: default;
    color: #00b894;
    border-color: #00b894;
}

/* Remove default margin from pre inside wrapper */
.code-block-wrapper pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background-color: var(--color-card);
}

.param-list li {
    margin-bottom: 0.5rem;
}

/* Responsive Styles for Mobile */
@media (max-width: 992px) {
    .container { padding: 0; }
    .menu-toggle {
        display: block; position: fixed; top: 15px; left: 15px; z-index: 1001;
        background: var(--color-card); border: 1px solid var(--color-secondary); color: var(--color-text);
        width: 40px; height: 40px; border-radius: 8px; font-size: 18px; cursor: pointer;
    }
    .sidebar {
        position: fixed; left: -100%; top: 0; height: 100%; z-index: 1000;
        transition: left 0.3s ease-in-out; box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        border-radius: 0; width: 280px;
        overflow-y: auto;
    }
    .sidebar.active { left: 0; }
    /* Hide the original "back-to-home" link and show the one inside the list on mobile */
    .sidebar > .back-to-home { display: none; }
    .sidebar ul .back-to-home {
        display: block;
    }
    .sidebar ul li a.back-to-home:hover {
        background-color: var(--color-secondary);
    }
    .content {
        padding: 20px;
        padding-top: 70px; /* Space for fixed menu button */
        padding-left: 20px; /* Override desktop padding */
    }
    .overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        pointer-events: none;
    }
    .overlay.active { opacity: 1; pointer-events: auto; }
}