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

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

body {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wave 5s ease infinite;
    font-family: "Noto Sans", sans-serif;
}

body.unknown {
    background: linear-gradient(-45deg, #003262, #89CFF0, #6CB4EE, #318CE7);
    background-size: 400% 400%;
}

body.connected {
    background: linear-gradient(-45deg, #3da665, #50C878, #66d68d, #3da665);
    background-size: 400% 400%;
}

body.disconnected {
    background: linear-gradient(-45deg, #c4c0bc, #DBD7D2, #e8e6e3, #c4c0bc);
    background-size: 400% 400%;
}

.container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding: 30px 15px;
    box-sizing: border-box;
}

.glass-box {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 250px;
    width: 20%;
    position: relative;
    overflow: hidden;
    animation: wave 5s ease infinite;
    box-sizing: border-box;
}

@media screen and (max-width: 1024px) {
    .container {
        gap: 15px;
        padding: 20px 10px;
    }

    .glass-box {
        width: 20%;
        padding: 20px;
        min-height: 200px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        flex-wrap: wrap;
        padding: 15px;
    }

    .glass-box {
        width: 100%;
        margin-bottom: 20px;
        min-height: 200px;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .glass-box {
        width: calc(50% - 30px);
        min-height: 220px;
    }
}

@media (max-width: 768px) {
    .glass-box {
        width: 100%;
        min-height: 200px;
        margin-bottom: 20px;
    }

    .container {
        gap: 20px;
        padding: 20px;
        width: 80%;
    }
}

.glass-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px 0 rgba(31, 38, 135, 0.3);
}

.glass-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 400% 400%;
    animation: wave 5s ease infinite;
    opacity: 0.8;
    z-index: 0;
    border-radius: 15px;
}

.box-red::before,
.connected::before {
    background-image: linear-gradient(to right, #d16b6b, #d57070, #da7575, #de7a7a, #e27f7f, #e67e7e, #e97e7e, #ed7d7d, #f17676, #f56f6e, #f86767, #fb5f5f);
}

.box-whitesmoke::before,
.disconnected::before {
    background: linear-gradient(-45deg, #F5F5F5, #FFFFFF, #F7F7F7, #FFF5EE);
}

.floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px 0 rgba(31, 38, 135, 0.3);
}

.floating-button i {
    font-size: 28px;
    color: rgba(0, 0, 0, 0.8);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .glass-box {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .glass-box {
        width: 100%;
        min-height: 180px;
    }

    .container {
        gap: 15px;
        padding: 15px;
    }
}

.error-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
.error-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}
.error-message {
    color: #721c24;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.error-details {
    color: #6c757d;
    font-size: 0.9rem;
    max-width: 80%;
    margin: 0 auto;
}
.btnRetry {
    margin-top: 12px;
    padding: 6px 12px;
    border: none;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btnRetry:hover {
    background-color: #e2e2e2;
}

@media (max-width: 768px) {
    .error-container {
        width: calc(100% - 30px);
    }
    .error-details {
        max-width: 100%;
    }
}

/* Loading overlay styling */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#loadingOverlay.visible {
    opacity: 1;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    margin: 0 auto 20px;
    animation: spin 1s ease-in-out infinite;
}

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

.loading-message {
    font-size: 18px;
    font-weight: 500;
}
