/**
 * MQTT实时通知样式
 */

/* 通知容器 */
#mqtt-notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

/* 通知卡片 */
.mqtt-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #2196F3;
    min-width: 320px;
    max-width: 400px;
}

/* 通知类型颜色 */
.mqtt-notification-success {
    border-left-color: #4CAF50;
}

.mqtt-notification-info {
    border-left-color: #2196F3;
}

.mqtt-notification-warning {
    border-left-color: #FF9800;
}

.mqtt-notification-error {
    border-left-color: #F44336;
}

/* 通知图标 */
.mqtt-notification-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

/* 通知内容 */
.mqtt-notification-content {
    flex: 1;
    min-width: 0;
}

.mqtt-notification-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.mqtt-notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
}

/* 关闭按钮 */
.mqtt-notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.mqtt-notification-close:hover {
    color: #333;
}

/* 动画 */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    #mqtt-notification-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .mqtt-notification {
        min-width: auto;
        max-width: none;
    }

    @keyframes slideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}

/* MQTT连接状态指示器 */
.mqtt-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.mqtt-status-indicator:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mqtt-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.mqtt-status-indicator.disconnected .status-dot {
    background: #F44336;
    animation: none;
}

.mqtt-status-indicator.connecting .status-dot {
    background: #FF9800;
    animation: blink 1s infinite;
}

/* 声音控制按钮 */
.mqtt-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 8px;
    font-size: 14px;
}

.mqtt-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mqtt-sound-toggle.muted {
    opacity: 0.5;
}

.mqtt-sound-toggle.muted:hover {
    opacity: 0.7;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
