/* public/css/docs.css */

:root {
    --primary-color: #2563eb;
    --sidebar-width: 280px;
    --sidebar-bg: #ffffff;
    --content-bg: #f8f9fa;
    --border-color: #e1e4e8;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --hover-bg: #f3f4f6;
    --active-bg: #eff6ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
}

/* Docs Container */
.docs-container {
    display: flex;
    min-height: 100vh;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:hover {
    background: #1d4ed8;
}

/* Overlay untuk mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Sidebar Styles */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Close button untuk mobile */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.sidebar-close:hover {
    color: var(--text-primary);
}

/* Navigation */
.sidebar-nav {
    padding: 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.9375rem;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--active-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.nav-link i {
    font-size: 1rem;
}

/* Main Content */
.docs-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* Content Section */
.content-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-section h1 {
    font-size: 2.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.content-section .badge-hit {
    display: inline-flex;
    align-items: center;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #a5d6a7;
}

.content-section h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section .lead {
    font-size: 1.125rem;
    line-height: 1.7;
}

.content-section ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section ul li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Alert Boxes */
.alert-custom {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info-custom {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-warning-custom {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-success-custom {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

/* Endpoint Box */
.endpoint-box {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    display: inline-block;
}

.method-post {
    background: #dcfce7;
    color: #166534;
}

.method-get {
    background: #dbeafe;
    color: #1e40af;
}

.method-put {
    background: #fef3c7;
    color: #92400e;
}

.method-delete {
    background: #fee2e2;
    color: #991b1b;
}

.endpoint-url {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-all;
}

/* Code Block */
.code-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-block {
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0.5rem 0 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-block pre {
    margin: 0;
    color: inherit;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.param-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
    min-width: 600px;
}

.param-table th {
    background: #f3f4f6;
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    white-space: nowrap;
}

.param-table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: top;
}

.param-table tbody tr:hover {
    background: #f9fafb;
}

.param-name {
    font-family: 'Courier New', monospace;
    color: #dc2626;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.param-type {
    font-family: 'Courier New', monospace;
    color: #059669;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Badge Styles */
.badge-required {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-optional {
    background: #e5e7eb;
    color: #6b7280;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Card untuk fitur-fitur */
.feature-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.feature-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.9375rem;
}

/* Button Custom */
.btn-docs {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-docs-primary {
    background: var(--primary-color);
    color: white;
}

.btn-docs-primary:hover {
    background: #1d4ed8;
    color: white;
}

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Tablet */
@media (max-width: 992px) {
    .docs-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    .content-section {
        padding: 2rem;
    }

    .content-section h1 {
        font-size: 2rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide sidebar by default, show when active */
    .docs-sidebar {
        transform: translateX(-100%);
    }
    
    .docs-sidebar.show {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    /* Show close button on mobile */
    .sidebar-close {
        display: block;
    }

    /* Adjust content padding for mobile button */
    .docs-content {
        padding: 5rem 1rem 2rem;
    }
    
    .content-section {
        padding: 1.5rem;
        border-radius: 6px;
    }
    
    .content-section h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .content-section h2 {
        font-size: 1.375rem;
    }

    .content-section h3 {
        font-size: 1.125rem;
    }

    .content-section .lead {
        font-size: 1rem;
    }
    
    /* Endpoint header stack on mobile */
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .endpoint-url {
        font-size: 0.875rem;
    }

    /* Alert boxes */
    .alert-custom {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    /* Code blocks */
    .code-block {
        padding: 1rem;
        font-size: 0.8125rem;
    }

    /* Buttons */
    .btn-docs {
        padding: 0.5rem 1rem;
        font-size: 0.9375rem;
        width: 100%;
        text-align: center;
    }

    .mt-4.d-flex.gap-2 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .docs-content {
        padding: 4.5rem 0.75rem 1.5rem;
    }

    .content-section {
        padding: 1.25rem;
    }

    .content-section h1 {
        font-size: 1.5rem;
    }

    .content-section h2 {
        font-size: 1.25rem;
    }

    .endpoint-box {
        padding: 1rem;
    }

    .code-block {
        padding: 0.875rem;
        font-size: 0.75rem;
    }

    .param-table {
        font-size: 0.875rem;
        min-width: 500px;
    }

    .param-table th,
    .param-table td {
        padding: 0.625rem 0.5rem;
    }
}