/* FacturX Documentation Renderer - Main Stylesheet */

/* ===========================
   CSS Variables
   =========================== */
:root {
    /* Sidebar dimensions */
    --sidebar-width: 350px;
    --sidebar-min-width: 200px;
    --sidebar-max-width: 500px;
    
    /* Bootstrap color palette */
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-black: #000;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
    --bs-gray-900: #212529;
    
    /* Context colors */
    --bs-primary: var(--bs-blue);
    --bs-secondary: var(--bs-gray-600);
    --bs-success: var(--bs-green);
    --bs-info: var(--bs-cyan);
    --bs-warning: var(--bs-yellow);
    --bs-danger: var(--bs-red);
    --bs-light: var(--bs-gray-100);
    --bs-dark: var(--bs-gray-900);
    
    /* Body colors */
    --bs-body-color: #212529;
    --bs-body-bg: #fff;
    
    /* Subtle colors */
    --bs-primary-bg-subtle: #cfe2ff;
    --bs-secondary-bg-subtle: #e2e3e5;
    --bs-success-bg-subtle: #d1e7dd;
    --bs-info-bg-subtle: #cff4fc;
    --bs-warning-bg-subtle: #fff3cd;
    --bs-danger-bg-subtle: #f8d7da;
    --bs-light-bg-subtle: #fcfcfd;
    --bs-dark-bg-subtle: #ced4da;
    --bs-primary-text-emphasis: #052c65;
    --bs-secondary-text-emphasis: #2b2f32;
    --bs-success-text-emphasis: #0a3622;
    --bs-info-text-emphasis: #055160;
    --bs-warning-text-emphasis: #664d03;
    --bs-danger-text-emphasis: #58151c;
    --bs-light-text-emphasis: #495057;
    --bs-dark-text-emphasis: #161719;
    --bs-primary-border-subtle: #9ec5fe;
    --bs-secondary-border-subtle: #c4c8cb;
    --bs-success-border-subtle: #a3cfbb;
    --bs-info-border-subtle: #9eeaf9;
    --bs-warning-border-subtle: #ffe69c;
    --bs-danger-border-subtle: #f1aeb5;
    --bs-light-border-subtle: #e9ecef;
    --bs-dark-border-subtle: #adb5bd;
}

/* ===========================
   Base Styles
   =========================== */
html {
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(75% 75% at 25% 25%, rgba(13,110,253,.08), transparent), 
                linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* ===========================
   Treeview Sidebar Styles
   =========================== */
#sidebar {
    width: var(--sidebar-width);
    position: relative;
    transition: width 0.1s ease-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

#resizer {
    width: 8px;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    cursor: ew-resize;
    z-index: 10;
    background-color: transparent;
}

#content-area {
    padding: 2.5rem;
}

/* ===========================
   Tree View Navigation Styles
   =========================== */
.tree-view a {
    position: relative;
    z-index: 0;
    display: block;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bs-body-color);
    padding: var(--bs-spacer-y, 0.25rem) 4px;
    transition: color 0.2s;
}

.tree-view a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    z-index: -1;
    border-radius: inherit;
}

.tree-view a:hover {
    color: var(--bs-primary);
}

.tree-view a.active {
    color: white !important;
    font-weight: 600;
}

.tree-view a.active::before {
    width: 100%;
    background-color: rgb(11, 94, 215);
}

.toggle-icon {
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
    padding: var(--bs-spacer-y, 0.25rem) var(--bs-spacer-x, 0.5rem);
    line-height: 1;
    flex-shrink: 0;
}

.toggle-icon.rotated {
    transform: rotate(90deg);
}

.fs-7 {
    font-size: 0.9rem;
}

/* ===========================
   Detail View Child Elements
   =========================== */
#detail-children li {
    padding-top: 0 !important;
}

dt.detail-child-elements-label {
    padding-top: 16px;
}

/* ===========================
   BT List Styles
   =========================== */
.bt-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.bt-list-container .card {
    background-color: #fff;
    border: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.bt-list-container .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1.5rem;
}

.bt-stats {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.bt-list {
    margin-bottom: 0;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
}

/* Custom scrollbar styling */
.bt-list::-webkit-scrollbar {
    width: 8px;
}

.bt-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bt-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.bt-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.bt-list li {
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bt-list li:last-child {
    border-bottom: none;
}

.bt-list li:hover {
    background-color: #f8f9fa;
    padding-left: 24px;
}

.bt-number {
    font-weight: bold;
    color: #0066cc;
    min-width: 100px;
    display: inline-block;
    font-size: 1.1rem;
}

.element-name {
    color: #333;
    font-weight: 500;
    font-size: 1rem;
}

.business-term {
    color: #666;
    font-style: italic;
    margin-left: 10px;
    display: inline-block;
}

.description {
    color: #555;
    margin-top: 8px;
    margin-left: 100px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    flex-shrink: 0;
}

.back-link:hover {
    text-decoration: underline;
}

