/* ========================================
   左侧设备管理面板专用样式
   Left Panel Device Management Styles
   ======================================== */

/* ========================================
   1. 设备列表面板主容器
   ======================================== */

DeviceListPanel {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #1a252f, stop:1 #0f1419);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 8px;
}

/* ========================================
   2. 面板标题样式
   ======================================== */

DeviceListPanel QLabel[objectName="titleLabel"] {
    color: #4a90e2;
    font-size: 18px;
    font-weight: bold;
    background: transparent;
    border: none;
    padding: 8px 0px;
    margin-bottom: 4px;
}

DeviceListPanel QLabel[objectName="deviceCountLabel"] {
    color: #5ba0f2;
    font-size: 12px;
    font-weight: 600;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
    padding: 4px 12px;
    margin: 2px;
}

/* ========================================
   3. 操作按钮区域样式
   ======================================== */

/* 添加设备按钮 - 成功色系 */
DeviceListPanel QPushButton[objectName="addUAVButton"],
DeviceListPanel QPushButton[objectName="addDogButton"] {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #27ae60, stop:1 #229954);
    border: 2px solid #1e8449;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    padding: 8px 12px;
    min-height: 36px;
    min-width: 100px;
}

DeviceListPanel QPushButton[objectName="addUAVButton"]:hover,
DeviceListPanel QPushButton[objectName="addDogButton"]:hover {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #58d68d, stop:1 #27ae60);
    border: 2px solid #27ae60;
    /* 用边框效果替代transform */
    border-bottom: 3px solid #1e8449;
}

DeviceListPanel QPushButton[objectName="addUAVButton"]:pressed,
DeviceListPanel QPushButton[objectName="addDogButton"]:pressed {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #229954, stop:1 #1e8449);
    /* 用边框变化替代transform */
    border-bottom: 1px solid #1e8449;
}

/* 删除按钮 - 危险色系 */
DeviceListPanel QPushButton[objectName="deleteDeviceButton"] {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #e74c3c, stop:1 #c0392b);
    border: 2px solid #a93226;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    padding: 8px 12px;
    min-height: 36px;
    min-width: 80px;
}

DeviceListPanel QPushButton[objectName="deleteDeviceButton"]:hover {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #ec7063, stop:1 #e74c3c);
    border: 2px solid #e74c3c;
    /* 用边框效果替代transform */
    border-bottom: 3px solid #c0392b;
}

DeviceListPanel QPushButton[objectName="deleteDeviceButton"]:pressed {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #c0392b, stop:1 #a93226);
    /* 用边框变化替代transform */
    border-bottom: 1px solid #a93226;
}

DeviceListPanel QPushButton[objectName="deleteDeviceButton"]:disabled {
    background: #4a5568;
    border: 2px solid #2d3748;
    color: #95a5a6;
}

/* 刷新按钮 - 主色系 */
DeviceListPanel QPushButton[objectName="refreshButton"] {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #4a90e2, stop:1 #2c5282);
    border: 2px solid #1e3a5f;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    padding: 8px;
    min-height: 36px;
    min-width: 40px;
}

DeviceListPanel QPushButton[objectName="refreshButton"]:hover {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #5ba0f2, stop:1 #4a90e2);
    border: 2px solid #4a90e2;
    /* 用颜色变化替代旋转效果 */
    color: #ffffff;
}

DeviceListPanel QPushButton[objectName="refreshButton"]:pressed {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 #2c5282, stop:1 #1e3a5f);
    /* 用边框变化替代旋转效果 */
    border: 3px solid #1e3a5f;
}

/* ========================================
   4. 滚动区域样式
   ======================================== */

DeviceListPanel QScrollArea {
    background: transparent;
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 2px;
}

DeviceListPanel QScrollArea > QWidget > QWidget {
    background: transparent;
}

/* 滚动条样式 */
DeviceListPanel QScrollBar:vertical {
    background: rgba(45, 55, 72, 0.8);
    width: 10px;
    border-radius: 5px;
    margin: 0;
}

DeviceListPanel QScrollBar::handle:vertical {
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #4a90e2, stop:1 #5ba0f2);
    border-radius: 5px;
    min-height: 20px;
    margin: 1px;
}

DeviceListPanel QScrollBar::handle:vertical:hover {
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #5ba0f2, stop:1 #6bb6ff);
}

DeviceListPanel QScrollBar::add-line:vertical,
DeviceListPanel QScrollBar::sub-line:vertical {
    height: 0;
    background: none;
}

/* ========================================
   5. 设备卡片样式优化
   ======================================== */

DeviceCard {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(45, 65, 95, 0.95),
                stop:1 rgba(25, 40, 65, 0.95));
    border: 2px solid rgba(74, 144, 226, 0.4);
    border-radius: 10px;
    margin: 4px 2px;
    padding: 8px;
}

DeviceCard:hover {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(55, 75, 105, 0.95),
                stop:1 rgba(35, 50, 75, 0.95));
    border: 2px solid rgba(74, 144, 226, 0.7);
    /* 用边框加粗替代transform */
    border-width: 3px;
}

DeviceCard[selected="true"] {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(74, 144, 226, 0.3),
                stop:1 rgba(44, 82, 130, 0.3));
    border: 3px solid #4a90e2;
}

/* 设备卡片内的标签样式 */
DeviceCard QLabel[objectName="deviceNameLabel"] {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: bold;
    background: transparent;
    border: none;
    padding: 2px 0px;
}

DeviceCard QLabel[objectName="statusLabel"] {
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    margin: 2px 0px;
}

/* 在线状态 */
DeviceCard QLabel[objectName="statusLabel"][status="online"] {
    color: #ffffff;
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #27ae60, stop:1 #2ecc71);
}

/* 离线状态 */
DeviceCard QLabel[objectName="statusLabel"][status="offline"] {
    color: #ffffff;
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #e74c3c, stop:1 #c0392b);
}

/* 警告状态 */
DeviceCard QLabel[objectName="statusLabel"][status="warning"] {
    color: #2d3748;
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #f39c12, stop:1 #e67e22);
}

/* 维护状态 */
DeviceCard QLabel[objectName="statusLabel"][status="maintenance"] {
    color: #ffffff;
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
                stop:0 #9b59b6, stop:1 #8e44ad);
}

/* 设备信息标签 */
DeviceCard QLabel[objectName="locationLabel"],
DeviceCard QLabel[objectName="networkLabel"] {
    color: #a0aec0;
    font-size: 10px;
    background: transparent;
    border: none;
    padding: 1px 0px;
}

/* ========================================
   6. 设备卡片按钮样式
   ======================================== */

DeviceCard QPushButton {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(74, 144, 226, 0.4),
                stop:1 rgba(44, 82, 130, 0.4));
    color: #e2e8f0;
    border: 1px solid rgba(74, 144, 226, 0.6);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    min-height: 24px;
    margin: 1px;
}

DeviceCard QPushButton:hover {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(74, 144, 226, 0.7),
                stop:1 rgba(44, 82, 130, 0.7));
    border: 1px solid #4a90e2;
    color: #ffffff;
    /* 用边框加粗替代scale */
    border-width: 2px;
}

DeviceCard QPushButton:pressed {
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                stop:0 rgba(74, 144, 226, 0.9),
                stop:1 rgba(44, 82, 130, 0.9));
    /* 用颜色变化替代scale */
    border: 1px solid rgba(74, 144, 226, 0.5);
}

/* 特殊按钮样式 */
DeviceCard QPushButton[objectName="detailsButton"] {
    border-left: 3px solid #4a90e2;
}

DeviceCard QPushButton[objectName="controlButton"] {
    border-left: 3px solid #27ae60;
}

DeviceCard QPushButton[objectName="locationButton"] {
    border-left: 3px solid #f39c12;
}

/* ========================================
   7. 状态指示器样式
   ======================================== */

QLabel[objectName="statusIndicator"] {
    border-radius: 6px;
    min-width: 12px;
    max-width: 12px;
    min-height: 12px;
    max-height: 12px;
    margin: 2px;
}

QLabel[objectName="statusIndicator"][status="online"] {
    background: qradialgradient(cx:0.5, cy:0.5, radius:0.5,
                stop:0 #2ecc71, stop:0.7 #27ae60, stop:1 #1e8449);
    border: 1px solid #27ae60;
}

QLabel[objectName="statusIndicator"][status="offline"] {
    background: qradialgradient(cx:0.5, cy:0.5, radius:0.5,
                stop:0 #e74c3c, stop:0.7 #c0392b, stop:1 #a93226);
    border: 1px solid #c0392b;
}

QLabel[objectName="statusIndicator"][status="warning"] {
    background: qradialgradient(cx:0.5, cy:0.5, radius:0.5,
                stop:0 #f39c12, stop:0.7 #e67e22, stop:1 #d68910);
    border: 1px solid #e67e22;
}

QLabel[objectName="statusIndicator"][status="maintenance"] {
    background: qradialgradient(cx:0.5, cy:0.5, radius:0.5,
                stop:0 #9b59b6, stop:0.7 #8e44ad, stop:1 #7d3c98);
    border: 1px solid #8e44ad;
}

/* ========================================
   8. Qt原生视觉效果 (替代CSS3动画)
   ======================================== */

/* 注意：Qt不支持transition、transform、box-shadow等CSS3属性 */
/* 使用边框、颜色变化等Qt支持的属性实现视觉反馈 */

/* 移除不支持的transition属性 */
/* DeviceCard, DeviceCard QPushButton, DeviceListPanel QPushButton 的过渡效果 */
/* 将通过Qt的QPropertyAnimation在C++代码中实现 */

/* 悬停时的边框发光效果 (替代阴影) */
/* 这些样式已在上面的hover状态中定义，此处不重复 */

/* ========================================
   9. 响应式布局调整
   ======================================== */

/* 小屏幕适配 */
@media (max-width: 400px) {
    DeviceListPanel QPushButton {
        min-width: 80px;
        font-size: 11px;
        padding: 6px 8px;
    }
    
    DeviceCard {
        margin: 2px 1px;
        padding: 6px;
    }
    
    DeviceCard QLabel[objectName="deviceNameLabel"] {
        font-size: 12px;
    }
}

/* ========================================
   10. 特殊状态样式
   ======================================== */

/* 空列表提示 */
QLabel[objectName="emptyListLabel"] {
    color: #95a5a6;
    font-size: 14px;
    font-style: italic;
    text-align: center;
    background: transparent;
    border: 2px dashed #4a5568;
    border-radius: 8px;
    padding: 20px;
    margin: 10px;
}

/* 加载中状态 */
QLabel[objectName="loadingLabel"] {
    color: #4a90e2;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 10px;
}
