.qr-card {
    transition: transform 0.2s;
    height: 100%;
}

.qr-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.qr-image-container {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.qr-image-container img {
    max-height: 160px;
    max-width: 100%;
    object-fit: contain;
}

.qr-details {
    padding: 15px;
}

.qr-name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-date {
    color: #6c757d;
    font-size: 0.9rem;
}

#loading {
    padding: 50px 0;
}

.modal-body img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.search-container {
    margin-bottom: 20px;
}

/* New styles for key details view */
#keyDetailsContainer .card {
    height: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#keyDetailsContainer .card-header {
    background-color: #0d6efd;
    color: white;
}

.list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.badge.bg-info {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

pre {
    white-space: pre-wrap;
    word-break: break-all;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.85rem;
}

/* Make the key list and details panel sticky on larger screens */
@media (min-width: 768px) {
    #keyDetailsContainer .card {
        position: sticky;
        top: 20px;
    }
}

/* Styles for nested data tree view */
.nested-item {
    border-left: 1px dashed #dee2e6;
    margin-bottom: 8px;
    position: relative;
}

.nested-item:last-child {
    border-left: none;
}

.nested-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 20px;
    height: 1px;
    background-color: #dee2e6;
}

.toggle-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: bold;
}

.nested-content {
    margin-top: 4px;
    margin-bottom: 8px;
    border-radius: 4px;
}

/* Highlight selected item in the list */
.list-group-item:hover {
    background-color: #f8f9fa;
}

/* Improve responsiveness on mobile */
@media (max-width: 767.98px) {
    #keyDetailsContainer {
        margin-top: 20px;
    }
}

/* Styles for clickable nodes */
.clickable-node {
    padding: 3px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.clickable-node:hover {
    background-color: rgba(13, 110, 253, 0.1);
    text-decoration: underline;
}

.hoverable-node {
    cursor: pointer;
}

/* Breadcrumb-like styling for navigation path */
.card-header h5 {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Back button styling */
.card-header .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Tree view styling */
.tree-root {
    margin-left: 0;
    padding-left: 0;
}

.tree-node {
    position: relative;
    margin-bottom: 8px;
    padding: 4px 0;
}

.tree-leaf-icon {
    color: #0d6efd;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.tree-toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-label {
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tree-label:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Add connecting lines between tree nodes */
.tree-node ul {
    position: relative;
    padding-left: 20px;
    border-left: 1px dashed #dee2e6;
    margin-left: 15px;
}

.tree-node ul li:before {
    content: '';
    position: absolute;
    left: -20px;
    top: 14px;
    width: 20px;
    height: 1px;
    background-color: #dee2e6;
}