/* Energy Logserver SIEM Documentation - Custom Styles */
/* Naprawy problemów zgłoszonych przez kolegę */

/* 1. TABLE FIXES - Problem z "rozjechaniem" tabel */
.wy-table-responsive table {
    margin-bottom: 24px;
    max-width: 100%;
    background: transparent;
    border-collapse: collapse;
    table-layout: auto;
    word-wrap: break-word;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: normal !important;
    word-wrap: break-word;
    word-break: break-word;
    vertical-align: top;
    padding: 8px 12px;
    border: 1px solid #e1e4e5;
    max-width: 300px;
    /* Prevent extremely wide columns */
}

.wy-table-responsive table th {
    background-color: #f3f6f6;
    font-weight: bold;
    text-align: left;
}

/* Special styling for Permission Matrix */
.permission-matrix-table {
    width: 100%;
    table-layout: fixed;
}

.permission-matrix-table td:first-child {
    width: 20%;
    font-weight: bold;
}

.permission-matrix-table td:nth-child(2) {
    width: 35%;
}

.permission-matrix-table td:nth-child(3) {
    width: 25%;
}

.permission-matrix-table td:last-child {
    width: 20%;
}

/* Network Communication Requirements table */
.wy-table-responsive table.network-comm {
    table-layout: fixed;
}

.wy-table-responsive table.network-comm td:nth-child(1) {
    width: 20%;
}

.wy-table-responsive table.network-comm td:nth-child(2) {
    width: 20%;
}

.wy-table-responsive table.network-comm td:nth-child(3) {
    width: 10%;
}

.wy-table-responsive table.network-comm td:nth-child(4) {
    width: 15%;
}

.wy-table-responsive table.network-comm td:nth-child(5) {
    width: 35%;
}

/* 2. UID i długie teksty techniczne - Problem z "wyjeżdżaniem za margines" */
.technical-content,
.uid-text,
code,
.literal {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    max-width: 100%;
    hyphens: auto;
}

/* Special handling for UUIDs and technical identifiers */
.highlight .go,
/* Generic output in code blocks */
pre code {
    word-break: break-all;
    white-space: pre-wrap;
}

/* 3. IMAGE FIXES - Problem z długo ładującymi się obrazkami */
.document img,
.figure img,
img {
    max-width: 100% !important;
    height: auto !important;
    loading: lazy;
    border-radius: 4px;
    margin: 10px 0;
}

/* Responsive images */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Figure captions */
.figure .caption {
    text-align: center;
    font-style: italic;
    margin-top: 10px;
    color: #666;
}

/* 4. CODE BLOCK IMPROVEMENTS */
.highlight pre {
    padding: 12px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f8f8f8;
    border: 1px solid #e1e4e5;
    border-radius: 4px;
}

/* JSON code blocks */
.highlight .language-json pre,
.highlight .language-bash pre,
.highlight .language-yaml pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* 5. EXTERNAL LINKS - Problem z otwieraniem w nowej karcie */
a.external::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
    color: #2980b9;
}

a.external {
    color: #2980b9;
    text-decoration: none;
    border-bottom: 1px dotted #2980b9;
}

a.external:hover {
    color: #3498db;
    border-bottom: 1px solid #3498db;
}

/* 6. INSTALLATION INDENTATION FIXES */
.installation-steps ol,
.installation-steps ul {
    margin-left: 20px;
    padding-left: 20px;
}

.installation-steps li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.installation-steps li p {
    margin-bottom: 8px;
}

.installation-steps .highlight {
    margin: 8px 0;
}

/* 7. NEXT STEPS STYLING */
.next-steps {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin: 30px 0;
}

.next-steps h2 {
    color: #2c5aa0;
    margin-bottom: 15px;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 5px;
}

.next-steps ul {
    margin-left: 0;
    padding-left: 20px;
}

.next-steps li {
    margin-bottom: 8px;
}

.next-steps a {
    font-weight: 500;
    color: #2c5aa0;
}

/* 8. ALERT/WARNING BOXES */
.admonition {
    margin: 20px 0;
    padding: 12px;
    border-left: 4px solid #f39c12;
    background-color: #fff8dc;
    border-radius: 4px;
}

.admonition.warning {
    border-left-color: #e74c3c;
    background-color: #fdf2f2;
}

.admonition.note {
    border-left-color: #3498db;
    background-color: #f0f7ff;
}

.admonition.tip {
    border-left-color: #27ae60;
    background-color: #f0fff4;
}

/* 9. RESPONSIVE IMPROVEMENTS */
@media (max-width: 768px) {
    .wy-table-responsive table {
        font-size: 0.85em;
    }

    .wy-table-responsive table td,
    .wy-table-responsive table th {
        padding: 6px 8px;
        max-width: 200px;
    }

    /* Hide some columns on mobile */
    .wy-table-responsive table.network-comm td:nth-child(4),
    .wy-table-responsive table.network-comm th:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .wy-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wy-table-responsive table {
        min-width: 600px;
    }

    .installation-steps {
        padding: 0 10px;
    }
}

/* 10. SEARCH HIGHLIGHTING */
.highlighted {
    background-color: #ffff88;
    padding: 1px 2px;
    border-radius: 2px;
}

/* 11. TOC STYLING */
.wy-menu-vertical li.toctree-l1>a {
    font-weight: bold;
}

.wy-menu-vertical li.current>a {
    border-right: 3px solid #2c5aa0;
}

/* 12. CUSTOM CLASSES FOR SPECIFIC CONTENT */
.requirements-table th,
.requirements-table td {
    text-align: center;
}

.requirements-table th:first-child,
.requirements-table td:first-child {
    text-align: left;
    font-weight: bold;
}

/* 13. SCROLLBAR STYLING */
.wy-table-responsive::-webkit-scrollbar {
    height: 8px;
}

.wy-table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wy-table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.wy-table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}




.wy-side-nav-search {
    background: transparent !important;
    margin-bottom: 0px !important;
}

.wy-side-nav-search>a,
.wy-side-nav-search>a:hover {
    background: none !important;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
}

.wy-side-nav-search a img.logo {
    display: inline-block;
    vertical-align: middle;
    height: 28px;
}

.wy-side-scroll .wy-side-nav-search form#rtd-search-form {
    display: none !important;
}

#els-topbar {
    position: fixed;
    top: 0;
    left: 300px;
    right: 0;
    z-index: 1000;
    background-image: url("../_static/img/top_bar_background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
}

.els-topbar__inner {
    max-width: 1200px;
    
    padding: 12px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.els-brand img {
    height: 40px;
    display: block;
}

.els-breadcrumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.els-breadcrumb__home {
    opacity: .85;
}

.els-breadcrumb__sep {
    margin: 0 6px;
    opacity: .6;
}

.els-search__input {
    width: 240px;
    height: 30px;
    border-radius: 16px;
    border: none;
    outline: none;
    padding: 0 12px;
    background: #f2f2f2;
    color: #111;
}

.wy-nav-content {
    width: 100% !important;
    max-width: 100% !important;
}
/* Padding dla treści żeby nie była zakryta przez fixed topbar */
.wy-nav-content-wrap {
    padding-top: 70px;
}


/* Make arrows slightly less prominent but always visible */
.wy-menu-vertical .toctree-expand {
    opacity: 0.6;
    visibility: visible;
}

/* Full opacity on hover */
.wy-menu-vertical li:hover > a .toctree-expand {
    opacity: 1;
}

/* Always show expand/collapse buttons in sidebar navigation */
.wy-menu-vertical li button.toctree-expand {
    opacity: 1 !important;
    display: block !important;
}

/* Keep them visible even when not hovered */
.wy-menu-vertical li.current > a button.toctree-expand,
.wy-menu-vertical li.on a button.toctree-expand {
    opacity: 1 !important;
}

/* ========================================
   AI Agent Modal - z-index Fix
   ======================================== */
/* Modal overlay - najwyższy priorytet */
.prem-overlay,
#sdc-assistant-root > .prem-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal window */
.prem-chat {
    z-index: 9999 !important;
    position: relative !important;
}

/* Obniż z-index topbar - ma być NAD treścią, ale POD modalem */
#els-topbar {
    z-index: 100 !important;
}

/* Sphinx RTD theme navbar */
.wy-nav-top {
    z-index: 100 !important;
}

/* Version selector button (latest) */
.rst-versions {
    z-index: 100 !important;
}
