/* Global Styles */
body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-size: 1.5rem;
}

/* Category Styles */
.category-card {
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.category-card.dragging {
    opacity: 0.5;
}

.category-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.category-header:hover {
    background-color: #e9ecef;
}

.category-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.category-actions {
    display: flex;
    gap: 5px;
}

.category-body {
    padding: 10px;
    min-height: 60px;
}

/* Service Styles */
.service-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    cursor: move;
    transition: all 0.3s ease;
    user-select: none; /* Prevent text selection while dragging */
}

.service-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    background-color: #f8f9fa;
}

.service-item:active {
    cursor: grabbing;
}

.service-item.dragging {
    opacity: 0.5;
}

.service-item.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef;
}

.service-item.sortable-drag {
    opacity: 0.9;
    transform: rotate(2deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.service-icon-preview {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 5px;
    object-fit: cover;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.service-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.service-info {
    flex-grow: 1;
}

.service-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.service-details {
    font-size: 0.85rem;
    color: #6c757d;
}

.service-actions {
    display: flex;
    gap: 5px;
}

/* Drag and Drop Styles */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-drag {
    opacity: 0.5;
}

.drag-handle {
    cursor: grab;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.drag-handle:hover {
    color: #495057;
}

.drag-handle:active {
    cursor: grabbing;
    color: #007bff;
}

.drag-over {
    border: 2px dashed #007bff;
    background-color: #e7f3ff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Widget Configuration */
.widget-field {
    margin-bottom: 10px;
}

.widget-field label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Preview Frame */
#previewFrame {
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}

.status-online {
    background-color: #28a745;
}

.status-offline {
    background-color: #dc3545;
}

.status-unknown {
    background-color: #ffc107;
}

/* Buttons */
.btn-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* Modal Styles */
.modal-header {
    background-color: #f8f9fa;
}

/* Custom API Mappings */
.mapping-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

/* Bookmarks Styles */
.bookmark-group-card {
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.bookmark-group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.bookmark-group-header:hover {
    background-color: #e9ecef;
}

.group-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.group-actions {
    display: flex;
    gap: 5px;
}

.bookmark-group-body {
    padding: 10px;
    min-height: 40px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.bookmark-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.bookmark-drag-handle {
    cursor: move;
    color: #6c757d;
    margin-right: 10px;
}

.bookmark-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}

.bookmark-details {
    flex: 1;
    min-width: 0;
}

.bookmark-name {
    font-weight: 500;
    text-decoration: none;
    color: #495057;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-name:hover {
    color: #007bff;
}

.bookmark-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bookmark-item:hover .bookmark-actions {
    opacity: 1;
}

.mapping-item .btn-remove {
    float: right;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }

    .category-header {
        font-size: 0.9rem;
    }

    .service-item {
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

/* Validation Feedback */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}