* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.search-container {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#nestingLevel {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#searchButton {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#searchButton:hover {
    background-color: #2980b9;
}

.refresh-button {
    padding: 10px 20px;
    background-color: #cc632e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.refresh-button:hover {
    background-color: #ae4027;
}

.results-container {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Tree view styles */
.tree-item {
    margin-bottom: 8px;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.tree-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.tree-header:hover {
    background-color: #f5f5f5;
}

.tree-header.clicked {
    background-color: #e8f4fc;
    transition: background-color 0.3s ease;
}

.tree-toggle {
    margin-right: 5px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background-color: #eee;
    border-radius: 3px;
}

.tree-content {
    padding-left: 25px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.tree-content.expanded {
    max-height: 1000px;
}

.tree-item-details {
    background-color: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    margin-top: 5px;
    border-left: 3px solid #3498db;
}

.tree-title {
    display: flex;
    align-items: center;
    flex: 1;
}

.badge {
    display: inline-flex;
    padding: 3px 8px;
    background-color: #3498db;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    text-align: center;
}

.title-text {
    flex: 1;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
}

.loading:after {
    content: ".";
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

.error {
    color: #e74c3c;
    padding: 15px;
    border-left: 4px solid #e74c3c;
    background-color: #fef5f5;
    border-radius: 4px;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

.result-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.result-type {
    padding: 5px 10px;
    background-color: #f2f2f2;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.result-type:hover {
    background-color: #e6e6e6;
    border-color: #ccc;
}

.result-type.active {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
    font-weight: bold;
}

.result-type.clicked {
    transform: scale(0.95);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 14px;
    margin-left: 10px;
    animation: fadeIn 0.3s ease;
}

.clear-filter {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-filter:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.item-properties {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.entity-id, .entity-type {
    padding: 4px 8px;
    margin-bottom: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
    font-size: 0.9em;
}

.entity-id {
    border-left: 3px solid #3498db;
}

.entity-type {
    border-left: 3px solid #9b59b6;
}

/* Highlight styles for matching entities */
.tree-item {
    transition: background-color 0.3s ease;
}

.tree-item.highlight {
    border-radius: 4px;
}

.tree-header {
    transition: background-color 0.3s ease;
}

.tree-header.highlight {
    border-radius: 4px;
}

/* Primary highlight color */
.highlight-primary {
    background-color: rgba(52, 152, 219, 0.2) !important; /* Using a nice blue color */
}

/* Secondary highlight color - much more subtle */
.highlight-secondary {
    background-color: rgba(52, 152, 219, 0.08) !important;
}

/* Duplicate indicator styles */
.duplicate-indicator {
    margin-left: 5px;
    color: #e67e22;
    cursor: help;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Entity link styles */
.entity-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.entity-link:hover {
    color: #3498db;
}

.entity-link .link-icon {
    font-size: 14px;
    margin-left: 6px;
    color: #3498db;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.entity-link:hover .link-icon {
    opacity: 1;
    transform: scale(1.1);
}

.entity-link-container {
    margin: 10px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.entity-link-url {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    margin-left: 5px;
    padding: 3px 8px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.entity-link-url:hover {
    text-decoration: underline;
    background-color: rgba(52, 152, 219, 0.2);
}

.entity-system-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background-color: #f0f5fa;
    border: 1px solid #c8d6e5;
    border-radius: 10px;
    font-size: 0.8em;
    color: #5f6368;
}

.entity-system-badge[title*="CRM"],
.entity-system-badge:contains("CRM"),
.entity-system-badge:has-text("CRM") {
    background-color: #e8f4fd;
    border-color: #b3dafe;
    color: #1876d2;
}

.results {
    transition: opacity 0.3s ease;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #searchInput, #searchButton {
        width: 100%;
    }
    
    .results-container {
        padding: 15px;
    }
    
    .item-properties {
        grid-template-columns: 1fr;
    }
    
    .result-types {
        gap: 5px;
    }
    
    .result-type {
        padding: 4px 8px;
        font-size: 12px;
    }
}

.load-more-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    padding: 12px 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-button:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.load-more-button:active {
    background-color: #d0d0d0;
    transform: translateY(1px);
}

.load-more-button:disabled {
    background-color: #f5f5f5;
    border-color: #eee;
    color: #999;
    cursor: not-allowed;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
} 

.filter-badge button {
    margin-left: 5px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.user-info-container {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-info-container button {
    margin-left: 10px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
} 

.logout-button {
    display: inline-block;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    margin-left: 10px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: #f0f0f0;
} 