@font-face {
    font-family: Montserrat;
    src: url('/css/fonts/Montserrat.ttf');
}

canvas {
    display: block;
}

:root {
    --bs-font-sans-serif: Montserrat, system-ui;
}

/* Make Nette links look like normal text */
a {
    color: var(--bs-body-color);
    text-decoration: none;
}

.popover {
    --bs-popover-font-size: var(--bs-font-size-base);
}

.monospace-number {
    font-variant-numeric: tabular-nums;
}

/* Customize Bootstrap tooltip */
.custom-tooltip {
    --bs-tooltip-bg: var(--bs-primary-bg-subtle);
    --bs-tooltip-color: var(--bs-black);
    --bs-tooltip-opacity: 1;
    border-radius: var(--bs-tooltip-border-radius);
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.2);
}

/* Customize Navbar Active Link */
.navbar .nav-link.active {
    border-bottom: var(--bs-primary) 1px solid;
}

/* Customize Navbar Dropdown Links */
.nav-item .dropdown-menu .dropdown-item.active {
    color: black;
    background-color: var(--bs-primary-bg-subtle);
}

.nav-item .dropdown-menu .dropdown-item.inactive {
    color: var(--bs-navbar-color);
}

/* Make the dropdown scrollable */
.scrollable-dropdown {
    max-height: 50vh;
    overflow-y: auto;
}

.scrollable-dropdown::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    border-radius: var(--bs-dropdown-border-radius);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

/* Style for the account projects list */
.account-projects-list {
    max-height: 30vh;
    overflow-y: auto;
}

/* Do not wrap nav items */
.nav-item {
    white-space: nowrap;
}

.projects-dropdown-menu {
    max-width: 20rem;
    overflow-x: hidden;
}

/* Style for selected project card */
.project-selected {
    border-color: var(--bs-primary);
    border-width: 1px;
}

.project-selected .card-header {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
    font-weight: bold;
}

.project-selected::after {
    --border-width: 3px;
    content: "";
    z-index: -1;
    position: absolute;
    border-radius: var(--bs-border-radius);
    top: calc(-1 * var(--border-width));
    left: calc(-1 * var(--border-width));
    width: calc(100% + var(--border-width) * 2);
    height: calc(100% + var(--border-width) * 2);
    background: linear-gradient(60deg,
            #00ffdd,
            #ffffff,
            #00ffdd);
    background-size: 300% 300%;
    background-position: 0 50%;
    animation: moveGradient 3s alternate infinite;
}

@keyframes moveGradient {
    50% {
        background-position: 100% 50%;
    }
}

/* Style for current account card */
.current-account {
    border-color: var(--bs-primary);
    border-width: 2px;
}

.current-account .card-header {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
    font-weight: bold;
}

/* Style for projects counters */
.projects-counter-item {
    color: white;
    font-size: 1rem;
    border: none;
    font-variant-numeric: tabular-nums;
}

.projects-counter-item:hover {
    color: white;
    filter: brightness(1.1);
}

.projects-counter-item.active {
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.projects-counter-item.inactive {
    opacity: 0.3;
}

/* Style for alarm indicator */
.alarm-indicator-count {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.toast {
    width: fit-content;
    max-width: 500px;
}

/* Style for the configuration sync container */
.config-sync-container {
    /* Ensure it appears above the modal (--bs-modal-zindex: 1055) */
    z-index: 1060;
    opacity: 0.95;
    max-height: 20%;
    overflow-y: auto;
    transition: opacity 0.3s ease-in-out;
}

.config-sync-container.initially-hidden {
    opacity: 0;
}

.config-sync-card {
    background: #f8fcff;
    border: 1px solid #cfe2ff;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.15);
}

.config-sync-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    white-space: nowrap;
}


/* Style for the global modal */
#global-modal .modal-dialog {
    transform: translate(0, -50px);
}

#global-modal .modal-content {
    position: absolute;
    max-height: 80%;
}

#global-modal .modal-header {
    cursor: move;
}

.sticky-header th {
    position: sticky;
    top: 0;
    background-color: var(--bs-body-bg);
    z-index: 1;
}

/* Pulsing effect */
.pulsing {
    animation: pulsing 1s infinite;
}

@keyframes pulsing {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.event-message-textarea {
    resize: vertical;
}

.event-priority-select {
    max-width: 8rem;
}

.events-table-container {
    max-height: 80vh;
    overflow-y: auto;
}

.events-time-column {
    max-width: 250px;
    width: 250px;
    white-space: nowrap;
}

.events-source-column {
    max-width: 150px;
    width: 100px;
    white-space: normal;
}

.events-priority-column {
    max-width: 100px;
    width: 100px;
    white-space: nowrap;
}

.events-message-column {
    white-space: normal;
    max-width: 400px;
    word-wrap: break-word;
}

.events-message-toggle {
    display: flex;
    align-items: center;
    padding: 0;
    color: var(--bs-info);
}

.popover-message {
    max-width: 800px;
}

#popover-message .form-control {
    resize: both;
    min-width: 300px;
    max-width: 700px;
    max-height: 100px;
}

.mw-rem-10 {
    max-width: 10rem;
}

.mw-rem-20 {
    max-width: 20rem;
}

.fs-7 {
    font-size: 0.875rem;
}

.fs-8 {
    font-size: 0.75rem;
}

/* Style for the icon used to expand/collapse details */
.unfold-icon {
    display: inline-block;
    transition: .3s transform ease-in-out;
}

.unfold-icon:hover {
    color: var(--bs-secondary);
    filter: brightness(1.2);
}

.collapsed .unfold-icon {
    transform: rotate(90deg) !important;
}

/* Real-Time Data loading spinner */
.loading-container {
    height: 20rem;
}

.loading-container .spinner-border {
    width: 5rem;
    height: 5rem;
}

/* Style for the default value in the configuration */
.default-value {
    color: var(--bs-secondary);
}

/* Style for Node, Zone, etc. rename input */
.rename-input {
    width: 100%;
    max-width: 100%;
    display: inline-block;
    padding: 0.2rem 0.5rem;
}

/* Configuration item (property) in modal */
.config-item {
    margin-bottom: 1rem;
}

/* Styling for the drop zone when a draggable element hovers over it */
.zone.accordion-item.over .accordion-button.collapsed {
    background-color: var(--bs-primary-bg-subtle);
    transition: background-color 0.2s ease,
}

/* Enhanced Toggle Switch Styling */
.enhanced-toggle-container {
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 0.5rem;
}

.enhanced-toggle {
    display: inline-block;
    transition: all 0.2s ease;
    color: var(--bs-secondary);
}

.enhanced-toggle.active {
    color: var(--bs-highlight-color);
    font-weight: bold;
    /* Maintain consistent text size */
    letter-spacing: -0.4px;
}

.enhanced-toggle-hidden-description {
    display: none;
}

/* Make the toggle a bit larger */
.enhanced-toggle-form .form-check-input {
    width: 2.5em;
    height: 1.25em;
}

/* Local time badge */
.local-time-indicator {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translate(-95%, -50%);
    z-index: 6;
}

/* Style for APORTAL update notification */
#aportal-update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1050;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem 1.5rem;
    font-size: 1.25rem;
    animation: pulse 2s infinite ease-in-out;
}

/* Pulse animation for APORTAL update notification */
@keyframes pulse {
    50% {
        transform: scale(1.05);
    }
}