.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.header h1 {
    font-size: 2.5em;
    color: #007bff;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    color: #666;
}

.controls {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.input-field {
    flex: 1;
    min-width: 200px;
}

.input-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.input-field input[type="text"],
.input-field input[type="password"],
.input-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.input-field input[type="text"]:focus,
.input-field input[type="password"]:focus,
.input-field select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.view-toggle {
    text-align: center;
    margin-bottom: 20px;
}

.toggle-buttons {
    display: inline-flex;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #007bff;
}

.toggle-btn {
    padding: 10px 15px;
    border: none;
    background-color: #e9ecef;
    color: #007bff;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background-color: #dee2e6;
}

.toggle-btn.active {
    background-color: #007bff;
    color: white;
}

.content {
    min-height: 400px;
    position: relative;
}

.loading, .error, .success {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
}

.loading {
    background-color: #e0f7fa;
    color: #007bff;
}

.error {
    background-color: #ffe0e0;
    color: #dc3545;
}

.success {
    background-color: #e6ffed;
    color: #28a745;
}

.spinner {
    border: 4px solid rgba(0, 123, 255, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Graph View */
#graph-container {
    width: 100%;
    height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

/* Table View */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f1f1f1;
    border-radius: 8px;
}

.filter-input {
    flex: 1;
    min-width: 150px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.table-container {
    overflow-x: auto;
    max-height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

#resultsTable th, #resultsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

#resultsTable th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
}

#resultsTable tbody tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

.type-badge {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.score-bar {
    width: 100px;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background-color: #28a745;
    border-radius: 4px;
}

.entity-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.entity-link:hover {
    text-decoration: underline;
}

/* Stats View */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #e9f5ff;
    border: 1px solid #b3d9ff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1em;
    color: #555;
}

.chart-container {
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Side Panel */
.side-panel {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden by default */
    width: 380px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.side-panel.open {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

#panel-content h2 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 15px;
}

#panel-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

#panel-content p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #444;
}

.wikipedia-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.wikipedia-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.wikipedia-section p {
    font-size: 0.95em;
    line-height: 1.5;
    color: #555;
}

.loading-wiki {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 10px;
}

/* Keyword Cloud Styles */
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Space between keywords */
    margin-top: 15px;
    justify-content: center; /* Center the keywords */
}

.keyword-cloud span {
    background-color: #e0f7fa; /* Light blue background */
    color: #007bff; /* Blue text */
    padding: 6px 12px;
    border-radius: 20px; /* Pill shape */
    font-weight: bold;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap; /* Prevent words from breaking */
    border: 1px solid #b2ebf2; /* Light border */
}

.keyword-cloud span:hover {
    background-color: #007bff; /* Darker blue on hover */
    color: white;
    /* cursor: help; */ /* Removed as per user request */
}