/* RebusAI API Documentation Styles */
/* Following Write the Docs style guide principles */

/* Color Variables */
:root {
    --primary-color: #2E86AB;
    --secondary-color: #A23B72;
    --success-color: #16A085;
    --warning-color: #F39C12;
    --error-color: #E74C3C;
    --info-color: #3498DB;
    
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-muted: #95A5A6;
    
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-sidebar: #FAFBFC;
    --bg-code: #F4F4F4;
    --bg-highlight: #FFF3CD;
    
    --border-color: #E1E5E9;
    --border-radius: 6px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Main Container */
.api-docs-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: calc(100vh - 200px);
}

/* Sidebar Styles */
.api-docs-sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.sidebar-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.875rem;
    margin: 0;
}

.sidebar-search {
    margin-bottom: 1.5rem;
}

.sidebar-search .form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.sidebar-search .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 134, 171, 0.25);
}

/* Sidebar Navigation */
.sidebar-nav .nav-item {
    margin-bottom: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(46, 134, 171, 0.1);
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-nav .nav-link.active .nav-icon {
    color: white;
}

.sidebar-nav .nav-icon {
    margin-right: 0.75rem;
    width: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sidebar-nav .nav-description {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 2.5rem;
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer h6 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.quick-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.quick-link i {
    margin-right: 0.5rem;
    width: 12px;
}

/* Main Content */
.api-docs-content {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: 600px;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

/* Content Header */
.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.content-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.content-subtitle {
    font-size: 1.125rem;
    margin: 0;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.section-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.section-content p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-content ul, 
.section-content ol {
    margin-bottom: 1rem;
}

.section-content li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Code Blocks */
.code-block {
    position: relative;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-block pre {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0;
}

.code-block pre code {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    border: none;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--secondary-color);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Inline Code */
code {
    background: var(--bg-highlight);
    color: var(--text-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
}

/* HTTP Method Styling */
.endpoint-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.http-method {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.http-method.get {
    background: var(--success-color);
    color: white;
}

.http-method.post {
    background: var(--info-color);
    color: white;
}

.http-method.put {
    background: var(--warning-color);
    color: white;
}

.http-method.delete {
    background: var(--error-color);
    color: white;
}

.endpoint-path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Parameter Tables */
.parameter-table {
    margin: 1rem 0;
}

.parameter-table .table {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.parameter-table .table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem;
}

.parameter-table .table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.parameter-table .table td code {
    background: var(--bg-highlight);
    color: var(--primary-color);
}

.parameter-table .table tr:last-child td {
    border-bottom: none;
}

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

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-item h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

/* Implementation Timeline */
.implementation-timeline {
    margin: 2rem 0;
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 3rem;
    bottom: -3rem;
    width: 2px;
    background: var(--border-color);
}

.timeline-number {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-right: 2rem;
    z-index: 1;
    position: relative;
}

.timeline-content {
    flex: 1;
    padding-top: 0.5rem;
}

.timeline-content h5 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.timeline-content p {
    margin-bottom: 1rem;
}

.timeline-content .code-example {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border-left: 4px solid var(--info-color);
}

/* Tool Grid for API Testing Tools */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tool-card.featured {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(46, 134, 171, 0.2);
}

.tool-header {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.tool-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.tool-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.tool-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.tool-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.tool-content {
    padding: 1.5rem;
}

.tool-content p {
    margin-bottom: 1rem;
    font-weight: 500;
}

.tool-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
}

.tool-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.tool-example {
    background: var(--bg-highlight);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    border-left: 4px solid var(--warning-color);
}

.tool-example strong {
    color: var(--text-primary);
}

.tool-example ol {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

/* Best Practices Section */
.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.practice-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--success-color);
}

.practice-item h6 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.practice-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Example Sections */
.example-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
}

.example-section h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.example-tabs {
    margin: 1.5rem 0;
}

.expected-response {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.expected-response strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Pro Tips */
.pro-tip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
}

.pro-tip h6 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.pro-tip ul {
    margin: 0;
    padding-left: 1.25rem;
}

.pro-tip li {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.pro-tip strong {
    color: white;
}

/* Benefit Cards */
.benefit-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.benefit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.benefit-card h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.benefit-card p {
    margin: 0;
    color: var(--text-secondary);
}

/* Use Case List */
.use-case-list {
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.use-case-list li {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--info-color);
    transition: var(--transition);
}

.use-case-list li:hover {
    background: var(--bg-highlight);
    border-left-color: var(--primary-color);
}

.use-case-list strong {
    color: var(--primary-color);
}

/* Content Footer Navigation */
.content-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.content-footer .btn {
    transition: var(--transition);
}

.content-footer .btn:hover {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .api-docs-sidebar {
        position: static;
        margin-bottom: 1rem;
        max-height: none;
    }
    
    .content-header .content-title {
        font-size: 1.75rem;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .endpoint-header .http-method {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        flex-direction: column;
        margin-bottom: 2rem;
    }
    
    .timeline-item::after {
        display: none;
    }
    
    .timeline-number {
        margin-right: 0;
        margin-bottom: 1rem;
        align-self: flex-start;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .best-practices {
        grid-template-columns: 1fr;
    }
    
    .example-section {
        padding: 1rem;
    }
    
    .pro-tip {
        padding: 1.5rem;
    }
}

/* FontAwesome Icon Enhancements */
.fas, .fa, [class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    display: inline-block !important;
    text-rendering: auto !important;
}

.fas::before, .fa::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.nav-icon {
    display: inline-block;
    width: 18px !important;
    text-align: center;
    font-size: 16px !important;
}

.feature-icon {
    display: block !important;
    font-size: 2.5rem !important;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-icon {
    font-size: 1.5rem !important;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Search Highlighting */
.search-highlight {
    background: var(--bg-highlight);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}