/* ISPU Component Styles */
.ispu-wrapper {
    font-family: Arial, Helvetica, sans-serif;
}

/* 1. Sticky Button */
/* Sticky Button Inline Layout */
.ispu-sticky-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999 !important;
    padding: 10px 18px;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    
    /* MENGUNCI TAMPILAN INLINE / BERDAMPINGAN */
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    
    white-space: nowrap;
    transition: transform 0.2s ease;
}

.ispu-sticky-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0; /* Mencegah ikon tertekan/gepeng */
}

/* 2. Main Banner Overlay */
.ispu-banner-overlay {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999 !important; /* Menaikkan layer melebihi form CCTV */
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    box-sizing: border-box;
    display: none;
}

/* Responsive khusus Layar HP / Mobile View */
@media (max-width: 576px) {
    .ispu-banner-overlay {
        left: 15px !important;
        right: 15px !important;
        bottom: 15px !important;
        width: calc(100% - 30px) !important;
        max-width: none !important;
        padding: 15px !important;
        max-height: 85vh; /* Mencegah overflow jika layar HP sangat pendek */
        overflow-y: auto;
    }
    
    .ispu-sticky-btn {
        right: 15px !important;
        bottom: 15px !important;
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Header */
.ispu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.ispu-header-title h2 { margin: 0; color: #333; font-size: 20px; font-weight: bold; }
.ispu-header-title p { margin: 4px 0 0 0; color: #777; font-size: 12px; }

.ispu-close-btn { 
    color: #999; font-size: 28px; font-weight: bold; 
    cursor: pointer; line-height: 1; margin-top: -5px; 
}
.ispu-close-btn:hover { color: #333; }

/* Banner Info Utama */
.ispu-main-info {
    background-color: #0f0f0f;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 4px 4px;
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.ispu-main-info .ispu-label { font-size: 14px; color: #ccc; }
.ispu-main-info .ispu-value { font-size: 32px; font-weight: bold; margin-top: -2px; }
.ispu-main-info .ispu-right { text-align: right; }
.ispu-main-info .ispu-status { font-size: 20px; font-weight: bold; margin-bottom: 6px; }
.ispu-main-info .ispu-time { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; font-size: 11px; display: inline-block; }

/* Chart Styling */
.ispu-chart-grid { display: grid; grid-template-columns: 100px repeat(7, 1fr); gap: 4px; height: 180px; }
.ispu-legend-col { display: flex; flex-direction: column-reverse; }
.ispu-legend-box { flex: 1; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 10px; text-align: center; border-bottom: 1px solid white; }
.ispu-legend-box:first-child { border-bottom: none; }

/* Kategori Warna */
.bg-baik { background-color: #00b000 !important; color: white !important; }
.bg-sedang { background-color: #0000e0 !important; color: white !important; }
.bg-tidak-sehat { background-color: #c0c000 !important; color: white !important; }
.bg-sangat-tidak-sehat { background-color: #ff0000 !important; color: white !important; }
.bg-berbahaya { background-color: #000000 !important; border-top: 1px solid #333; color: white !important; }

.ispu-bar-col { background-color: #f0f0f0; display: flex; align-items: flex-end; }
.ispu-bar-fill {
    width: 100%; display: flex; justify-content: center; align-items: flex-end;
    padding-bottom: 5px; color: white; font-weight: bold; font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); transition: height 0.5s ease-out;
}

.ispu-x-axis { display: grid; grid-template-columns: 100px repeat(7, 1fr); gap: 4px; margin-top: 8px; text-align: center; font-weight: bold; font-size: 11px; color: #444; }
.ispu-footer-desc { background-color: #0a0a0a; color: #f1f1f1; text-align: center; padding: 12px; border-radius: 8px; font-size: 12px; line-height: 1.4; margin-top: 15px; }

/* Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }