/* Custom styles for Sherpai Partner API Documentation */

/* Make all headings white and bold for better visibility */
.md-content h1,
.md-typeset h1 {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.md-content h2,
.md-typeset h2 {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.md-content h3,
.md-typeset h3 {
    color: #e4e4e7 !important;
    font-weight: 600 !important;
}

.md-content h4,
.md-typeset h4,
.md-content h5,
.md-typeset h5,
.md-content h6,
.md-typeset h6 {
    color: #d4d4d8 !important;
    font-weight: 500 !important;
}

/* Custom navbar color - dark blue to match Sherpai branding */
.md-header {
    background-color: #1a73e8 !important;
}

/* Ensure logo image is properly sized */
.md-header__button.md-logo img,
.md-logo img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Make logo clickable and styled */
.md-header__button.md-logo,
.md-logo {
    cursor: pointer;
}

.md-header__button.md-logo:hover,
.md-logo:hover {
    opacity: 0.9;
}

/* Adjust header title color for visibility on blue background */
.md-header__title {
    color: #ffffff !important;
}

/* Ensure all header links are visible */
.md-header__button {
    color: #ffffff !important;
}

.md-tabs {
    background-color: #1967d2 !important;
}

.md-tabs__link {
    color: rgba(255, 255, 255, 0.7) !important;
}

.md-tabs__link--active,
.md-tabs__link:hover {
    color: #ffffff !important;
}

/* API test cards styling */
.api-test-card {
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.api-test-card h4 {
    margin-top: 0;
    color: var(--md-primary-fg-color);
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    padding-bottom: 0.5rem;
}

/* Grid cards enhancement */
.grid.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.grid.cards > * {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.2s ease;
}

.grid.cards > *:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Code block enhancements */
.highlight {
    position: relative;
}

.highlight:hover .copy-button {
    opacity: 1;
}

/* Status indicators */
.status-success {
    color: #4caf50;
    font-weight: 500;
}

.status-error {
    color: #f44336;
    font-weight: 500;
}

.status-warning {
    color: #ff9800;
    font-weight: 500;
}

/* Response examples */
.response-example {
    background: var(--md-code-bg-color);
    border-left: 4px solid var(--md-primary-fg-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

/* Endpoint method badges */
.method-get {
    background: #4caf50;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.method-post {
    background: #2196f3;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.method-put {
    background: #ff9800;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.method-delete {
    background: #f44336;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Interactive elements */
.demo-button {
    background: var(--md-primary-fg-color);
    color: var(--md-primary-bg-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.demo-button:hover {
    background: var(--md-accent-fg-color);
}

/* Responsive tables */
.md-typeset table:not([class]) {
    font-size: 0.85rem;
}

/* Compact parameter tables with smaller font and better column widths */
.md-typeset table.param-table {
    font-size: 0.75rem;
    width: 100%;
    table-layout: fixed;
}

.md-typeset table.param-table th,
.md-typeset table.param-table td {
    padding: 0.4rem 0.5rem;
    word-wrap: break-word;
}

.md-typeset table.param-table th:nth-child(1),
.md-typeset table.param-table td:nth-child(1) {
    width: 10%;
}

.md-typeset table.param-table th:nth-child(2),
.md-typeset table.param-table td:nth-child(2) {
    width: 6%;
}

.md-typeset table.param-table th:nth-child(3),
.md-typeset table.param-table td:nth-child(3) {
    width: 8%;
}

.md-typeset table.param-table th:nth-child(4),
.md-typeset table.param-table td:nth-child(4) {
    width: 12%;
}

.md-typeset table.param-table th:nth-child(5),
.md-typeset table.param-table td:nth-child(5) {
    width: 20%;
}

.md-typeset table.param-table th:nth-child(6),
.md-typeset table.param-table td:nth-child(6) {
    width: 44%;
}

@media screen and (max-width: 768px) {
    .md-typeset table:not([class]) {
        font-size: 0.75rem;
    }

    .md-typeset table.param-table {
        font-size: 0.7rem;
    }

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

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .api-test-card {
    background: var(--md-default-bg-color);
    border-color: var(--md-default-fg-color--lightest);
}

/* Hide dark mode toggle icon - comprehensive selectors */
.md-header__button[for="__palette"],
.md-header__button[data-md-component="palette"],
button[data-md-component="palette"],
label[for="__palette"],
.md-header label[for="__palette"],
.md-header__button.md-header__button--palette,
.md-header input[type="checkbox"][id="__palette"],
.md-header input[type="checkbox"][id="__palette"] + label {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Custom admonition for API responses */
.md-typeset .admonition.api-response {
    border-left-color: #00bcd4;
}

.md-typeset .admonition.api-response > .admonition-title {
    background-color: rgba(0, 188, 212, 0.1);
}

.md-typeset .admonition.api-response > .admonition-title::before {
    background-color: #00bcd4;
    -webkit-mask-image: var(--md-admonition-icon--api-response);
    mask-image: var(--md-admonition-icon--api-response);
}

/* Highlight important links */
a[href*="/docs"]:after {
    content: " 🔗";
    font-size: 0.8em;
}

/* Loading states for demo elements */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: " ⏳";
}

/* Success/error indicators */
.result-success {
    border-left: 4px solid #4caf50;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.result-error {
    border-left: 4px solid #f44336;
    background: rgba(244, 67, 54, 0.1);
    padding: 0.5rem;
    margin: 0.5rem 0;
}

/* Copy to clipboard button styling */
.copy-to-clipboard {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--md-default-fg-color--lighter);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-to-clipboard:hover {
    background: var(--md-default-fg-color);
    color: var(--md-default-bg-color);
}

/* Hide feedback sections on all pages */
.md-typeset .admonition.question[title*="Was this page helpful"],
.md-typeset .admonition.question[title*="helpful"],
.md-typeset h2[id*="feedback"] + .admonition,
.md-typeset h2[id*="Feedback"] + .admonition,
.md-typeset h2[id*="feedback"] + * + .admonition,
.md-typeset h2[id*="Feedback"] + * + .admonition {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Hide feedback section headings */
.md-typeset h2[id*="feedback"],
.md-typeset h2[id*="Feedback"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Footer LinkedIn icon styling */
.md-footer__link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 0.5rem;
    transition: opacity 0.2s ease;
}

.md-footer__link:hover svg {
    opacity: 0.8;
}

.md-footer__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.md-footer__link:hover {
    opacity: 0.8;
}
