@import "colors.css";

/* General Styling */
body {
    font-family: 'Inter', 'Regular', sans-serif;
    font-weight: 400;
    font-size: 16px;
    background: var(--background-primary);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

strong {
    font-weight: normal;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Table Styling */
#data-table {
    background: var(--background-primary);
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin-right: 10px;
}

/* Tabulator Custom Styling */
.tabulator {
    border: none !important;
}

/* Custom Scrollbar for Tabulator */
.tabulator .tabulator-tableholder::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 4px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: var(--neutral-500);
    border-radius: 4px;
    border: 2px solid var(--background-secondary);
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-600);
}

/* Hide sort arrows */
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    display: none;
}

.tabulator .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-sorter::before {
    content: '';
    margin-top: 10px;
    margin-left: 5px;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-left: 2px solid var(--header-text);
    border-top: 2px solid var(--header-text);
    transform: translate(-50%, -50%) rotate(45deg);
}

.tabulator .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-sorter::before {
    content: '';
    margin-top: 3px;
    margin-left: 5px;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-left: 2px solid var(--header-text);
    border-top: 2px solid var(--header-text);
    transform: translate(-50%, -50%) rotate(-135deg);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    width: auto !important;
    padding-right: 5px !important;
}

.tabulator .tabulator-tableholder {
    overflow-x: hidden !important;
}

.tabulator .tabulator-header {
    background-color: var(--header-background) !important;
    height: 32px !important;
    border-bottom: 0px solid var(--table-border) !important;
}

.tabulator-header .tabulator-col {
    top: 0;
    z-index: 1;
    position: sticky;
    background: var(--header-background) !important;
    color: var(--header-text) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-right: none !important;
    height: 32px !important;
}

.tabulator-header .tabulator-col-content {
    padding: 0 4px !important;
    line-height: 32px !important;
}

.tabulator-row {
    transition: background 0.2s ease-in-out;
    border-bottom: 1px solid var(--table-border) !important;
}

.tabulator-row:hover {
    background: var(--table-row-hover) !important;
}

.tabulator-row .tabulator-cell {
    border-right: none !important;
    font-size: 16px;
}

.tabulator-row-even {
    background: var(--background-primary) !important;
}

.tabulator-row-odd {
    background: var(--background-primary) !important;
}

.tabulator-col-title-holder {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.tabulator-col-title {
    margin-right: 4px;
}

.tabulator-col-sorter {
    position: static !important;
    margin-left: 0 !important;
    transition: all 0.3s ease;
}

.tabulator-col-sorter:hover {
    transform: scale(1.2);
}

/* Filter Container */
#filter-wrapper {
    box-sizing: border-box;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    background: var(--background-secondary);
    justify-content: flex-end;
    padding-top: 12px;
    padding-right: 24px;
}

/* Scrollable Filters Area */
#scrollable-filters {
    position: relative;
    max-width: calc(100% - 484px);
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
}

#scrollable-filters.has-filters {
    padding-right: 24px;
}

/* Filters Container */
#filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex: 1;
}

#filter-container::-webkit-scrollbar {
    display: none;
}

/* Arrow Wrappers */
.arrow-wrapper {
    position: absolute;
    top: 0;
    height: 100%;
    width: 32px;
    background: var(--background-secondary);
    display: none;
    z-index: 2;
    align-items: center;
    justify-content: center;
}

.arrow-wrapper.left {
    left: 0;
}

.arrow-wrapper.right {
    right: 0;
}

.arrow-wrapper.visible {
    display: flex;
}

/* Scroll Arrows */
.scroll-arrow {
    width: 24px;
    height: 24px;
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    margin: 4px;
    font-size: 24px;
    line-height: 1;
}

.scroll-arrow svg {
    stroke: var(--text-primary);
}

.scroll-arrow:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

/* Filter Input Wrapper - pill style */
.filter-input-wrapper {
    display: flex;
    align-items: center;
    border-radius: 8px;
    height: 29px;
    box-shadow: none;
    background: var(--background-primary);
}

#filter-input {
    background: transparent;
    border: none;
    padding: 6px 12px;
    outline: none;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    height: 30px;
    line-height: 20px;
    max-width: 414px;
    min-width: 414px;
}

#filter-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

#add-filter-btn {
    background: transparent;
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    height: 29px;
    width: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

#add-filter-btn svg {
    display: block;
}

#add-filter-btn:hover {
    transform: scale(1.2);
}

#filter-error {
    padding: 0 20px;
    color: var(--status-error);
    font-weight: bold;
    display: block;
}

#filter-error.hidden {
    display: none;
}

#filter-input.has-error {
    border-color: var(--status-error);
}

.pill-label {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    color: var(--text-primary);
}

.link-field a {
    color: var(--link-primary);
    text-decoration: none;
}

.link-field a:hover {
    text-decoration: underline;
}

.filter-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--filter-badge-text);
    font-size: 16px;
    font-weight: 500;
    padding: 6px 8px 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    white-space: nowrap;
    height: 30px;
    border: 1.3px solid var(--brand-secondary);
}

.cross {
    position: relative;
    width: 15px;
    height: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cross::before,
.cross::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.5px;
    height: 100%;
    background-color: var(--filter-badge-text);
    transform-origin: center;
}

.cross::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cross::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cross:hover {
    transform: scale(1.2);
}

/* Remove Filter Button */
.filter-badge span.cross {
    cursor: pointer;
    margin-left: 5px;
    transition: color 0.2s ease-in-out;
}

.filter-badge span.cross:hover {
    color: var(--filter-badge-close-hover);
}

/* Smooth Removal Animation */
.filter-badge.removed {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.indicator-field {
    justify-content: center;
}

#table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

.tabulator-col-resize-handle {
    z-index: 2;
}

.tabulator-row .tabulator-responsive-collapse {
    border: 0px solid var(--border-secondary);
}

element.style {
    margin-bottom: 16px;
}

/* Alerts Count Column */
.alerts-count-column {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Alerts Count Circle */
.alerts-count-circle {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.3px solid var(--alerts-count-circle-color);
    /* background-color: var(--alerts-count-background); */
    color: var(--alerts-count-circle-color);
    font-size: 10px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
    padding-top: 3px;
}


.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-status-wrapper {
    position: fixed;
    bottom: 6px;
    left: 20px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.online-status-indicator {
    cursor: default;
    user-select: none;
    transition: color 0.3s ease;
}

.online-status-indicator.online {
    color: var(--online-status-indicator);
}

.online-status-indicator.offline {
    color: var(--offline-status-indicator);
}

.theme-toggle-wrapper {
    position: fixed;
    bottom: 7px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    cursor: pointer;
    width: 16px;
    height: 16px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.theme-toggle-btn:hover {
    transform: scale(1.2);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.theme-toggle-btn:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.theme-toggle-btn:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.theme-toggle-btn:hover .theme-icon {
    stroke: var(--text-inverse);
}

.theme-icon {
    width: 16px;
    height: 16px;
    stroke: var(--theme-icon-color);
    color: var(--theme-icon-color);
    transition: all 0.3s ease;
}

.theme-icon.sun-icon {
    display: block;
}

.theme-icon.moon-icon {
    display: none;
}

[data-theme="dark"] .theme-icon.sun-icon {
    display: none;
}

[data-theme="dark"] .theme-icon.moon-icon {
    display: block;
}

.tabulator-footer {
    background-color: var(--background-secondary) !important;
    border-top: 1px solid var(--table-border) !important;
}

.tabulator-footer .tabulator-footer-contents {
    background-color: var(--background-secondary) !important;
    height: 29px !important;
}

.tabulator-footer .tabulator-footer-contents .tabulator-paginator {
    justify-content: center;
    display: flex;
    height: 19px !important;
    align-items: center;
}

/* Navigation buttons with arrows */
.tabulator-footer button {
    color: var(--footer-text) !important;
    background-color: transparent !important;
    border: none !important;
    height: 19px !important;
    padding: 0 !important;
    line-height: 19px !important;
}

.tabulator-footer .tabulator-pages {
    height: 19px !important;
}

/* Page number buttons - remove background, make bigger */
.tabulator-footer .tabulator-pages button {
    background-color: transparent !important;
    color: var(--footer-text) !important;
    font-weight: 500;
    height: 19px !important;
    line-height: 19px !important;
    padding: 0 4px !important;
}

.tabulator-footer .tabulator-pages button.active {
    color: var(--brand-primary) !important;
    background-color: transparent !important;
}

.tabulator-footer .tabulator-pages button:hover {
    background-color: transparent !important;
    color: var(--brand-primary) !important;
}

.tabulator-footer button[data-page="first"],
.tabulator-footer button[data-page="prev"],
.tabulator-footer button[data-page="next"],
.tabulator-footer button[data-page="last"] {
    font-size: 0 !important; /* Hide text */
    padding: 0 6px !important;
}

.tabulator-footer button[data-page="first"]::before {
    background-color: var(--footer-text) !important;
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    mask: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 9L5 5L9 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 9L1 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 9L5 5L9 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 9L1 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    transition: all 0.3s ease;
}

.tabulator-footer button[data-page="prev"]::before {
    background-color: var(--footer-text) !important;
    content: '';
    display: inline-block;
    width: 6px;
    height: 10px;
    background-color: var(--text-primary);
    mask: url('data:image/svg+xml;utf8,<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 9L1 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 9L1 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    transition: all 0.3s ease;
}

.tabulator-footer button[data-page="next"]::before {
    background-color: var(--footer-text) !important;
    content: '';
    display: inline-block;
    width: 6px;
    height: 10px;
    background-color: var(--text-primary);
    mask: url('data:image/svg+xml;utf8,<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 9L5 5L1 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 9L5 5L1 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    transition: all 0.3s ease;
}

.tabulator-footer button[data-page="last"]::before {
    background-color: var(--footer-text) !important;
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    mask: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 9L5 5L1 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 9L9 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 9L5 5L1 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 9L9 5L5 1" stroke="black" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    transition: all 0.3s ease;
}

/* Positioning for navigation buttons arrows */
.tabulator-footer button[data-page="first"]::before,
.tabulator-footer button[data-page="prev"]::before,
.tabulator-footer button[data-page="next"]::before,
.tabulator-footer button[data-page="last"]::before {
    padding-top: 17px;
}

.tabulator-footer button[data-page="first"]:hover::before,
.tabulator-footer button[data-page="prev"]:hover::before,
.tabulator-footer button[data-page="next"]:hover::before,
.tabulator-footer button[data-page="last"]:hover::before {
    background-color: var(--brand-primary);
}


.tabulator-footer button[data-page]:hover {
    background: transparent !important;
    transform: scale(1.2);
}

.tabulator-placeholder-contents {
    width: 1242px;
    margin-left: 0px;
    margin-top: 50px;
}

.status-indicator {
    display: inline-block;
    width: 6px;
    height: 35px;
}

.status-indicator.firing {
    background-color: var(--status-badge-firing);
}

.status-indicator.resolved {
    background-color: var(--status-badge-resolved);
}

.status-indicator.unknown {
    background-color: var(--status-badge-unknown);
}

.status-indicator.closed {
    background-color: var(--status-badge-closed);
}
