body, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

.status-message {
    background: rgba(60, 60, 60, 0.9);
    color: #fff;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
}

.status-idle { background: #6c757d; }
.status-connecting { background: #ffc107; }
.status-connected { background: #28a745; }
.status-error { background: #dc3545; }

.user-menu-wrapper {
    display: flex;
    align-items: center;
    position: absolute;
    top: 20px;
    right: 0;
    gap: 8px;
}

.unified-bg {
    background: rgba(88, 88, 88, 0.44);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    position: relative;
    width: 46px;
    height: 46px;
    overflow: hidden;
    cursor: pointer;
    border-radius: 40.36px 0 0 40.36px;
    z-index: 1000;
    transition: width 0.3s ease-in-out;
}

.user-menu.expanded {
    width: 101px;
}

.user-menu-icon {
    position: absolute;
    top: 8px;
    left: 9px;
    width: 30px;
    height: 30px;
}

.user-menu-icon img {
    width: 100%;
    height: 100%;
}

.rainbow-icon {
    position: absolute;
    top: 8px;
    left: 54px;
    width: 30px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.user-menu.expanded .rainbow-icon {
    opacity: 1;
}

.rainbow-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sync-menu {
    position: absolute;
    top: 20px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    width: 46px;
    height: 46px;
    border-radius: 0 40.36px 40.36px 0;
    z-index: 1000;
}

.sync-menu.expanded {
    width: 181px;
}

.sync-menu-live {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.96);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    margin-right: 0px;
    order: 1;
}

.sync-menu.expanded .sync-menu-live {
    opacity: 1;
}

.sync-menu-toggle {
    width: 44px;
    height: 27px;
    margin-left: 10px;
    background: #818076;
    border-radius: 61px;
    display: flex;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: background 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease-in-out;
    order: 2;
}

.sync-menu.expanded .sync-menu-toggle {
    opacity: 1;
}

.sync-menu-toggle.on {
    background: #1A98EC;
}

.sync-menu-toggle-knob {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: -0.4px 0.6px 1.6px 0.6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.sync-menu-toggle.on .sync-menu-toggle-knob {
    transform: translateX(17px);
}

.sync-menu-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 3;
    flex-shrink: 0;
    order: 3;
}

.sync-menu-icon img {
    width: 30px;
    height: 30px;
}

.reconstruction-menu {
    position: absolute;
    top: 80px; 
    left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    width: 46px; 
    height: 46px;
    border-radius: 0 40.36px 40.36px 0;
    z-index: 1000;
}

.reconstruction-menu.expanded {
    width: 230px;
}

.reconstruction-menu-message {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.96);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    order: 1;
}

.reconstruction-menu.expanded .reconstruction-menu-message {
    opacity: 1;
}

.reconstruction-menu-icon {
    width: 46px; 
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 3;
    flex-shrink: 0;
    order: 2;
}

.reconstruction-menu-icon img {
    width: 30px;
    height: 30px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Modal Visible State */
.modal.visible {
    visibility: visible;
    opacity: 1;
}

/* Modal Content */
.modal-content {
    width: 80vw;
    height: 80vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}

/* Iframe Styling */
#reconstruction-frame {
    width: 100%;
    height: 100%;
}

.sound-control {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 30px;
    right: 30px;
    gap: 8px;
    z-index: 1000;
    width: 125px;
    height: 46px;
    border-radius: 40px;
    box-shadow: 0.8px 0.8px 2.4px rgba(0, 0, 0, 0.08);
}

.chat-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 30px;
    right: 160px;
    z-index: 1000;
    cursor: pointer;
}

.chat-icon img {
    width: 46px;
    height: 46px;
}

.record-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 40px;
    right: 200px;
    z-index: 1000;
    cursor: pointer;
}

.chat-message-container{
    display: flex;
}

.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.user-name{
    padding-left: 50px;
    color: white;
    font-size: 12px;
}

.chat-container.active {
    opacity: 1;
    visibility: visible;
}


.chat-header {
    background: #2C2C2E;
    color: white;
    display: flex;
    align-items: center;
    padding: 6px 20px;
    border-bottom: 1px solid #444;

    span{
        padding-left: 10px;
        font-size: 14px;
    }
}

.back-icon{
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.user-icon{
    width: 40px;
    height: 40px;
}


.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(
        180deg,
        rgba(59, 59, 59, 0) 78.74%,
        #3B3B3B 104.11%
    );
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
    font-size: 14px;
}

.chat-message.incoming {
    align-self: flex-start;
    margin-right: auto;
    background: #E5E5EA;
    color: #000;
}

.chat-message.outgoing {
    align-self: flex-end;
    margin-left: auto;
    background: #D1EDFFE5;
    color: #000;
}

.chat-timestamp-inc {
    padding-left: 45px;
    font-size: 12px;
    color: #666;
    align-self: flex-end;
}

.chat-timestamp-out {
    float:right;
    padding-right: 5px;
    font-size: 12px;
    color: #666;
    align-self: flex-end;
}

.chat-footer {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #2C2C2E;
    border-top: 1px solid #444;
}

.input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 100px;
    padding: 0 10px;
    height: 48px;
}

.input-wrapper .attach-icon {
    position: absolute;
    left: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.input-wrapper .microphone-icon {
    position: absolute;
    right: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.message-input {
    flex: 1;
    padding: 10px 40px 10px 40px; 
    border: none;
    border-radius: 100px;
    font-size: 14px;
    background: transparent;
    outline: none;
    color: #fff;
}

.chat-footer .send-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin-left: 10px;
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.icon-img {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.layers-icon {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 88, 88, 0.44);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.layers-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.online-users-wrapper {
    position: absolute;
    bottom: 30px;
    left: 85px;
    width: 111px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 0 12px;
    background: rgba(88, 88, 88, 0.4);
    backdrop-filter: blur(5px);
    border-radius: 69px;
    font-size: 11px;
    font-weight: 350;
    color: rgba(255, 255, 255, 0.96);
    z-index: 1;
}

.online-users-indicator {
    width: 7px;
    height: 7px;
    background: #90D351;
    border-radius: 50%;
}

.layers-icon img {
    width: 30px;
    height: 30px;
}

.layers-menu {
    position: absolute;
    bottom: 20px;
    left: 80px;
    width: 212px;
    height: 330px;
    border-radius: 12px;
    overflow-y: auto; 
    padding: 10px 0;
    display: none;
    z-index: 2;
}

.layers-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.layers-menu .menu-item {
    display: flex;
    align-items: center;
    background: linear-gradient(0deg, rgba(94, 94, 94, 0.2), rgba(94, 94, 94, 0.2)), rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    margin: 10px 10px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item .item{
        display: flex;
        justify-content: center;
        align-items: center;

}

.layers-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.layers-menu .menu-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    margin-right: 10px;
    cursor: pointer;
    background: rgba(208, 208, 208, 0.5);
}

.layers-menu .menu-item input[type="checkbox"]:checked {
    background: #29BF4A;
    border: none;
    position: relative;
}

.layers-menu .menu-item input[type="checkbox"]:checked::after {
    content: '✔';
    color: white;
    font-size: 12px;
    position: absolute;
    left: 4px;
    top: 1px;
}

.layers-menu .menu-item span {
    font-size: 14.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.96);
}

.panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(88, 88, 88, 0.44);
    backdrop-filter: blur(5px); 
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 10;
    border-radius: 15px;
    padding: 0;
    gap: 10px;
}

.panel .header {
    width: 100%;
    background: rgba(74, 74, 74, 0.44);
    backdrop-filter: blur(5px);
    color: #FFFFFF;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    border-radius: 15px 15px 0 0;
}

.police-panel {
    width: 208.66px;
    height: 257px;
    z-index: 1;
}

.police-panel .header {
    font-size: 14px;
    line-height: 41.76px;
}

.police-panel .info {
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    padding: 20px;
}

.police-panel .info p {
    margin: 0;
    font-weight: 500;
}

.police-panel button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 169px;
    height: 36px;
    background: linear-gradient(0deg, rgba(94, 94, 94, 0.24), rgba(94, 94, 94, 0.24)), rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    border: none;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.96);
    font-weight: 500;
    cursor: pointer;
    margin: 10px 0;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.police-panel button img {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.drone-panel {
    width: 50vw;
    height: 50vh;
    overflow: hidden;
    display: none;
    background: rgba(88, 88, 88, 0.44); 
    backdrop-filter: blur(5px); 
}

.drone-panel.active {
    display: flex;
}

.drone-panel.fullscreen {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    transform: none;
    border-radius: 0;
    z-index: 10000;
}

.drone-panel .header {
    height: 40px;
    font-size: 16px;
    justify-content: space-between;
    background: rgba(74, 74, 74, 0.44);
    backdrop-filter: blur(5px); 
}

.drone-panel .header img {
    width: 26px;
    height: 26px;
    cursor: pointer;
}


/*IOT Modal */

/* Position IoT icon above layersMenu */
#iotIcon {
    position: absolute;
    bottom: 80px; 
    left: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 88, 88, 0.44);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#iotIcon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* IoT Modal */
#iot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#iot-modal.visible {
    visibility: visible;
    opacity: 1;
}

#iot-modal .modal-content {
    width: 80vw;
    height: 80vh;
    background: #fff;
    border-radius: 10px;
    overflow-y: auto;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

#iot-modal .modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #333;
    text-align: center;
}

#iot-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}


/* charts */
#iot-charts {
    display: flex;
    flex-wrap: wrap; /* Allow charts to wrap to the next row */
    gap: 20px;
    justify-content: center;
    overflow-y: auto;
    max-height: 70vh; /* Limit height for scrollable content */
}

.chart-container {
    flex: 0 0 calc(50% - 20px); /* Two charts per row with spacing */
    box-sizing: border-box;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 300px; /* Fix container height */
}

.chart-container canvas {
    width: 100% !important; /* Ensure canvas fills the container */
    height: 100% !important; /* Ensure canvas height matches container */
}

.chart-container h3 {
    margin: 0 0 10px;
    font-size: 16px;
    text-align: center;
}


