/* Documentation page specific styles */
body {
    background-color: #ffffff;
    margin-left: 15%;
    margin-right: 15%;
}

.docs-container {
    padding: 10px;
}

.docsHeadingSection {
    text-align: center;
    background-color: rgb(255, 179, 117, 0.5);
    padding: 40px;
    margin-top: 20px;
    border-radius: 20px;
    border: solid 2px black;
}

.docs-section {
    background-color: rgb(255, 179, 117, 0.25);
    margin: 20px 0;
    padding: 20px;
    border-radius: 20px 0 20px 0;
    border: solid 2px black;
}

.tabs {
    display: flex;
    margin-bottom: 0; /* Connects tabs directly to the content container */
    border-bottom: none; /* Border is now handled by the container */
    background-color: #ffb375;
    border-radius: 8px 8px 0 0;
    border: solid 2px black;
    padding: 3px;
}

.tab {
    padding: 8px 15px;
    cursor: pointer;
    background-color: #ffbf8b;
    border: solid 2px transparent;
    border-radius: 6px;
    margin: 0 2px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
}

.tab.active {
    background-color: #ffffff;
    border: solid 2px black;
}

/* NEW: Container to provide a stable border for all content */
.tab-content-container {
    border-top: none;
    margin-top: -8px;
    border-radius: 0 0 12px 12px;
    overflow: hidden; /* Ensures child elements respect the rounded corners */
    flex-grow: 1;
}

.tab-content {
    display: none;
    /* Removed individual borders and padding for a cleaner structure */
}

.tab-content.active {
    display: block;
}

.code-block {
    position: relative;
    overflow-x: auto;
    height: 100%;
    /* Let the Prism.js theme handle the background color and text color */
}

/* Prism.js overrides - ensure our button is visible on its dark background */
.code-block .copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    background-color: #ffb375;
    color: black;
    border: solid 2px black;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1; /* Ensure button is on top of code */
}

.code-block .copy-button:hover {
    background-color: rgb(255, 179, 117, 0.5);
    transform: translateY(-2px);
}

.endpoint-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    align-items: start;
    margin-bottom: 20px;
}

.grid-label {
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    padding-top: 5px;
}

.grid-content p {
    margin: 0;
}

.endpoint-url {
    font-family: monospace;
    background-color: #eae0d5;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid #000000;
    display: inline-block;
    font-size: 14px;
}

.api-parameter {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px;
    background-color: #f0e6dc;
    border-left: 4px solid #ffb375;
}

.parameter-name {
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}

h2 {
    margin: 0 0 15px 0;
}

.response-example {
    margin: 0;
    padding: 15px;
    background-color: #f0e6dc;
    border-radius: 12px;
    border: 2px solid #d4c0a1;
    overflow: auto;
    flex-grow: 1;
    max-height: 250px;
}

pre {
    margin: 0;
    white-space: pre;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.3;
    height: 100%;
}

code {
    font-family: monospace;
    padding: 1px 5px;
    border-radius: 3px;
}

.interactive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    width: 100%; /* Ensure full width */
}

.grid-item {
    display: flex; /* children will fill height */
    width: 100%; /* Ensure full width of grid cell */
    min-width: 0; /* Allow flexing below content size */
}

.interactive-container {
    padding: 20px;
    border-radius: 12px;
    border: solid 2px black;
    background-color: rgb(255 179 17 / 15%); /* Lighter than section */
    width: 100%; /* Take up full width of parent */
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /* Include padding in width calculation */
    min-width: 0; /* Allow flexing below content size */
    max-width: 100%; /* Prevent overflow */
}

.interactive-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Make code examples and other areas expand */
.code-examples-area, .live-request-area, .live-response-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0; /* Prevent flexbox overflow issues with scrolling blocks */
}

.live-response-area h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.api-parameter-input {
    width: 100px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #000;
    margin-left: 10px;
}

.api-parameter-input[type="text"] {
    width: auto;
    min-width: 200px;
    flex: 1;
}


.cta-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 20px 0 0 0;
    background-color: #ffb375;
    color: black;
    border: 2px solid black;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: rgb(255, 179, 117, 0.8);
    transform: translateY(-2px);
}

.cta-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.parameter-meta {
    font-size: 12px;
    color: #555;
    margin-left: 5px;
}

@media (max-width: 768px) {
    body {
        margin-left: 5%;
        margin-right: 5%;
    }
    
    h1 {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .subline {
        font-size: 16px;
        margin-top: 5px;
    }

    .interactive-grid {
        grid-template-columns: 1fr;
        gap: 15px; /* Slightly reduce gap on mobile */
    }

    .grid-item {
        width: 100%; /* Ensure full width on mobile */
    }

    .interactive-container {
        width: 100%;
        padding: 15px; /* Slightly reduce padding on mobile */
    }

    .endpoint-grid {
        grid-template-columns: 1fr;
    }

    .endpoint-url {
        display: block;
        word-break: break-all;
    }

    .api-parameter {
        flex-wrap: wrap;
    }
    
    /* Ensure all nested elements also respect mobile width constraints */
    .code-block {
        overflow-x: auto;
    }
    
    .response-example {
        max-width: 100%;
        overflow-x: auto;
    }
}