:root {
    --primary-color: #0073aa;
    --primary-hover: #005a87;
    --secondary-color: #23282d;
    --accent-color: #00a0d2;
    --success-color: #46b450;
    --warning-color: #ffb900;
    --error-color: #dc3232;
    --border-color: #ddd;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f9f9f9;
    --bg-white: #fff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --radius: 8px;
}

.kg-explorer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.kg-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.kg-main-heading {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 600;
    color: white;
}

.kg-subtitle {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.95;
}

.kg-help-section {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.kg-help-section h3 {
    margin-top: 0;
    color: var(--secondary-color);
    font-size: 1.3em;
}

.kg-instructions-list {
    margin: 15px 0;
    padding-left: 20px;
}

.kg-instructions-list li {
    margin: 10px 0;
    line-height: 1.6;
}

.kg-instructions-list strong {
    color: var(--primary-color);
}

.kg-instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.instruction-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.instruction-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

#kg-search-container {
    margin-bottom: 30px;
}

#search-bar {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

#kg-search {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#kg-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.kg-button-primary,
#kg-search-submit {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kg-button-primary:hover,
#kg-search-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

#kg-results-grid {
    display: block;
    margin-top: 30px;
}

.kg-result-card,
.kg-entity-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.kg-result-card:hover,
.kg-entity-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.kg-entity-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kg-entity-image img,
.kg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-entity-content {
    padding: 20px;
}

.kg-entity-title {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: var(--secondary-color);
    line-height: 1.3;
}

.kg-entity-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.kg-entity-title a:hover {
    color: var(--primary-color);
}

.kg-entity-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 12px;
}

.kg-entity-description {
    color: var(--text-light);
    line-height: 1.6;
    margin: 15px 0;
}

.kg-entity-meta {
    margin: 15px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
}

.kg-meta-item {
    margin: 8px 0;
    font-size: 0.95em;
}

.kg-meta-item strong {
    color: var(--secondary-color);
}

.kg-confidence-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--success-color);
    color: white;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    margin: 10px 0;
}

.kg-entity-detailed {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.kg-entity-detailed h4 {
    margin: 0 0 10px 0;
    color: var(--secondary-color);
}

.kg-entity-links,
.kg-entity-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.kg-link,
.kg-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-light);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s, color 0.3s;
    font-size: 0.95em;
    font-weight: 500;
}

.kg-link:hover,
.kg-button:hover {
    background: var(--primary-color);
    color: white;
}

.kg-link-primary {
    background: var(--primary-color);
    color: white;
}

.kg-link-primary:hover {
    background: var(--primary-hover);
}

.kg-button-secondary {
    background: var(--bg-light);
    color: var(--text-color);
}

.kg-button-secondary:hover {
    background: var(--secondary-color);
    color: white;
}

.kg-entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.kg-grid-item {
    height: 100%;
}

.kg-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin: 30px 0;
}

.kg-empty-state p {
    margin: 10px 0;
    font-size: 1.1em;
    color: var(--text-light);
}

.kg-empty-state a {
    color: var(--primary-color);
    font-weight: 600;
}

.kg-error {
    padding: 15px;
    background: #fee;
    color: var(--error-color);
    border-radius: 6px;
    border-left: 4px solid var(--error-color);
}

.kg-login-message {
    padding: 20px;
    background: var(--bg-light);
    color: var(--text-color);
    border-radius: 6px;
    text-align: center;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .kg-main-heading {
        font-size: 1.8em;
    }

    .kg-subtitle {
        font-size: 1em;
    }

    #search-bar {
        flex-direction: column;
    }

    #kg-results-grid {
        grid-template-columns: 1fr;
    }

    .kg-entity-grid {
        grid-template-columns: 1fr;
    }

    .kg-instructions {
        grid-template-columns: 1fr;
    }
}
/* -------------------------------------- */
/* ORIGINAL STYLES (KEEP ALL OF THESE)    */
/* -------------------------------------- */

:root {
    --primary-color: #0073aa;
    --primary-hover: #005a87;
    --secondary-color: #23282d;
    --accent-color: #00a0d2;
    --success-color: #46b450;
    --warning-color: #ffb900;
    --error-color: #dc3232;
    --border-color: #ddd;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f9f9f9;
    --bg-white: #fff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --radius: 8px;
}

.kg-explorer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ... (rest of your original stylesheet unchanged) ... */

/* KEEP ALL ORIGINAL CODE HERE — do not change any of it */

/* -------------------------------------- */
/* NEW SEARCH UI STYLES (APPENDED BELOW)  */
/* -------------------------------------- */

/* --- Page Layout --- */
#kg-search-page {
    max-width: 900px;
    margin: 30px auto;
}

.kg-heading {
    margin-bottom: 20px;
}

/* --- Instructions Box --- */
.kg-instructions-box {
    background: #f3f6ff;
    border-left: 4px solid #3a6dff;
    padding: 20px 25px;
    margin-bottom: 25px;
    border-radius: 6px;
    font-size: 15px;
}

.kg-instructions-box h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.kg-instructions-box p {
    margin: 8px 0;
    line-height: 1.6;
}

.kg-instructions-box a {
    color: #3a6dff;
    text-decoration: none;
    font-weight: 600;
}

.kg-instructions-box a:hover {
    text-decoration: underline;
}

/* --- Search Bar Override --- */
#search-bar {
    display: flex;
    gap: 10px;
}

#kg-search {
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

#kg-search-submit {
    padding: 10px 20px;
    background: #3a6dff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

#kg-search-submit:hover {
    background: #304fcc;
}

/* --- Results Grid --- */
#kg-results-grid {
    margin-top: 25px;
    display: block;
}

/* --- Result Cards --- */
.kg-result-card {
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.kg-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.kg-desc {
    color: #555;
    margin-bottom: 10px;
}

/* --- Buttons --- */
.kg-card-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: flex-start;
}

.kg-btn {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.kg-view-btn {
    background: #3a6dff;
    color: white;
}

.kg-view-btn:hover {
    background: #2c50cc;
}

/* --- Feedback Text --- */
.kg-loading,
.kg-no-results,
.kg-error {
    padding: 20px;
    text-align: center;
    background: #fafafa;
    border-radius: 6px;
}
