/* Tabs */

.ddtt-tab-link .ddtt-log-count-indicator {
    position: absolute;
    top: -10px;
    right: -6px;
}


/* Raw Log Content */

#ddtt-wrap-log-text-label {
    display: flex;
    align-items: center;
    gap: 7px;
    float: right;
    margin-bottom: 10px;
}

#ddtt-wrap-log-text-label .ddtt-toggle-wrapper {
    margin-top: 0;
}

.ddtt-log-pane-raw {
    margin-top: 1rem !important;
}

#ddtt-log-raw {
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
    padding: 1rem;
    font-family: Consolas, monospace;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    clear: both;
    overflow: visible;
}

#ddtt-log-raw pre {
    margin: 0;
    white-space: pre; /* default: no wrap */
    overflow-x: auto;
    overflow-y: visible;
}

.ddtt-log-wrap pre {
    white-space: pre-wrap !important;
    word-wrap: break-word;
}

.ddtt-log-line {
    display: block;
    padding: 0 0.5rem;
    transition: background 0.2s ease;
}

.ddtt-log-line:hover {
    background: var(--color-bg-alt2);
}

.ddtt-line-num {
    display: inline-block;
    width: 50px;
    opacity: 0.5;
    user-select: none;
}


/* Easy Reader Log Viewer */

#ddtt-log-easy .ddtt-table th,
#ddtt-log-easy .ddtt-table td {
    border: 1px solid var(--color-border);
}

#ddtt-log-easy .ddtt-table th {
    white-space: nowrap;
}

#ddtt-log-easy .ddtt-table .ddtt-log-error-count-th,
#ddtt-log-easy .ddtt-table .ddtt-log-error-count-td {
    text-align: center;
}

#ddtt-log-easy .ddtt-table td:nth-child(3) {
    white-space: nowrap;
    text-transform: capitalize;
}

#ddtt-log-easy .ddtt-table td:nth-child(4) {
    white-space: normal;
    word-break: break-word;
}

#ddtt-log-easy .ddtt-table td:nth-child(4) pre {
    white-space: pre-wrap;
}

#ddtt-log-easy .ddtt-table th:nth-child(1),
#ddtt-log-easy .ddtt-table td:nth-child(1) {
    width: 40px;
}

#ddtt-log-easy .ddtt-table th:nth-child(2),
#ddtt-log-easy .ddtt-table td:nth-child(2) {
    width: 100px;
}

#ddtt-log-easy .ddtt-table th:nth-child(3),
#ddtt-log-easy .ddtt-table td:nth-child(3) {
    width: 100px;
}

.ddtt-log-error-message {
    font-weight: 500;
    margin-bottom: 1rem;
    background: var(--color-text-primary);
    color: var(--color-bg-main);
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.4),
                0 6px 12px rgba(0, 0, 0, 0.3);
    padding: 0.73rem 1rem;
    border-radius: 4px;
    width: fit-content;
    max-width: 100%;
}

.ddtt-log-error-message-wrapper {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
}

.ddtt-log-error-message-wrapper .ddtt-log-error-message {
    padding-right: 30px; /* space for the icon */
}

.ddtt-copy-icon {
    position: absolute;
    top: 5px;
    right: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-bg-main);
    transform: rotate(90deg);
    user-select: none;
    transition: color 0.2s;
    opacity: 0.73;
}

.ddtt-copy-icon:hover {
    opacity: 1;
}

.ddtt-note-prefix {
    font-size: 0.7rem;
    background: var(--color-bg-main);
    padding: 4px 8px;
    margin-right: 5px;
    color: var(--color-text-primary);
    border-radius: 5px;
}

.ddtt-log-error-source,
.ddtt-log-error-file,
.ddtt-log-error-line {
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 2px;
}

.ddtt-log-error-help {
    display: inline-block;
    position: relative;
    margin-bottom: 1rem;
}

.ddtt-log-error-stack {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding: 0 20px;
    background-color: var(--color-code-block-bg);
    border-left: 3px solid var(--color-border);
    font-size: 0.85em;
    overflow-x: auto;
    white-space: pre-wrap;
}

.ddtt-log-error-count {
    white-space: nowrap;
    font-weight: 500;
    text-align: center;
}

.ddtt-value-preview .view-more {
    display: block;
    margin-top: 0.5rem;
}

section[data-subsection="activity"] code {
    background: var(--color-code-block-bg) !important;
    padding: 3px 5px 4px 5px !important;
    font-size: 0.73rem;
}


/* Sidebar */

#ddtt-log-viewer-combine:disabled {
    display: none;
}

#ddtt-color-identifiers {
    padding: 1rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-alt);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
}

#ddtt-color-identifiers .color-cont {
    display: flex;
    align-items: center;
}

#ddtt-color-identifiers .color-cont:not(:last-child) {
    margin-bottom: 0.5rem;
}

#ddtt-color-identifiers .color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    margin-right: 0.5rem;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
}
