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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Toolbar */
.toolbar {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
}

.date-controls.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.date-display {
    display: flex;
    flex-direction: column;
    text-align: center;
    min-width: 110px;
}

.date-label {
    font-size: 12px;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#currentDateDisplay {
    font-size: 16px;
    font-weight: 600;
    color: #ecf0f1;
}

.date-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ecf0f1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.date-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.3);
}

.date-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#searchInput {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    color: #333;
}

#searchInput:focus {
    outline: 2px solid #3498db;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 5px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 1001;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    color: #2c3e50;
    background-color: white;
}

.search-username {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    display: inline-block;
    margin-right: 8px;
}

.search-userid {
    color: #7f8c8d;
    font-size: 13px;
    font-weight: normal;
}

.search-result-item:hover {
    background-color: #e8f4f8;
}

.search-result-item:hover .search-username {
    color: #3498db;
}

.search-result-item:hover .search-userid {
    color: #5dade2;
}

.search-result-item:last-child {
    border-bottom: none;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Graph Container */
.graph-container {
    flex: 1;
    background-color: #ecf0f1;
    position: relative;
    min-height: 400px;
    width: 100%;
}

.graph-loading,
.graph-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 18px 24px;
    border-radius: 8px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    max-width: 260px;
}

.graph-loading {
    background-color: rgba(44, 62, 80, 0.85);
}

.graph-error {
    background-color: rgba(192, 57, 43, 0.9);
}

/* Sidebars */
.sidebar {
    width: 350px;
    background-color: white;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar.hidden {
    transform: translateX(100%);
}

.left-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 15px 20px;
    background-color: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Node Details */
.node-detail-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.node-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.node-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.node-detail-value {
    color: #2c3e50;
    font-size: 14px;
}

.node-detail-list {
    list-style: none;
    margin-top: 5px;
}

.node-detail-list li {
    padding: 5px 0;
    color: #34495e;
}

/* Leaderboard */
.leaderboard-item {
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.leaderboard-item:hover {
    background-color: #e9ecef;
}

.leaderboard-rank {
    font-weight: 700;
    color: #3498db;
    font-size: 18px;
    display: inline-block;
    width: 30px;
}

.leaderboard-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.leaderboard-stats {
    font-size: 12px;
    color: #7f8c8d;
}

/* Community Legend */
.community-legend {
    margin-top: 20px;
}

.community-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 3px;
}

.community-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.community-info {
    flex: 1;
}

.community-size {
    font-size: 12px;
    color: #7f8c8d;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form label {
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.modal-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-form input:focus {
    outline: 2px solid #3498db;
    border-color: #3498db;
}

/* Path Display */
.path-display {
    background-color: #e8f5e9;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.path-nodes {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.path-node {
    padding: 8px 12px;
    background-color: #4caf50;
    color: white;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.path-arrow {
    color: #4caf50;
    font-weight: bold;
}

/* Recommendations */
.recommendation-item {
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.recommendation-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.recommendation-score {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.recommendation-reason {
    font-size: 12px;
    color: #34495e;
    font-style: italic;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

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

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

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

