/* UniMsg Developer Documentation - Styles */

/* Base font family */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 280px;
    overflow-y: auto;
    padding: 1.5rem;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
}

.dark .sidebar {
    border-color: #374151;
    background: #111827;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: 0.5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .sidebar-link {
    color: #9ca3af;
}

.dark .sidebar-link:hover {
    background: #374151;
    color: #f9fafb;
}

.sidebar-link.active {
    background: #3b82f6;
    color: white;
}

.sidebar-section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

/* Main content */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    max-width: none;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 40;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* Content area */
.content {
    max-width: 900px;
    margin: 0 auto;
}

.content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111827;
}

.dark .content h1 {
    color: #f9fafb;
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.dark .content h2 {
    color: #f9fafb;
    border-color: #374151;
}

.content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.dark .content h3 {
    color: #f9fafb;
}

.content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.dark .content h4 {
    color: #d1d5db;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #4b5563;
}

.dark .content p {
    color: #d1d5db;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
    color: #4b5563;
}

.dark .content li {
    color: #d1d5db;
}

.content a {
    color: #3b82f6;
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

/* Code blocks with syntax highlighting theme */
.content pre {
    background: #0f172a;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #1e293b;
}

.content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.content pre code {
    color: #e2e8f0;
}

.content p code,
.content li code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.dark .content p code,
.dark .content li code {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

/* Code block header */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #1e293b;
    border-radius: 0.75rem 0.75rem 0 0;
    border: 1px solid #334155;
    border-bottom: none;
    margin-bottom: -1px;
}

.code-header + pre {
    border-radius: 0 0 0.75rem 0.75rem;
    margin-top: 0;
}

.code-lang {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Syntax highlighting colors */
.token-keyword { color: #c792ea; }
.token-string { color: #c3e88d; }
.token-number { color: #f78c6c; }
.token-comment { color: #637777; font-style: italic; }
.token-function { color: #82aaff; }
.token-property { color: #f07178; }
.token-operator { color: #89ddff; }

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.content th,
.content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.dark .content th,
.dark .content td {
    border-color: #374151;
}

.content th {
    background: #f8fafc;
    font-weight: 600;
    color: #111827;
}

.dark .content th {
    background: #1f2937;
    color: #f9fafb;
}

.content td {
    color: #4b5563;
}

.dark .content td {
    color: #d1d5db;
}

/* HTTP method badges */
.method-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    font-family: monospace;
}

.method-get {
    background: #dcfce7;
    color: #166534;
}

.method-post {
    background: #dbeafe;
    color: #1e40af;
}

.method-put {
    background: #fef3c7;
    color: #92400e;
}

.method-delete {
    background: #fee2e2;
    color: #991b1b;
}

.dark .method-get {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.dark .method-post {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.dark .method-put {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.dark .method-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Endpoint block */
.endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: monospace;
}

.dark .endpoint {
    background: #1e293b;
    border-color: #334155;
}

.endpoint-path {
    color: #0f172a;
    font-weight: 500;
}

.dark .endpoint-path {
    color: #f8fafc;
}

/* Alerts/Notes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.dark .alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

.alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.dark .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.dark .alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
}

.alert-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.dark .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.dark .breadcrumb {
    color: #9ca3af;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.dark .breadcrumb a {
    color: #9ca3af;
}

.breadcrumb a:hover {
    color: #3b82f6;
}

.breadcrumb svg {
    width: 1rem;
    height: 1rem;
}

/* Search box */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s ease;
}

.dark .search-box input {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 50;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
}

@media (max-width: 1024px) {
    .sidebar-overlay.open {
        display: block;
    }
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.dark .nav-buttons {
    border-color: #374151;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.dark .nav-btn {
    border-color: #374151;
    color: #d1d5db;
}

.nav-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Code tabs */
.code-tabs {
    display: flex;
    gap: 0;
    background: #1e293b;
    border-radius: 0.75rem 0.75rem 0 0;
    border: 1px solid #334155;
    border-bottom: none;
    overflow: hidden;
}

.code-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-tab:hover {
    background: #334155;
    color: #f8fafc;
}

.code-tab.active {
    background: #0f172a;
    color: #f8fafc;
}

.code-tabs + pre {
    border-radius: 0 0 0.75rem 0.75rem;
    margin-top: 0;
}

/* Parameter table styling */
.param-required {
    color: #ef4444;
    font-weight: 600;
}

.param-optional {
    color: #6b7280;
}

/* Response status indicator */
.status-success {
    color: #22c55e;
}

.status-error {
    color: #ef4444;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .nav-buttons,
    nav {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    pre {
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}
