/* WebUp Monitor - Compact Status Display */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
}

#monitor-container {
    max-height: 80px;
    overflow: hidden;
}

.monitor-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 5px;
    height: 70px;
}

.site-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-width: 50px;
    gap: 3px;
}

/* Row 1: Abbreviation */
.site-abbr {
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    height: 16px;
    line-height: 16px;
}

/* Row 2: Status Indicator */
.status-indicator {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Shape variants */
.status-indicator.shape-round {
    border-radius: 50%;
}

.status-indicator.shape-square {
    border-radius: 0;
}

.status-indicator.shape-rounded-square {
    border-radius: 4px;
}

.status-indicator.shape-octagon {
    border-radius: 4px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.status-indicator.shape-arrow {
    clip-path: polygon(50% 0%, 100% 50%, 50% 50%, 50% 100%, 50% 50%, 0% 50%);
}

/* Tooltip */
.status-indicator::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
    margin-bottom: 5px;
}

.status-indicator:hover::before {
    opacity: 1;
}

/* History Grid (hidden by default) */
.history-grid {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px;
    border-radius: 4px;
}

.status-indicator:hover .history-grid {
    display: grid;
}

.history-item {
    border-radius: 1px;
    transition: transform 0.1s;
}

.history-item:hover {
    transform: scale(1.1);
}

/* Row 3: Time Ago */
.time-ago {
    font-size: 9px;
    color: #999;
    text-align: center;
    height: 12px;
    line-height: 12px;
}

/* Refresh Button */
.refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #555;
    color: #fff;
    margin-top: 19px;
}

.refresh-button:hover {
    background-color: #555;
    transform: scale(1.05);
}

.refresh-button:active {
    transform: scale(0.95);
}

.refresh-button svg {
    width: 24px;
    height: 24px;
}

/* Spinning animation for refresh */
.refresh-button.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for embedding */
@media (max-width: 600px) {
    .monitor-grid {
        gap: 5px;
    }

    .site-column {
        min-width: 40px;
    }

    .status-indicator, .refresh-button {
        width: 28px;
        height: 28px;
    }

    .site-abbr {
        font-size: 10px;
    }
}

/* Grid lines option (if enabled in theme) */
.monitor-grid.with-gridlines .site-column {
    border-right: 1px solid var(--grid-color, #343431);
    padding-right: 8px;
}

.monitor-grid.with-gridlines .site-column:last-of-type {
    border-right: none;
}

/* Color status variations for better visibility */
.status-indicator[data-status="OK"] {
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.status-indicator[data-status="Not reachable"] {
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.status-indicator[data-status="Internal error"] {
    box-shadow: 0 0 5px rgba(128, 0, 128, 0.3);
}

.status-indicator[data-status="Not found"] {
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
}
