/* ==============================================================================
   AMETIST IOT PLATFORM — boards.css
   My Devices Grid Overview (/devices/boards/)
   ============================================================================== */

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    padding: 16px 0;
}

.device-item {
    background: rgba(14, 10, 36, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.device-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #38bdf8);
}

.device-item:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(124, 58, 237, 0.25);
}

.device-item.active {
    border-color: #a855f7;
    background: rgba(22, 16, 52, 0.9);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.35);
}

.device-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.device-icon,
.device-grid .device-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    line-height: 1;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.25);
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.4));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.device-item:hover .device-icon {
    transform: scale(1.08);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.4);
}

.device-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.device-data {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 12px;
    min-height: 26px;
}

.device-status {
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
}

.status-online {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.status-offline {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Power Button */
.power-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.25s ease;
    z-index: 2;
}

.power-btn:hover {
    transform: scale(1.12);
}

.power-btn.on {
    background: #34d399;
    border-color: #34d399;
    color: #050514;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
}

.power-btn.off {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.power-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Fade update animation */
.fade-update {
    animation: telemetryPulse 0.6s ease;
}

@keyframes telemetryPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.4); color: #c084fc; }
    100% { transform: scale(1); filter: brightness(1); }
}

@media (max-width: 480px) {
    .device-grid {
        grid-template-columns: 1fr;
    }
}
