/*  Status Badges */
#connection-badge,
#subscription-badge {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#connection-badge:hover,
#subscription-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#connection-badge i,
#subscription-badge i {
    margin-right: 8px;
    font-size: 16px;
}

/* Connection Badge States */
#connection-badge.online {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

#connection-badge.offline {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

#connection-badge.checking {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 100%);
}

/* Subscription Badge States */
#subscription-badge.active {
    background: linear-gradient(135deg, #26c6da 0%, #00acc1 100%);
}

#subscription-badge.expired {
    background: linear-gradient(135deg, #ff7043 0%, #f4511e 100%);
}

#subscription-badge.depleted {
    background: linear-gradient(135deg, #ffca28 0%, #ffb300 100%);
}

#subscription-badge.none {
    background: linear-gradient(135deg, #78909c 0%, #546e7a 100%);
}

/* Badge Glow Effects */
#connection-badge.online::after,
#subscription-badge.active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Badge Text */
.connection-status-text,
.subscription-status-text {
    position: relative;
    z-index: 2;
}

/* Badge Icons Animation */
#connection-badge i,
#subscription-badge i {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

#connection-badge:hover i,
#subscription-badge:hover i {
    transform: scale(1.2);
}

/* Status Change Animation */
@keyframes status-change {
    0% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.status-changed {
    animation: status-change 0.6s ease-out;
}

/* Connection Status Popup */
.connection-status-popup {
    position: fixed;
    top: 80px; /* Moved down to first quarter of screen */
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    min-width: 280px;
    max-width: 350px;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-status-popup.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.connection-status-popup.online,
.connection-status-popup.active {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: white;
}

.connection-status-popup.offline,
.connection-status-popup.expired {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: white;
}

.connection-status-popup.depleted {
    background: linear-gradient(135deg, #ffca28 0%, #ffb300 100%);
    color: #333;
}

.connection-status-popup.none {
    background: linear-gradient(135deg, #78909c 0%, #546e7a 100%);
    color: white;
}

.connection-status-popup-icon {
    margin-right: 15px;
    font-size: 24px;
    animation: popup-icon-bounce 1s ease infinite;
}

@keyframes popup-icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.connection-status-popup-text {
    flex: 1;
    font-weight: 500;
}

/* Progress bar for data usage */
.data-usage-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.5s ease;
}

/* Tooltip for more details */
.status-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

.status-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

#connection-badge:hover .status-tooltip,
#subscription-badge:hover .status-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Enhanced Online Detector Button */
.online-detector-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.online-detector-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.online-detector-button.online {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

.online-detector-button.offline {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

.online-detector-button.checking {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 100%);
}

.online-detector-button::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.online-detector-button.online::after {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.online-detector-button.expanded::after {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

/* Details Panel */
.online-detector-details {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 9998;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.online-detector-details.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.details-header {
    padding: 15px;
    background: #f5f5f5;
    font-weight: bold;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.details-header i {
    margin-right: 8px;
    color: #555;
}

.details-close {
    cursor: pointer;
    font-size: 18px;
    color: #777;
    transition: color 0.2s ease;
}

.details-close:hover {
    color: #333;
}

.details-content {
    padding: 15px;
}

.usage-stats {
    margin-bottom: 15px;
}

.usage-label {
    margin-bottom: 5px;
    font-weight: 500;
}

.usage-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 5px 0;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, #26c6da 0%, #00acc1 100%);
    transition: width 0.5s ease;
}

.usage-text {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.usage-remaining {
    font-weight: bold;
    margin-top: 10px;
    color: #26c6da;
}

.details-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    background: #26c6da;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.details-button:hover {
    background: #00acc1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.expiry-info {
    margin: 10px 0;
    line-height: 1.6;
}

.expiry-info div {
    margin-bottom: 5px;
}