/* API Documentation Styles */

/* Code Block Styling */
.code-block {
    background: #0d1117;
    border-radius: 0.75rem;
    padding: 1.25rem;
    font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block code {
    color: #c9d1d9;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #7dcfff;
}

.json-string {
    color: #9ece6a;
}

.json-number {
    color: #ff9e64;
}

.json-boolean {
    color: #f7768e;
}

.json-null {
    color: #bb9af7;
}

/* Code Example Tabs */
.code-example {
    background: #161b22;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 1rem;
}

.code-example .code-block {
    border-radius: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Copy Button */
.copy-btn {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.code-block:hover .copy-btn,
.code-example:hover .copy-btn {
    opacity: 1;
}

.copy-btn.copied {
    background-color: #22c55e !important;
    color: white !important;
}

/* Endpoint Block */
.endpoint-block {
    transition: border-color 0.2s ease-in-out;
}

.endpoint-block:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

/* Sidebar Styling */
aside {
    will-change: transform;
}

/* Force sidebar visible on desktop */
@media (min-width: 768px) {
    aside.-translate-x-full {
        transform: translateX(0) !important;
    }
}

.sidebar-link {
    transition: all 0.15s ease-in-out;
}

.sidebar-link:hover {
    transform: translateX(4px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Thin Scrollbar for Sidebar */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 5px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(99, 102, 241, 0.5);
}

/* Sidebar Category Styling */
.sidebar-category {
    margin-bottom: 0.5rem;
}

.sidebar-category button {
    padding: 0.25rem 0;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Section Scroll Margin */
section[id] {
    scroll-margin-top: 7rem;
}

/* Language Syntax Colors for Shell/Bash */
.language-bash .token.comment {
    color: #6a737d;
}

.language-bash .token.string {
    color: #9ece6a;
}

.language-bash .token.variable {
    color: #79c0ff;
}

/* JavaScript Syntax */
.language-javascript .token.keyword {
    color: #ff7b72;
}

.language-javascript .token.string {
    color: #a5d6ff;
}

.language-javascript .token.function {
    color: #d2a8ff;
}

.language-javascript .token.number {
    color: #79c0ff;
}

.language-javascript .token.operator {
    color: #ff7b72;
}

.language-javascript .token.punctuation {
    color: #c9d1d9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .code-block {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .endpoint-block {
        padding: 1rem;
    }

    section[id] {
        scroll-margin-top: 5rem;
    }

    /* Sidebar responsive */
    .sidebar-category button span:first-child {
        font-size: 0.65rem;
    }

    .sidebar-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    /* Main content mobile */
    main {
        padding-top: 4.5rem;
    }

    main > div {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Plan Badge Animations */
.plan-badge {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Loading state for copy button */
.copy-btn.loading {
    pointer-events: none;
    opacity: 0.5;
}

/* Active section indicator */
.sidebar-link.active {
    position: relative;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #6366f1, #8b5cf6);
    border-radius: 0 3px 3px 0;
}

/* Method badges */
.method-get { background-color: #22c55e; }
.method-post { background-color: #3b82f6; }
.method-put { background-color: #eab308; color: #1f2937; }
.method-patch { background-color: #f97316; }
.method-delete { background-color: #ef4444; }

/* Card hover effects */
.bg-gray-800 {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.bg-gray-800:hover {
    transform: translateY(-1px);
}

/* Grid Improvements */
.grid > div {
    transition: transform 0.2s ease-in-out;
}

.grid > div:hover {
    transform: translateY(-2px);
}

/* Search Input Focus */
input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Code Line Highlighting */
.code-block .highlight-line {
    background: rgba(99, 102, 241, 0.1);
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
    display: block;
}

/* Horizontal Rule Styling */
hr {
    border-color: #374151;
    opacity: 0.5;
}

/* Table Styling for Future Use */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #374151;
}

table th {
    background: #1f2937;
    font-weight: 600;
    color: #f3f4f6;
}

table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

/* Tooltip Styling */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: #f3f4f6;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Print Styles */
@media print {
    .sidebar,
    nav,
    .copy-btn,
    footer {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }

    .code-block {
        background: #f3f4f6 !important;
        color: #1f2937 !important;
        border: 1px solid #d1d5db;
    }

    a {
        text-decoration: underline;
    }
}
