/* Exepron API Documentation Portal - CoreUI Themed Styles */

/* ====================================
   1. GLOBAL STYLES & RESET
   ==================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette - Matching Exepron Theme */
    --primary-color: #0038d1;
    --primary-hover: #0018a5;
    --primary-light: #1d5de1;
    --secondary-color: #F4F5F7;
    --success-color: #008F49;
    --danger-color: #D61D00;
    --warning-color: #F6BE1A;
    --info-color: #3399FF;
    --dark-color: #636F83;

    /* Body & Background */
    --body-bg: #ebedef;
    --body-color: #3c4b64;
    --content-bg: #ffffff;

    /* Sidebar */
    --sidebar-bg: #282F52;
    --sidebar-width: 255px;
    --sidebar-collapsed-width: 56px;
    --sidebar-text-color: #ffffff;
    --sidebar-hover-bg: #1d2440;
    --sidebar-active-bg: #0038d1;

    /* Header */
    --header-bg: #ffffff;
    --header-height: 56px;
    --header-border: #d8dbe0;

    /* Footer */
    --footer-bg: #f0f3f5;
    --footer-height: 56px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 0.875rem;
    --line-height-base: 1.5;

    /* Spacing */
    --spacer: 1rem;
    --border-radius: 0.375rem;

    /* Links */
    --link-color: #3399FF;
    --link-hover-color: #1B6EE5;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Dark Mode */
[data-coreui-theme="dark"] {
    --body-bg: #1e1e2d;
    --body-color: #e8e8e8;
    --content-bg: #2c2c3e;
    --sidebar-bg: #1a1a28;
    --sidebar-hover-bg: #0f0f1a;
    --header-bg: #2c2c3e;
    --header-border: #444b54;
    --footer-bg: #2c2c3e;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--body-color);
    background-color: var(--body-bg);
}

/* ====================================
   2. LAYOUT STRUCTURE
   ==================================== */

.docs-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.docs-container {
    display: flex;
    flex: 1;
    position: relative;
}

/* ====================================
   3. HEADER
   ==================================== */

.docs-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.docs-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
}

.docs-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.docs-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--body-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: background-color 0.15s ease-in-out;
}

.sidebar-toggle:hover {
    background-color: var(--secondary-color);
}

.docs-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--body-color);
}

.docs-logo img {
    height: 25px;
}

.docs-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 0.75rem;
    color: var(--body-color);
}

/* Header Navigation Links */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav-link {
    color: var(--body-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease-in-out;
    font-size: 0.9rem;
}

.header-nav-link:hover {
    color: var(--primary-color);
}

.header-nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 2px;
}

/* ====================================
   4. SIDEBAR
   ==================================== */

.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-color);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow-y: auto;
    transition: width 0.15s ease-in-out, margin-left 0.15s ease-in-out;
    flex-shrink: 0;
}

.docs-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.docs-sidebar.mobile-hidden {
    margin-left: calc(-1 * var(--sidebar-width));
}

.docs-sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.docs-nav {
    padding: 1rem 0;
}

.docs-nav-section {
    margin-bottom: 1.5rem;
}

.docs-nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.docs-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav-item {
    margin-bottom: 0.25rem;
}

.docs-nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: var(--sidebar-text-color);
    text-decoration: none;
    transition: background-color 0.15s ease-in-out, padding-left 0.15s ease-in-out;
    border-left: 3px solid transparent;
}

.docs-nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    padding-left: 1.25rem;
}

.docs-nav-link.active {
    background-color: var(--sidebar-active-bg);
    border-left-color: #fff;
    font-weight: 600;
}

.docs-nav-icon {
    font-size: 1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.docs-nav-text {
    flex: 1;
}

/* Sub-navigation styles */
.docs-nav-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 2.5rem;
    margin-top: 0.25rem;
}

.docs-nav-subitem {
    margin-bottom: 0.125rem;
}

.docs-nav-sublink {
    display: block;
    padding: 0.375rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease-in-out, padding-left 0.15s ease-in-out;
    border-left: 2px solid transparent;
}

.docs-nav-sublink:hover {
    color: #fff;
    padding-left: 1rem;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.docs-nav-sublink.active {
    color: #fff;
    border-left-color: #fff;
    font-weight: 500;
}

/* Hide sub-nav in collapsed sidebar */
.docs-sidebar.collapsed .docs-nav-sublist {
    display: none;
}

/* Collapsed Sidebar */
.docs-sidebar.collapsed .docs-nav-text {
    display: none;
}

.docs-sidebar.collapsed .docs-nav-section-title {
    display: none;
}

.docs-sidebar.collapsed .docs-nav-link {
    justify-content: center;
    padding: 0.625rem 0;
}

.docs-sidebar.collapsed .docs-nav-icon {
    margin-right: 0;
}

/* ====================================
   5. MAIN CONTENT AREA
   ==================================== */

.docs-main {
    flex: 1;
    padding: 2rem;
    background-color: var(--content-bg);
    overflow-y: auto;
    max-width: 100%;
}

.docs-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Content Typography */
.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--body-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--body-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.docs-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--body-color);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--body-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--body-color);
}

.docs-content a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.docs-content a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.docs-content code {
    background-color: rgba(0, 56, 209, 0.08);
    color: var(--primary-color);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.875em;
    font-family: 'Monaco', 'Courier New', monospace;
}

.docs-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.docs-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* ====================================
   6. CARDS & SECTIONS
   ==================================== */

.docs-card {
    background-color: var(--content-bg);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.docs-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--body-color);
}

.docs-card-body {
    color: var(--body-color);
}

/* Info/Warning/Error Boxes */
.docs-alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    border-radius: var(--border-radius);
}

.docs-alert-info {
    background-color: rgba(51, 153, 255, 0.1);
    border-left-color: var(--info-color);
    color: var(--body-color);
}

.docs-alert-warning {
    background-color: rgba(246, 190, 26, 0.1);
    border-left-color: var(--warning-color);
    color: var(--body-color);
}

.docs-alert-success {
    background-color: rgba(0, 143, 73, 0.1);
    border-left-color: var(--success-color);
    color: var(--body-color);
}

.docs-alert-danger {
    background-color: rgba(214, 29, 0, 0.1);
    border-left-color: var(--danger-color);
    color: var(--body-color);
}

/* ====================================
   7. TABLES
   ==================================== */

.docs-table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    background-color: var(--content-bg);
}

.docs-table th {
    background-color: #B4D2FB;
    color: #151932;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid #d8dbe0;
}

.docs-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #d8dbe0;
    vertical-align: top;
}

.docs-table tbody tr:nth-child(even) {
    background-color: var(--secondary-color);
}

.docs-table code {
    background-color: rgba(0, 56, 209, 0.08);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* ====================================
   8. BUTTONS
   ==================================== */

.docs-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.docs-btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.docs-btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    text-decoration: none;
}

.docs-btn-secondary {
    color: var(--body-color);
    background-color: var(--secondary-color);
    border-color: #69768F;
}

.docs-btn-secondary:hover {
    background-color: #D6DBE2;
}

.docs-btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}

.docs-btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
}

/* ====================================
   8.5. HERO SECTION
   ==================================== */

.docs-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.docs-hero h1 {
    margin: 0 0 16px 0;
    font-size: 42px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.docs-hero h1 i {
    margin-right: 12px;
}

.docs-hero p,
.docs-hero .docs-lead {
    font-size: 18px;
    opacity: 0.95;
    margin: 0;
    max-width: 800px;
    line-height: 1.6;
    color: white;
}

.docs-hero .docs-btn {
    margin-top: 24px;
}

.docs-hero .docs-btn-primary {
    background: white;
    color: #667eea;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.docs-hero .docs-btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ====================================
   9. FOOTER
   ==================================== */

.docs-footer {
    height: var(--footer-height);
    background-color: var(--footer-bg);
    border-top: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.875rem;
    color: var(--body-color);
    position: sticky;
    bottom: 0;
    margin-top: auto;
    z-index: 100;
}

.docs-footer-left {
    display: flex;
    align-items: center;
}

.docs-footer-right {
    display: flex;
    align-items: center;
}

.docs-footer a {
    color: var(--link-color);
    text-decoration: none;
    margin-left: 0.25rem;
}

.docs-footer a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* ====================================
   10. SEARCH
   ==================================== */

.docs-search-container {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    z-index: 200;
}

.docs-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.docs-search-icon {
    position: absolute;
    left: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    pointer-events: none;
}

.docs-search-input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 2.25rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    color: var(--sidebar-text-color);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.docs-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.docs-search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 56, 209, 0.1);
}

.docs-search-clear {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.docs-search-clear:hover {
    color: var(--sidebar-text-color);
}

.docs-search-results {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.5rem);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.docs-search-results-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

.docs-search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.docs-search-result-item:last-child {
    border-bottom: none;
}

.docs-search-result-item:hover {
    background-color: #f9fafb;
}

.docs-search-result-category {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.docs-search-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.docs-search-result-description {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.docs-search-result-title mark,
.docs-search-result-description mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.1875rem;
    font-weight: 600;
}

.docs-search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7280;
}

.docs-search-no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.docs-search-no-results p {
    font-size: 0.875rem;
}

.docs-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* Collapsed sidebar search - Hide completely */
.docs-sidebar.collapsed .docs-search-container {
    display: none;
}

/* ====================================
   11. BREADCRUMBS
   ==================================== */

.docs-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    list-style: none;
    background-color: transparent;
}

.docs-breadcrumb-item {
    display: flex;
    align-items: center;
}

.docs-breadcrumb-item + .docs-breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
    color: #6c757d;
}

.docs-breadcrumb-item a {
    color: var(--link-color);
    text-decoration: none;
}

.docs-breadcrumb-item a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.docs-breadcrumb-item.active {
    color: #6c757d;
}

/* ====================================
   11. RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 992px) {
    .docs-sidebar {
        position: fixed;
        z-index: 1030;
        height: calc(100vh - var(--header-height));
    }

    .docs-sidebar.mobile-hidden {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .docs-main {
        width: 100%;
    }

    .header-nav {
        display: none;
    }

    .docs-content h1 {
        font-size: 2rem;
    }

    .docs-content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .docs-main {
        padding: 1rem;
    }

    .docs-content {
        padding: 0;
    }

    .docs-title {
        display: none;
    }

    .docs-table {
        font-size: 0.8rem;
    }

    .docs-table th,
    .docs-table td {
        padding: 0.5rem;
    }
}

/* ====================================
   12. SCROLLBAR STYLING
   ==================================== */

.docs-sidebar::-webkit-scrollbar,
.docs-main::-webkit-scrollbar {
    width: 8px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.docs-main::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.docs-main::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.docs-main::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ====================================
   13. UTILITY CLASSES
   ==================================== */

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
