/* ========== DEVICES PAGE STYLES ========== */
/* Page-specific styles only - common styles in app-theme.css */

/* ========== DEVICE CARD ========== */
.device-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    color: white;
}

.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.03);
}

.devices-loading-card {
    min-height: 320px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.devices-loading-card:hover {
    transform: none;
}

.devices-empty-card {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.devices-empty-card:hover {
    transform: none;
}

.devices-empty-panel {
    width: min(100%, 520px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.9rem;
    padding: clamp(1.35rem, 4vw, 2rem);
    border: 1px solid rgba(0, 188, 212, 0.28);
    border-radius: 8px;
    background: rgba(20, 24, 27, 0.84);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.devices-empty-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 188, 212, 0.14);
    border: 1px solid rgba(0, 188, 212, 0.34);
    color: #00bcd4;
    font-size: 2.25rem;
}

.devices-empty-panel h3 {
    margin: 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
}

.devices-empty-panel p {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.98rem;
    line-height: 1.5;
}

.devices-empty-action {
    margin-top: 0.25rem;
}

.devices-empty-action .e-btn-content,
.devices-empty-action .mud-button-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.device-grid-item .e-card {
    height: 100%;
    min-height: fit-content;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    color: white;
    box-sizing: border-box;
}

.device-grid-item .e-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.03);
}

.device-grid-item .e-card-header,
.device-grid-item .e-card-content,
.device-grid-item .e-card-footer {
    overflow: hidden;
    word-wrap: break-word;
}

/* ========== DEVICE STATUS BADGES ========== */
.device-status-online {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.device-status-offline {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-success {
    color: var(--color-success) !important;
}

.badge-danger {
    color: var(--color-danger) !important;
}

/* ========== STATISTICS - Device page specific ========== */
.stat-total {
    color: white !important;
}

.stat-online {
    color: var(--color-success) !important;
}

.stat-offline {
    color: var(--color-danger) !important;
}

/* ========== PROFESSIONAL FILTER - Device page specific ========== */
.professional-filter {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    color: white;
    padding: 0.9rem;
    margin-bottom: 0.8rem;
}

/* ========== DEVICE STATS OVERVIEW ========== */
.devices-page .stats-overview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    color: white;
    padding: 0.85rem;
}

.devices-page .stats-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.devices-page .stat-item {
    width: 125px;
    max-width: 125px;
    min-width: 0;
}

/* ========== CARD SECTIONS ========== */
.device-card-header {
    background: rgba(0, 188, 212, 0.05);
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
    padding: 10px;
    border-radius: 12px 12px 0 0;
}

.device-card-body {
    padding: 10px;
}

.device-card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(0, 188, 212, 0.1);
    padding: 10px;
    border-radius: 0 0 12px 12px;
}

.device-info-item {
    background: rgba(0, 188, 212, 0.03);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.device-info-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.device-info-value {
    color: white;
    font-weight: 500;
}

/* ========== UI ELEMENTS ========== */
.professional-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-button {
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: translateY(-1px);
}

.editable-field {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 0.25rem;
}

.editable-field:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

/* ========== MODAL STYLES ========== */
.modal-header-gradient {
    background: rgba(0, 188, 212, 0.1);
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
}

.danger-modal {
    border: 2px solid rgba(244, 67, 54, 0.5);
}

.danger-button {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.danger-button:hover {
    background: rgba(244, 67, 54, 0.25);
}

/* ========== DELETE MODAL ========== */
.delete-modal .e-dlg-header-content {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0;
}

.delete-modal-header {
    padding: 1.25rem 1.5rem;
}

.delete-icon-container {
    width: 48px;
    height: 48px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-icon-container i {
    font-size: 24px;
    color: #ef4444;
}

/* ========== DEVICE INFO CARD ========== */
.device-info-card {
    background: rgba(0, 188, 212, 0.05);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.device-info-header {
    background: rgba(0, 188, 212, 0.08);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-info-body {
    padding: 1rem;
}

.device-info-card .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-info-card .info-item label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.device-info-card .info-item span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.device-info-card .info-item .device-id {
    color: #00bcd4;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* ========== WARNING CARD ========== */
.warning-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.warning-header {
    background: rgba(239, 68, 68, 0.12);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warning-body {
    padding: 1rem;
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warning-list li {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-list li i {
    color: #ef4444;
    width: 20px;
    text-align: center;
}

/* ========== REASON INPUT ========== */
.reason-input-container label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.reason-input-container label i {
    color: #ef4444;
}

.required-indicator {
    color: #ef4444;
    font-weight: bold;
    margin-left: 2px;
}

.reason-input-container .e-input-group,
.reason-input-container .e-input-group textarea {
    background: rgba(0, 188, 212, 0.05) !important;
    border-color: rgba(0, 188, 212, 0.2) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 8px;
    min-height: 100px;
}

.reason-input-container .e-input-group:focus-within,
.reason-input-container .e-input-group:focus-within textarea {
    border-color: rgba(0, 188, 212, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1) !important;
}

.reason-hint {
    display: block;
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-style: italic;
}

/* ========== DEVICE GRID ========== */
.device-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 0;
}

.device-grid-item {
    flex: 0 1 380px;
    min-width: 360px;
    max-width: 420px;
}

.device-grid-item .e-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== CARD HEADER LAYOUT ========== */
.device-card-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.device-card-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.device-card-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-card-device-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    font-weight: 600;
}

.device-card-device-icon {
    flex: 0 0 auto;
}

.device-card-device-name .editable-name-swap {
    min-width: 0;
    max-width: 100%;
}

.device-firmware-version {
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 3px;
}

/* ========== GROUP BADGES ========== */
.device-group-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.device-group-badge.group-prod {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.device-group-badge.group-prod:hover {
    background: rgba(76, 175, 80, 0.25);
}

.device-group-badge.group-internal {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.device-group-badge.group-internal:hover {
    background: rgba(33, 150, 243, 0.25);
}

.device-group-badge.group-alpha {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.device-group-badge.group-alpha:hover {
    background: rgba(244, 67, 54, 0.25);
}

.device-group-badge.group-beta {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.device-group-badge.group-beta:hover {
    background: rgba(255, 193, 7, 0.25);
}

.device-group-badge.group-unknown {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* ========== UPDATE BUTTON ========== */
.device-update-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.device-update-btn.update-btn-unknown {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
}

.device-update-btn.update-btn-unknown:hover {
    background: rgba(158, 158, 158, 0.25);
}

.device-update-btn.update-btn-current {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.device-update-btn.update-btn-current:hover {
    background: rgba(76, 175, 80, 0.25);
}

.device-update-btn.update-btn-available {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    animation: pulse-update 2s infinite;
}

.device-update-btn.update-btn-available:hover {
    background: rgba(0, 188, 212, 0.35);
}

.device-update-btn.update-btn-offline {
    background: rgba(244, 67, 54, 0.1);
    color: rgba(244, 67, 54, 0.4);
    cursor: not-allowed;
}

@keyframes pulse-update {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(0, 188, 212, 0);
    }
}

/* ========== FIRMWARE MODAL ========== */
.firmware-modal-header {
    display: flex;
    align-items: center;
    color: #00bcd4;
    font-weight: 600;
}

.firmware-update-content {
    padding: 1rem;
}

.device-info-summary {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.device-info-summary .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.device-info-summary .info-row:last-child {
    border-bottom: none;
}

.device-info-summary .info-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.device-info-summary .info-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.device-info-summary .available-version {
    color: #00bcd4;
    font-family: monospace;
}

.firmware-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.firmware-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    color: #f44336;
}

.firmware-uptodate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    color: #4caf50;
}

.firmware-available {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 6px;
    color: #00bcd4;
}

.firmware-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* ========== GROUP MODAL ========== */
.device-group-modal-header {
    display: flex;
    align-items: center;
    color: #00bcd4;
    font-weight: 600;
}

.device-group-modal-content {
    padding: 1rem;
}

.group-selection {
    margin-top: 1rem;
}

.selection-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.group-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.group-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.group-option.selected {
    border-width: 2px;
}

.group-option.group-prod {
    background: rgba(76, 175, 80, 0.08);
}

.group-option.group-prod:hover,
.group-option.group-prod.selected {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
}

.group-option.group-prod .group-option-radio,
.group-option.group-prod .group-option-label {
    color: #4caf50;
}

.group-option.group-internal {
    background: rgba(33, 150, 243, 0.08);
}

.group-option.group-internal:hover,
.group-option.group-internal.selected {
    background: rgba(33, 150, 243, 0.15);
    border-color: #2196f3;
}

.group-option.group-internal .group-option-radio,
.group-option.group-internal .group-option-label {
    color: #2196f3;
}

.group-option.group-alpha {
    background: rgba(244, 67, 54, 0.08);
}

.group-option.group-alpha:hover,
.group-option.group-alpha.selected {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
}

.group-option.group-alpha .group-option-radio,
.group-option.group-alpha .group-option-label {
    color: #f44336;
}

.group-option.group-beta {
    background: rgba(255, 193, 7, 0.08);
}

.group-option.group-beta:hover,
.group-option.group-beta.selected {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
}

.group-option.group-beta .group-option-radio,
.group-option.group-beta .group-option-label {
    color: #ffc107;
}

.group-option-radio {
    font-size: 1.1rem;
}

.group-option-label {
    font-weight: 500;
    font-size: 0.95rem;
}

.device-group-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* ========== RESPONSIVE - Large Desktop ========== */
@media (min-width: 1600px) {
    .device-grid-item {
        flex: 0 1 400px;
        min-width: 380px;
        max-width: 440px;
    }
}

/* ========== RESPONSIVE - Desktop ========== */
@media (max-width: 1599px) and (min-width: 1200px) {
    .device-grid-item {
        flex: 0 1 360px;
        min-width: 340px;
        max-width: 400px;
    }
}

/* ========== RESPONSIVE - Small Desktop ========== */
@media (max-width: 1199px) and (min-width: 992px) {
    .device-grid-item {
        flex: 0 1 340px;
        min-width: 320px;
        max-width: 380px;
    }
}

/* ========== RESPONSIVE - Tablet ========== */
@media (max-width: 991px) and (min-width: 576px) {
    .devices-page .stats-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: space-between !important;
    }

    .devices-page .stat-item {
        flex: 1 1 0 !important;
        width: 0 !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .device-grid {
        gap: 1rem;
    }

    .device-grid-item {
        flex: 0 1 320px;
        min-width: 300px;
        max-width: 360px;
    }
}

/* ========== RESPONSIVE - Very Small ========== */
@media (max-width: 400px) {
    .devices-page .stat-icon {
        font-size: 1rem;
        width: 1.8rem;
        height: 1.8rem;
    }

    .devices-page .stat-value {
        font-size: 1rem;
    }

    .devices-page .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0.2px;
    }

    .devices-page .stat-item {
        padding: 0.25rem 0.3rem;
        gap: 0.25rem;
        width: auto;
        flex: 1;
    }

    .devices-page .stats-container {
        gap: 0.5rem;
    }
}

/* ========== RESPONSIVE - Mobile ========== */
@media (max-width: 575px) {
    .devices-page.lbsa-container-fluid {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }

    .devices-page .stats-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 0.35rem;
        justify-content: space-between !important;
    }

    .devices-page .stat-item {
        flex: 1 1 0 !important;
        width: 0 !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .devices-page .stats-overview,
    .professional-filter {
        margin-left: 0;
        margin-right: 0;
    }

    .devices-empty-card {
        min-height: 300px;
        padding: 1rem;
    }

    .devices-empty-icon {
        width: 64px;
        height: 64px;
        font-size: 1.9rem;
    }

    .device-grid {
        gap: 1rem;
        margin-top: 1rem;
        padding: 0;
    }

    .device-grid-item {
        flex: 1 1 100%;
        min-width: 280px;
        max-width: 100%;
    }

    .professional-filter .filter-row {
        flex-direction: column;
    }

    .professional-filter .filter-group {
        min-width: 100%;
    }

    .device-card-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .devices-page .stat-icon {
        font-size: 1.2rem;
        width: 2rem;
        height: 2rem;
    }

    .devices-page .stat-value {
        font-size: 1.2rem;
    }

    .devices-page .stat-label {
        font-size: 0.6rem;
    }

    .devices-page .stat-item {
        padding: 0.3rem 0.4rem;
        gap: 0.3rem;
        width: 0 !important;
        max-width: none !important;
        flex: 1 1 0 !important;
    }

    .devices-page .stats-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
    }

    .action-button {
        width: 100%;
    }

    .device-grid-item .e-card {
        margin-bottom: 0;
    }

    .device-info-item {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }
}

/* ========== RESPONSIVE - Small Mobile ========== */
@media (max-width: 480px) {
    .professional-filter {
        margin: 0.18rem;
        padding: 1rem 0.35rem;
        margin-bottom: 0.5rem;
    }

    .devices-page .stats-overview {
        margin: 0.18rem;
        padding: 1rem 0.35rem;
    }

    .device-grid {
        gap: 0.75rem;
    }
}
