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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a202c 25%, #2d3748 50%, #4a5568 75%, #718096 100%);
    color: #e2e8f0;
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.98) 0%, rgba(26, 32, 44, 0.98) 50%, rgba(49, 130, 206, 0.1) 100%);
    backdrop-filter: blur(20px);
    padding: 2.5rem 0;
    border-bottom: 3px solid #3182ce;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(49, 130, 206, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(49, 130, 206, 0.1) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.header.collapsed {
    padding: 0.5rem 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.header.collapsed .collapse-header-btn {
    display: none;
}

.expand-header-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: #ffffff;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.expand-header-btn.visible {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.expand-header-btn:hover {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    transform: scale(1.1);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 3;
}



.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3182ce 0%, #63b3ed 25%, #90cdf4 50%, #3182ce 75%, #2c5282 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #3182ce 50%, transparent 100%);
    border-radius: 2px;
}

.subtitle {
    color: #e2e8f0;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    letter-spacing: 0.02em;
}

/* Hero Features */
.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
}

.hero-feature i {
    color: #3182ce;
    font-size: 1rem;
}

/* CTA Button */
.cta-btn {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.cta-btn:hover {
    background: linear-gradient(135deg, #2f855a, #276749);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.cta-btn.primary {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.cta-btn.primary:hover {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

/* Header Controls */
.header-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.game-mode-btn, .tutorial-btn, .achievements-btn, .collapse-header-btn {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
    font-weight: 600;
}

.game-mode-btn:hover, .tutorial-btn:hover, .achievements-btn:hover, .collapse-header-btn:hover {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

.game-mode-btn.active {
    background: linear-gradient(135deg, #38a169, #2f855a);
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.4);
}

/* Session Tracker */
.session-tracker {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
    font-weight: 600;
    max-width: fit-content;
    width: fit-content;
}

.session-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.session-count {
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    min-width: 2rem;
    text-align: center;
}

/* Game Stats */
.game-stats {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    padding: 1rem;
    border-bottom: 2px solid #3182ce;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: #63b3ed;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Filters Panel */
.filters-panel {
    background: #2d3748;
    padding: 1rem;
    border-bottom: 1px solid #4a5568;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: #a0aec0;
    white-space: nowrap;
}

.filter-group select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #4a5568;
    font-size: 0.8rem;
    background: #4a5568;
    color: #e2e8f0;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: #e2e8f0;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}



/* List Container */
.list-container {
    background: #2d3748;
    border: 1px solid #4a5568;
    margin: 1rem 0;
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #4a5568;
}

.list-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

.list-item {
    padding: 0.75rem;
    border-bottom: 1px solid #4a5568;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background: #4a5568;
}

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

.list-item h4 {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.list-item p {
    color: #a0aec0;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Achievements Panel */
.achievements-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    z-index: 1000;
}

.achievements-panel.visible {
    display: block;
}

.achievements-list {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #4a5568;
    transition: background-color 0.2s ease;
}

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

.achievement-item.unlocked {
    background: #4a5568;
}

.achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.achievement-item.unlocked .achievement-icon {
    background: #4CAF50;
    color: #ffffff;
}

.achievement-item.locked .achievement-icon {
    background: #4a5568;
    color: #718096;
}

.achievement-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.achievement-info p {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.tutorial-overlay.visible {
    display: flex;
}

.tutorial-content {
    background: #2d3748;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tutorial-step h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.tutorial-step p {
    margin-bottom: 1.5rem;
    color: #a0aec0;
    line-height: 1.5;
}

.tutorial-next {
    background: #3182ce;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tutorial-next:hover {
    background: #2c5282;
}

/* Welcome Features */
.welcome-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
}

.feature i {
    font-size: 1.5rem;
    color: #63b3ed;
}

.feature span {
    font-size: 0.8rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.08) 0%, rgba(99, 179, 237, 0.04) 100%);
    padding: 3rem 0;
    border-bottom: 1px solid rgba(49, 130, 206, 0.15);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content h2 {
    color: #e2e8f0;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    color: #a0aec0;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.featured-explorations h3 {
    color: #e2e8f0;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.exploration-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.exploration-card {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.9) 0%, rgba(45, 55, 72, 0.9) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(49, 130, 206, 0.3);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.exploration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.1), transparent);
    transition: left 0.5s ease;
}

.exploration-card:hover::before {
    left: 100%;
}

.exploration-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(49, 130, 206, 0.5);
}

.exploration-card.featured {
    border-color: rgba(56, 161, 105, 0.5);
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(45, 55, 72, 0.95) 100%);
}

.exploration-card.featured::before {
    background: linear-gradient(90deg, transparent, rgba(56, 161, 105, 0.1), transparent);
}

.card-icon {
    margin-bottom: 1rem;
}

.card-icon i {
    font-size: 2.5rem;
    color: #3182ce;
}

.exploration-card.featured .card-icon i {
    color: #38a169;
}

.exploration-card h4 {
    color: #e2e8f0;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.exploration-card p {
    color: #a0aec0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.explore-btn {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.explore-btn:hover {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

/* Search Section */
.search-section {
    padding: 4rem 1rem;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.95) 0%, rgba(26, 32, 44, 0.95) 50%, rgba(45, 55, 72, 0.95) 100%);
    position: relative;
    /* overflow: visible; */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid rgba(49, 130, 206, 0.3);
    z-index: 99999;
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 99999;
    /* overflow: visible; */
}

.search-box {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    padding: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Add a subtle indicator for popular searches */
.search-box::after {
    content: '💡';
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
    pointer-events: none;
    animation: searchHint 2s ease-in-out infinite;
}

@keyframes searchHint {
    0%, 100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
}

/* Hide the hint when search box is focused */
.search-box:focus-within::after {
    opacity: 0;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    background: transparent;
    color: #2d3748;
    font-weight: 500;
}

#searchInput::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.search-btn {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

.search-suggestions {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%);
    border: 3px solid #3182ce;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 32px rgba(49, 130, 206, 0.25), 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100000;
    max-width: 700px;
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Add extra margin below the sticky suggestions to separate from progress section */
.search-suggestions + .progress-section {
    margin-top: 2.5rem;
}

.search-suggestions.hidden {
    display: none !important;
}

/* Animation for popular searches to draw attention */
@keyframes popularSearchPulse {
    0%, 100% { 
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: #3182ce;
    }
    50% { 
        box-shadow: 0 8px 32px rgba(49, 130, 206, 0.3), 0 0 20px rgba(49, 130, 206, 0.2);
        border-color: #4299e1;
    }
}

.search-suggestions:not(.hidden) {
    animation: popularSearchPulse 3s ease-in-out 1;
    /* Ensure visibility */
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

.suggestion-label {
    padding: 16px 20px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #3182ce;
    border-bottom: 2px solid rgba(49, 130, 206, 0.3);
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.15) 0%, rgba(49, 130, 206, 0.05) 100%);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-label::before {
    content: '🔥';
    font-size: 1.2rem;
}

.suggestion-btn {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 70px;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
    position: relative;
    overflow: hidden;
}

.suggestion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(49, 130, 206, 0.1) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.suggestion-btn:hover::before {
    left: 100%;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.25) 0%, rgba(49, 130, 206, 0.15) 100%);
    transform: translateX(6px) scale(1.02);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2);
    border-left: 3px solid #3182ce;
}

.suggestion-btn:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.suggestion-btn.search-all {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.3) 0%, rgba(49, 130, 206, 0.2) 100%);
    border-top: 2px solid #3182ce;
    font-weight: 600;
    color: #ffffff;
    min-height: 50px;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 8px;
}

.suggestion-btn.search-all:hover {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.4) 0%, rgba(49, 130, 206, 0.3) 100%);
}

.suggestion-title {
    font-weight: 800 !important;
    color: #fff !important;
    font-size: 1.1rem;
    line-height: 1.3;
    word-wrap: break-word;
    text-shadow: 0 2px 8px rgba(49,130,206,0.25), 0 1px 2px rgba(0,0,0,0.4);
    letter-spacing: 0.02em;
}

.suggestion-snippet {
    font-size: 0.8rem;
    color: #a0aec0;
    line-height: 1.4;
    margin-top: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.suggestion-title mark {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: #ffffff;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Enhanced search box focus state */
.search-box:focus-within {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Exploration Mode */
.exploration-mode {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    border-color: #3182ce;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.mode-btn i {
    font-size: 0.8rem;
}

/* Text Hyperlinks */
.text-link {
    color: #63b3ed;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-weight: 500;
}

.text-link:hover {
    color: #3182ce;
    border-bottom-color: #3182ce;
    background: rgba(49, 130, 206, 0.1);
    border-radius: 3px;
    padding: 1px 3px;
    margin: -1px -3px;
}

/* Quadrant Elements - Non-interactive */
.quadrant-circle,
.quadrant-line,
.quadrant-label,
.quadrant-bg,
.quadrant-text {
    pointer-events: none;
    user-select: none;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #a0aec0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #4a5568;
    border-top: 2px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

/* Main Content */
.main-content {
    display: flex;
    flex-direction: row;
    max-width: none;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
    flex: 1;
    min-height: 0; /* Allow content to shrink */
    height: auto; /* Let content determine height */
    gap: 0;
    position: relative;
}

/* Left Panel - Network */
.left-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    min-height: 400px; /* Reasonable minimum height */
}

/* Right Panel - Node Details */
.right-panel {
    width: 400px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

/* When no nodes are loaded, collapse the right panel */
.right-panel.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
}

/* When right panel is collapsed, left panel takes full width */
.left-panel.expanded {
    flex: 1 1 100%;
}

/* When right panel is collapsed, hide the resize divider */
.resize-divider.collapsed {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

/* Resizable Divider */
.resize-divider {
    display: block; /* Show resizable divider on mobile */
    width: 100%;
    height: 16px; /* Increased height for better touch target */
    background: linear-gradient(90deg, #3182ce, #63b3ed);
    cursor: ns-resize;
    position: relative;
    flex-shrink: 0;
    border: none;
    margin: 0;
    touch-action: none; /* Prevent default touch actions */
    -webkit-tap-highlight-color: transparent;
    z-index: 1000; /* Ensure it's above other elements */
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
}

.resize-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.resize-divider:hover {
    background: linear-gradient(135deg, #2b6cb0, #2c5282);
}

.resize-divider:active {
    background: linear-gradient(135deg, #2c5282, #1a365d);
}

.resize-handle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.resize-divider:hover .resize-handle {
    opacity: 1;
}

.resize-divider:active .resize-handle {
    opacity: 1;
}

/* When header is collapsed, expand main content to fill the space */
.header.collapsed ~ .main-content {
    margin-top: 0;
    padding-top: 0;
    height: calc(100vh - 50px); /* Fixed height to account for expand button and minimal padding */
    max-width: none;
    margin: 0;
    padding: 0;
}

/* When header is collapsed and game stats are hidden, give more space */
.header.collapsed ~ .game-stats.hidden ~ .main-content {
    margin-top: 0;
    padding-top: 0;
    height: calc(100vh - 30px); /* Fixed height - even less space needed */
    max-width: none;
    margin: 0;
    padding: 0;
}

/* When header is collapsed and filters are hidden, give more space */
.header.collapsed ~ .filters-panel.hidden ~ .main-content {
    margin-top: 0;
    padding-top: 0;
    height: calc(100vh - 30px); /* Fixed height - even less space needed */
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Network Container */
.network-container {
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #3182ce;
    border-radius: 15px;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    height: 100%;
    min-height: 350px; /* Reasonable minimum height */
    flex: 1;
}

/* When header is collapsed, make network container fill the viewport */
.header.collapsed ~ .main-content .network-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    min-height: calc(100vh - 50px);
    height: calc(100vh - 50px);
}

/* When header is collapsed and other panels are hidden, use even more space */
.header.collapsed ~ .game-stats.hidden ~ .filters-panel.hidden ~ .main-content .network-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    min-height: calc(100vh - 30px);
    height: calc(100vh - 30px);
}

.network-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 2px solid #e53e3e;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
}

.control-btn {
    background: linear-gradient(135deg, #3182ce, #2b6cb0);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.control-btn:hover {
    background: linear-gradient(135deg, #2b6cb0, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}



.zoom-btn {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 50%;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
}

.zoom-btn:hover {
    background: linear-gradient(135deg, #2f855a, #276749);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.network-canvas {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    min-height: calc(100vh - 300px); /* Ensure minimum height */
    transition: all 0.3s ease;
    flex: 1;
}

/* When header is collapsed, expand network canvas to use more space */
.header.collapsed ~ .main-content .network-canvas {
    min-height: 600px;
    height: 600px;
}

/* When header is collapsed and other panels are hidden, use even more space */
.header.collapsed ~ .game-stats.hidden ~ .filters-panel.hidden ~ .main-content .network-canvas {
    min-height: calc(100vh - 100px); /* Account for controls only */
    height: calc(100vh - 100px);
}

/* When header is collapsed, expand network canvas to use more space */
.header.collapsed ~ .main-content .network-canvas {
    min-height: calc(100vh - 120px); /* Account for controls and padding */
    height: calc(100vh - 120px);
}

.network-canvas svg {
    width: 100%;
    height: 100%;
}

.node {
    cursor: pointer;
    transition: all 0.2s ease;
}

.node:hover circle {
    r: 12;
    stroke-width: 2;
}

.node:hover text {
    font-size: 11px;
    font-weight: 700;
    fill: #000000;
}

.node text {
    font-size: 10px;
    text-anchor: middle;
    pointer-events: none;
    fill: #333333;
    font-weight: 600;
    /* Prevent text from being affected by parent transform */
    transform: scale(1);
    transform-origin: center;
    /* Additional fixes for text stability */
    dominant-baseline: middle;
    text-rendering: optimizeLegibility;
    /* Ensure text doesn't move during hover */
    will-change: auto;
}

.link {
    stroke-opacity: 0.6;
    transition: stroke-opacity 0.2s ease;
}

.link:hover {
    stroke-opacity: 1;
}



.navigation-path {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(45, 55, 72, 0.95);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 15px;
    max-width: 300px;
    max-height: 400px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all 0.3s ease;
}

.navigation-path.minimized {
    max-height: 50px;
    overflow: hidden;
}

.navigation-path.minimized .path-content {
    display: none;
}

.navigation-path h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.minimize-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #a0aec0;
    padding: 0;
}

.path-items {
    max-height: 300px;
    overflow-y: auto;
}

.path-item {
    padding: 8px;
    border-bottom: 1px solid #4a5568;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
    color: #e2e8f0;
}

.path-item:hover {
    background: #4a5568;
}

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

.title-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.node-details-panel {
    position: relative;
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #3182ce;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.node-details-panel.minimized {
    height: auto;
    min-height: auto;
}

.node-details-panel.minimized .panel-content {
    display: none;
}

.node-details-panel.visible {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #4a5568;
    background: #4a5568;
    cursor: move;
    user-select: none;
}

.panel-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 16px;
}

.panel-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.panel-btn {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #a0aec0;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.placeholder-text {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.node-title {
    margin: 0 0 16px 0;
    color: #e2e8f0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    background: rgba(49, 130, 206, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    margin: -12px -16px 16px -16px;
}

.node-extract {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #e2e8f0;
    font-size: 14px;
}



.node-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    background: #4a5568;
    color: #e2e8f0;
    border: 1px solid #718096;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #718096;
    border-color: #a0aec0;
}

.action-btn.primary {
    background: #3182ce;
    color: #ffffff;
}

.action-btn.primary:hover {
    background: #2c5282;
}

/* When header is collapsed on mobile, expand main content */
.header.collapsed ~ .main-content {
    padding: 0;
    margin: 0;
    height: calc(100vh - 20px);
    max-width: none;
}

.network-controls {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 5px;
}

.control-btn {
    padding: 0.5rem;
    font-size: 0.7rem;
    min-width: 60px;
}

.zoom-controls {
    margin-left: 0;
    margin-right: 0; /* Remove margin on mobile */
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.network-canvas {
    height: 100%;
    min-height: 250px;
    max-height: none;
}

/* When header is collapsed on mobile, expand network container */
.header.collapsed ~ .main-content .network-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    height: 100%;
    min-height: 0;
}

/* When header is collapsed on mobile, expand network canvas */
.header.collapsed ~ .main-content .network-canvas {
    height: 100%;
    min-height: 0;
}



.legend-section h4 {
    font-size: 10px;
}

.legend-item {
    font-size: 9px;
}

.node-details-panel {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: none;
    overflow-y: auto;
}

.panel-header {
    padding: 10px;
    position: sticky;
    top: 0;
    background: #2d3748 !important;
    z-index: 10;
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 14px;
    color: #f6ad55 !important;
    font-weight: bold;
}

.close-btn {
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.panel-content {
    padding: 10px;
    height: calc(100% - 50px);
    overflow-y: auto;
}

.node-extract {
    font-size: 13px;
    line-height: 1.4;
}

.action-btn {
    padding: 8px 12px;
    font-size: 11px;
    margin: 2px;
}

.welcome-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #e2e8f0;
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 2px solid #3182ce;
}

.welcome-content {
    max-width: 600px;
    padding: 2rem;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #3182ce, #63b3ed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #a0aec0;
    font-weight: 500;
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    border-top: 2px solid #3182ce;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    font-weight: 500;
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-content p {
    margin: 0;
    line-height: 1.4;
}

.footer-content strong {
    color: #fff;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }

    .header-content {
        padding: 0 1rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .header-controls {
        gap: 0.25rem;
    }

    .game-mode-btn, .tutorial-btn, .achievements-btn, .collapse-header-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .session-tracker {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        margin: 0.5rem auto;
    }
    
    .session-label {
        font-size: 0.8rem;
    }
    
    .session-count {
        font-size: 1rem;
        padding: 0.2rem 0.5rem;
    }

    .game-stats {
        gap: 1rem;
        padding: 0.5rem;
    }

    .filters-panel {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-section {
        padding: 2rem 1rem;
    }

    .search-container {
        max-width: 100%;
        padding: 0;
    }

    .search-box {
        flex-direction: column;
        gap: 0.75rem;
        border-radius: 25px;
        padding: 1rem;
    }

    #searchInput {
        font-size: 16px;
        padding: 1rem;
        text-align: center;
    }

    .search-btn {
        padding: 1rem 2rem;
        font-size: 16px;
        border-radius: 25px;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .search-suggestions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .suggestion-label {
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }

    .suggestion-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 20px;
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .main-content {
        flex-direction: column;
        padding: 0;
        gap: 0;
        flex: 1 1 0;
        min-height: 0;
        height: 100vh;
        position: relative;
        overflow: hidden;
        max-width: 100vw;
    }

    .resize-divider {
        display: block; /* Show resizable divider on mobile */
        width: 100%;
        height: 20px; /* Increased height for better touch target */
        background: linear-gradient(90deg, #3182ce, #63b3ed);
        cursor: ns-resize;
        position: relative;
        flex-shrink: 0;
        border: none;
        margin: 0;
        touch-action: none; /* Prevent default touch actions */
        -webkit-tap-highlight-color: transparent;
        z-index: 1000; /* Ensure it's above other elements */
        box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
        user-select: none;
        -webkit-user-select: none;
    }

    .resize-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 8px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .resize-divider:hover {
        background: linear-gradient(90deg, #2563eb, #3b82f6);
        box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
    }

    .resize-divider:active {
        background: linear-gradient(90deg, #1d4ed8, #2563eb);
        box-shadow: 0 6px 16px rgba(49, 130, 206, 0.5);
    }

    .left-panel {
        order: 1;
        flex: 1 1 0;
        min-height: 200px;
        max-height: 60vh;
        height: auto;
        display: flex;
        flex-direction: column;
        transition: height 0.3s ease;
        overflow-y: auto;
    }

    .right-panel {
        order: 2;
        flex: 1 1 0;
        min-width: 0;
        width: 100%;
        border-left: none;
        border-bottom: 2px solid #3182ce;
        min-height: 200px;
        max-height: 40vh;
        height: auto;
        display: flex;
        flex-direction: column;
        transition: height 0.3s ease;
        overflow-y: auto;
    }

    .right-panel.collapsed {
        height: 0;
        overflow: hidden;
        opacity: 0;
        border-bottom: none;
        min-height: 0;
        flex: 0 0 0;
    }

    .left-panel.expanded {
        height: 100%;
        order: 1;
    }

    .network-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 5px;
        justify-content: center;
    }

    .control-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
        min-width: 60px;
        justify-content: center;
    }

    .zoom-controls {
        margin-left: 0;
        margin-right: 0; /* Remove margin on mobile */
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .network-canvas {
        height: 100%;
        min-height: 250px;
        max-height: none;
    }

    .network-container {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        height: 100%;
        min-height: 0;
        flex: 1;
    }

    .network-canvas {
        height: 100% !important;
        min-height: 0;
        flex: 1;
    }



    .legend-section h4 {
        font-size: 10px;
    }

    .legend-item {
        font-size: 9px;
    }

    .node-details-panel {
        width: 100%;
        height: 100%;
        min-height: 200px;
        max-height: none;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .panel-header {
        padding: 10px;
        position: sticky;
        top: 0;
        background: #2d3748 !important;
        z-index: 10;
        flex-shrink: 0;
    }

    .panel-header h3 {
        font-size: 14px;
        color: #f6ad55 !important;
        font-weight: bold;
    }

    .close-btn {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }

    .panel-content {
        padding: 10px;
        height: calc(100% - 50px);
        overflow-y: auto;
        flex: 1;
    }

    .node-extract {
        font-size: 13px;
        line-height: 1.4;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 11px;
        margin: 2px;
    }

    .welcome-content {
        padding: 0 1rem;
    }

    .welcome-content h2 {
        font-size: 20px;
    }

    .welcome-content p {
        font-size: 14px;
    }

    .welcome-features {
        gap: 1rem;
    }

    .feature i {
        font-size: 1.2rem;
    }

    .feature span {
        font-size: 0.7rem;
    }

    .footer {
        padding: 15px;
        font-size: 11px;
        margin-top: auto;
        position: relative;
        z-index: 10;
    }

    .loading-indicator {
        padding: 1rem;
    }

    .loading-spinner {
        width: 16px;
        height: 16px;
    }

    .loading-indicator p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0;
    }

    .header-content {
        padding: 0 0.5rem;
    }

    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .game-mode-btn, .tutorial-btn, .achievements-btn, .collapse-header-btn {
        width: 100%;
        justify-content: center;
    }
    
    .session-tracker {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        margin: 0.4rem auto;
        flex-direction: column;
        gap: 0.3rem;
        justify-content: center;
        width: fit-content;
    }
    
    .session-label {
        font-size: 0.7rem;
    }
    
    .session-count {
        font-size: 0.9rem;
        padding: 0.15rem 0.4rem;
    }

    .game-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .search-section {
        padding: 1.5rem 0.5rem;
    }

    .search-container {
        max-width: 100%;
        padding: 0;
    }

    .search-box {
        flex-direction: column;
        gap: 0.75rem;
        border-radius: 20px;
        padding: 0.75rem;
    }

    #searchInput {
        font-size: 16px;
        padding: 0.75rem;
        text-align: center;
    }

    .search-btn {
        padding: 0.75rem 1.5rem;
        font-size: 16px;
        border-radius: 20px;
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }

    .search-suggestions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        z-index: 9999;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-radius: 12px 12px 0 0;
        border-top: 2px solid #3182ce;
        border-bottom: none;
    }

    .suggestion-label {
        font-size: 0.8rem;
        text-align: center;
        width: 100%;
    }

    .suggestion-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 15px;
        width: 100%;
        max-width: 200px;
        text-align: center;
    }

    .main-content {
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        height: 100vh;
        position: relative;
        overflow: hidden;
        max-width: 100vw;
    }

    .resize-divider {
        height: 10px; /* Increased height for better touch target */
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
        z-index: 1000;
    }

    .resize-divider::before {
        width: 30px;
        height: 3px;
    }

    .left-panel {
        height: 45%;
        min-height: 200px;
    }

    .right-panel {
        height: 55%;
        min-height: 200px;
    }

    .network-container {
        margin: 0;
    }

    .network-controls {
        padding: 0.25rem;
        justify-content: center;
    }

    .control-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.6rem;
        justify-content: center;
    }

    .zoom-controls {
        margin-left: 0;
        margin-right: 0; /* Remove margin on small mobile */
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .network-canvas {
        height: 300px;
        min-height: 300px;
        flex: 1;
    }

    .network-container {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        min-height: calc(100vh - 60px);
        height: calc(100vh - 60px);
        flex: 1;
    }

    .network-canvas {
        min-height: calc(100vh - 100px);
        height: calc(100vh - 100px);
        flex: 1;
    }



    .legend-section h4 {
        font-size: 9px;
    }

    .legend-item {
        font-size: 8px;
    }

    .panel-header {
        padding: 8px;
    }

    .panel-header h3 {
        font-size: 13px;
        color: #2d3748;
    }

    .close-btn {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }

    .panel-content {
        padding: 8px;
    }

    .node-extract {
        font-size: 12px;
    }

    .action-btn {
        padding: 8px;
        font-size: 10px;
    }

    .welcome-content {
        padding: 0 0.5rem;
    }

    .welcome-content h2 {
        font-size: 18px;
    }

    .welcome-content p {
        font-size: 13px;
    }

    .welcome-features {
        flex-direction: column;
        gap: 0.5rem;
    }

    .feature {
        flex-direction: row;
        gap: 0.5rem;
    }

    .feature i {
        font-size: 1rem;
    }

    .feature span {
        font-size: 0.6rem;
    }

    .footer {
        padding: 10px;
        font-size: 10px;
        margin-top: auto;
        position: relative;
        z-index: 10;
    }

    .loading-indicator {
        padding: 0.5rem;
    }

    .loading-spinner {
        width: 14px;
        height: 14px;
    }

    .loading-indicator p {
        font-size: 12px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .control-btn,
    .action-btn,
    .suggestion-btn,
    .game-mode-btn,
    .tutorial-btn,
    .achievements-btn,
    .collapse-header-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }

    .panel-content {
        padding: 20px;
    }

    .control-btn,
    .action-btn,
    .suggestion-btn,
    .game-mode-btn,
    .tutorial-btn,
    .achievements-btn {
        font-size: 16px;
        border-width: 2px;
    }

    .control-btn:focus,
    .action-btn:focus,
    .suggestion-btn:focus,
    .game-mode-btn:focus,
    .tutorial-btn:focus,
    .achievements-btn:focus {
        outline: 2px solid #007AFF;
        outline-offset: 2px;
    }

    /* Touch-friendly resize divider */
    .resize-divider {
        min-height: 44px;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
        z-index: 1000;
    }

    .resize-divider:active {
        background: linear-gradient(90deg, #2c5282, #3182ce);
    }

    .resize-divider:hover {
        background: linear-gradient(90deg, #2c5282, #3182ce);
    }
}

/* Notification Styles */
.points-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.points-notification.show {
    transform: translateX(0);
}

.points-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.points-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.points-reason {
    font-size: 0.8rem;
    opacity: 0.9;
}

.achievement-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #ffffff;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
}

.achievement-notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.achievement-content i {
    font-size: 2rem;
    color: #4CAF50;
}

.achievement-text h4 {
    margin: 0 0 0.25rem 0;
    color: #000000;
    font-size: 1rem;
}

.achievement-text p {
    margin: 0;
    color: #666666;
    font-size: 0.8rem;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #333333;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
        height: calc(100vh - 80px);
        gap: 10px;
        padding: 5px;
    }

    .left-panel {
        order: 1;
        height: 100%;
        flex: 2;
        min-height: 0;
    }

    .right-panel {
        order: 2;
        width: 300px;
        min-width: 250px;
        height: 100%;
        border-left: 2px solid #3182ce;
        border-bottom: none;
        flex: 1;
    }

    /* Mobile collapsed panel state in landscape */
    .right-panel.collapsed {
        width: 0;
        min-width: 0;
        overflow: hidden;
        opacity: 0;
        border-left: none;
    }

    .left-panel.expanded {
        flex: 1;
        order: 1;
    }

    .network-canvas {
        height: 100%;
        min-height: 200px;
    }

    .network-controls {
        padding: 8px;
        gap: 0.5rem;
        justify-content: center;
    }

    .control-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 50px;
        justify-content: center;
    }

    .zoom-controls {
        margin: 0;
        width: auto;
        justify-content: flex-end;
    }

    .zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }



    .legend-section h4 {
        font-size: 9px;
    }

    .legend-item {
        font-size: 8px;
    }

    .node-details-panel {
        height: 100%;
        min-height: 0;
    }

    .panel-header {
        padding: 8px;
    }

    .panel-header h3 {
        font-size: 12px;
        color: #2d3748;
    }

    .close-btn {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }

    .panel-content {
        padding: 8px;
        height: calc(100% - 40px);
    }

    .node-extract {
        font-size: 11px;
        line-height: 1.3;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 10px;
        margin: 1px;
    }

    .welcome-content {
        padding: 0 0.5rem;
    }

    .welcome-content h2 {
        font-size: 16px;
    }

    .welcome-content p {
        font-size: 12px;
    }

    .search-section {
        padding: 0.5rem;
    }

    .search-box {
        padding: 0.5rem;
    }

    #searchInput {
        font-size: 14px;
    }

    .search-btn {
        padding: 0.5rem 1rem;
        font-size: 14px;
    }

    .search-suggestions {
        gap: 0.5rem;
    }

    .suggestion-btn {
        padding: 0.5rem 1rem;
        font-size: 12px;
    }

    .header {
        padding: 0.5rem;
    }

    .logo {
        font-size: 18px;
    }

    .subtitle {
        font-size: 12px;
    }
}

.node-info-section {
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.node-info-section h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-info-section h4 i {
    color: #FFD700;
}

.info-content {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    padding: 4px 0;
}

.info-content .info-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.info-content .info-item.primary {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

/* Prominent temporal and spatial information */
.prominent-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.6), rgba(255, 165, 0, 0.6));
    border-radius: 12px;
    border: 4px solid rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.prominent-label {
    margin: 0 0 8px 0;
    color: #000000;
    font-size: 16px;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(255, 255, 255, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid rgba(0, 0, 0, 0.8);
    padding-bottom: 8px;
    background: rgba(255, 215, 0, 1);
    padding: 10px 15px;
    border-radius: 10px;
    margin: -10px -15px 10px -15px;
    border: 3px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.prominent-label i {
    color: #FFD700;
    font-size: 18px;
}

.prominent-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

.prominent-temporal {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #000000;
    text-shadow: 3px 3px 6px rgba(255, 255, 255, 1), 2px 2px 4px rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 1);
    padding: 10px 15px;
    border-radius: 10px;
    border: 3px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.prominent-spatial {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #FF8C00;
    text-shadow: none;
    background: rgba(255, 255, 255, 1);
    padding: 10px 15px;
    border-radius: 10px;
    border: 3px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 100%;
}

.prominent-temporal i {
    color: #8B4513;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 1);
}

.prominent-spatial i {
    color: #1B5E20;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 1);
}

.prominent-item {
    display: inline-block;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    cursor: pointer;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin-right: 8px;
    margin-bottom: 6px;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.prominent-item:last-child {
    margin-right: 0;
}

.prominent-item:hover {
    background: rgba(0, 0, 0, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
    border-color: #ffffff;
}

.prominent-item.primary {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 700;
    border: 2px solid rgba(255, 215, 0, 0.6);
    text-shadow: none;
}

.prominent-item.primary:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 165, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.8);
}

/* Clickable info items */
.info-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff !important;
    font-weight: 600;
}

.info-item.clickable:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Mobile responsive for prominent info */
@media (max-width: 768px) {
    .prominent-info {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .prominent-temporal {
        font-size: 13px;
        font-weight: 800;
        color: #000000;
        text-shadow: 3px 3px 6px rgba(255, 255, 255, 1), 2px 2px 4px rgba(255, 255, 255, 1);
        background: rgba(255, 255, 255, 1);
        padding: 8px 12px;
        border-radius: 8px;
        border: 3px solid rgba(0, 0, 0, 0.8);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .prominent-spatial {
        font-size: 13px;
        font-weight: 800;
        color: #FF8C00;
        text-shadow: none;
        background: rgba(255, 255, 255, 1);
        padding: 8px 12px;
        border-radius: 8px;
        border: 3px solid rgba(0, 0, 0, 0.8);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    }
    
    .prominent-item {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Node label styles for time/place display */
.node-label-time,
.node-label-place {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.node-label-time:hover,
.node-label-place:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

/* Ensure labels are visible on all backgrounds */
.node-label-group {
    pointer-events: all;
}

/* Background rectangles for node labels */
.node-label-group rect {
    transition: all 0.2s ease;
    opacity: 0.9;
}

/* Improve spacing for node labels */
.node-label-group text {
    dominant-baseline: middle;
}

/* Infobox image styling for node details */
.infobox-image {
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.infobox-img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.infobox-img:hover {
    transform: scale(1.02);
}

/* Media info styling for node details */
.media-info {
    background: linear-gradient(135deg, #fffbe6 0%, #ffeaa7 100%);
    border: 1.5px solid #ffe082;
    border-radius: 10px;
    padding: 1rem;
    margin: 1.2rem 0 0.5rem 0;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.08);
}
.media-label {
    color: #b8860b;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.7rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.media-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.media-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-bottom: 0.5rem;
}
.media-thumb {
    display: inline-block;
    margin: 4px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.media-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.media-thumb img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
}
.media-videos-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.media-video-item {
    background: #fff8e1;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    box-shadow: 0 1px 4px rgba(255, 193, 7, 0.07);
}
.media-video-link {
    color: #d63384;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.media-video-link:hover {
    color: #a61e4d;
    text-decoration: underline;
}
.media-video-desc {
    color: #6d4c00;
    font-size: 0.92rem;
    margin-top: 0.2rem;
    font-style: italic;
}
@media (max-width: 600px) {
    .media-info {
        padding: 0.7rem;
    }
    .media-images-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 7px;
    }
    .media-thumb img {
        height: 48px;
    }
    .media-label {
        font-size: 0.95rem;
    }
}

/* Image Modal/Lightbox Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.hidden {
    display: none;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-modal.show .image-modal-content {
    transform: scale(1);
}

.image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.image-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.image-modal-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.image-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.image-modal-footer {
    display: flex;
    justify-content: center;
    padding: 16px 24px 20px;
    border-top: 1px solid #e0e0e0;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .image-modal-header {
        padding: 16px 20px 12px;
    }
    
    .image-modal-title {
        font-size: 16px;
    }
    
    .image-modal-body {
        padding: 16px;
    }
    
    .image-modal-image {
        max-height: 50vh;
    }
    
    .image-modal-footer {
        padding: 12px 20px 16px;
    }
}

/* Keyboard navigation support */
.image-modal:focus {
    outline: none;
}

/* Animation for modal entrance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-modal.show .image-modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* Relationship Summaries */
.relationship-summaries {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 8px;
    border-left: 4px solid #3182ce;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.relationship-label {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relationship-label i {
    color: #3182ce;
    font-size: 1.1rem;
}

.relationship-content {
    color: #4a5568;
    line-height: 1.6;
}

.relationship-loading {
    color: #718096;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relationship-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.relationship-summary {
    color: #2d3748;
    font-weight: 500;
    padding: 0.5rem 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.relationship-error {
    color: #e53e3e;
    font-style: italic;
    padding: 0.5rem 0;
    border-top: 1px solid #fed7d7;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .relationship-summaries {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .relationship-label {
        font-size: 0.9rem;
    }
    
    .relationship-summary {
        font-size: 0.9rem;
    }
}

/* Little Known Connections Styles */
.little-known-connections {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
    border-left: 4px solid #f093fb;
}

.connections-label {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connections-label i {
    color: #ffd700;
    font-size: 1.1rem;
}

.connections-content {
    color: white;
    line-height: 1.6;
}

.connections-loading {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connections-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.connections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.connection-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0.75rem;
}

.connection-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.connection-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: block;
    transition: color 0.3s ease;
}

.connection-link:hover {
    color: #ffd700;
    text-decoration: none;
}

.connection-explanation {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #ffd700;
    font-style: italic;
}

.connection-link.fallback {
    color: #ffd700;
    border-bottom: 1px dashed #ffd700;
}

.connection-link.fallback:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.fallback-indicator {
    font-size: 0.8rem;
    opacity: 0.8;
    font-style: italic;
    margin-left: 0.5rem;
}

.connection-item.fallback-text {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem;
    border-radius: 6px;
}

.connection-item.fallback-text .connection-title {
    color: #ffd700;
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.connection-item.fallback-text .connection-explanation {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.connection-item.fallback-text .fallback-indicator {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
}

.connections-empty {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
    padding: 1rem;
}

.connections-error {
    background: rgba(255, 107, 107, 0.2);
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    .little-known-connections {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .connections-label {
        font-size: 0.9rem;
    }
    
    .connection-item {
        padding: 0.4rem 0.6rem;
    }
}

/* Session Path Visualization */
.session-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.15rem;
    color: #fff;
    max-width: 90vw;
    overflow-x: auto;
    white-space: normal;
}
.session-node {
    background: rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 0.15rem 0.7rem;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.10);
    color: #fff;
    transition: background 0.2s;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.98em;
}
.session-node:hover {
    background: rgba(255,255,255,0.32);
}
.session-arrow {
    color: #fff;
    font-size: 1.1em;
    opacity: 0.6;
    margin: 0 0.1rem;
}

@media (max-width: 600px) {
    .session-path {
        font-size: 0.85rem;
        gap: 0.25rem;
        max-width: 98vw;
    }
    .session-node {
        padding: 0.12rem 0.5rem;
        font-size: 0.92em;
        max-width: 70px;
    }
    .session-arrow {
        font-size: 1em;
    }
}

/* --- DESKTOP LAYOUT FIXES --- */
@media (min-width: 769px) {
  .main-content {
    flex-direction: row !important;
    height: calc(100vh - 200px) !important; /* Account for header and search */
    min-height: 500px;
    align-items: stretch;
  }
  .left-panel {
    flex: 1 1 0; /* Equal flex basis for both panels */
    min-width: 300px;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
  }
  .right-panel {
    flex: 1 1 0; /* Equal flex basis for both panels */
    min-width: 300px;
    max-width: none; /* Remove max-width constraint */
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: none; /* Remove border since we have divider */
    border-bottom: none;
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: none;
  }
  .resize-divider {
    width: 20px !important; /* Much wider divider */
    min-width: 20px;
    max-width: 30px;
    height: 100% !important;
    min-height: 0;
    background: linear-gradient(180deg, #3182ce, #63b3ed);
    cursor: ew-resize !important;
    position: relative;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(49,130,206,0.4);
    display: block;
    border: none;
    margin: 0;
    touch-action: none;
  }
  .resize-divider::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    width: 80px;
    height: 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }
  .resize-handle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    opacity: 0.7;
  }
  .panel-header {
    background: #2d3748 !important;
    color: #f6ad55 !important;
    border-bottom: 1px solid #4a5568;
    font-weight: bold;
  }
  .panel-header h3, .panel-title {
    color: #f6ad55 !important;
    font-weight: bold;
    background: none;
  }
  .panel-content {
    color: #e2e8f0;
    background: none;
  }
  
  /* Ensure network container and canvas have consistent heights on desktop */
  .network-container {
    height: calc(100% - 60px) !important; /* Account for network controls */
    min-height: 350px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .network-canvas {
    height: 100% !important;
    min-height: 300px;
    flex: 1;
  }
}

/* --- END DESKTOP LAYOUT FIXES --- */

.header-nav {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.howto-link {
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.2), rgba(99, 179, 237, 0.1));
  border: 1px solid rgba(49, 130, 206, 0.3);
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2);
  position: relative;
  z-index: 2;
}
.howto-link:hover {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.4), rgba(99, 179, 237, 0.2));
  border-color: rgba(49, 130, 206, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(49, 130, 206, 0.4);
  text-decoration: none;
}

/* Progress Section */
.progress-section {
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.95) 0%, rgba(26, 32, 44, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid #3182ce;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0 1rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.1) 0%, rgba(49, 130, 206, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(49, 130, 206, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item:hover {
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.2) 0%, rgba(49, 130, 206, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2);
}

.stat-item i {
    font-size: 1.25rem;
    color: #3182ce;
    width: 24px;
    text-align: center;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #a0aec0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3182ce 0%, #2c5282 100%);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced feedback notifications */
.feedback-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
}

.feedback-notification {
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.98) 0%, rgba(26, 32, 44, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid #3182ce;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feedback-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.feedback-notification.success {
    border-color: #48bb78;
}

.feedback-notification.error {
    border-color: #f56565;
}

.feedback-notification.achievement {
    border-color: #ed8936;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.98) 0%, rgba(26, 32, 44, 0.98) 100%);
}

.feedback-notification i {
    font-size: 1.25rem;
    color: #3182ce;
}

.feedback-notification.success i {
    color: #48bb78;
}

.feedback-notification.error i {
    color: #f56565;
}

.feedback-notification.achievement i {
    color: #ed8936;
}

.feedback-message {
    flex: 1;
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.4;
}

/* Tutorial Modal */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.tutorial-content {
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.98) 0%, rgba(26, 32, 44, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid #3182ce;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10001;
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(49, 130, 206, 0.2);
}

.tutorial-header h2 {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.close-tutorial-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-tutorial-btn:hover {
    background: rgba(49, 130, 206, 0.2);
    color: #e2e8f0;
}

.tutorial-body {
    margin-bottom: 1.5rem;
}

.tutorial-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-step.active {
    display: block;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3182ce, #2c5282);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.125rem;
}

.tutorial-step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
}

.tutorial-step p {
    color: #a0aec0;
    line-height: 1.6;
    font-size: 1rem;
}

.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tutorial-nav-btn {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2c5282, #1a365d);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.tutorial-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(49, 130, 206, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot.active {
    background: #3182ce;
    transform: scale(1.2);
}

/* Tutorial highlighting */
.tutorial-highlight {
    position: relative;
    z-index: 9999;
    animation: tutorialPulse 2s infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(49, 130, 206, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive for new sections */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .featured-explorations h3 {
        font-size: 1.5rem;
    }
    
    .progress-stats {
        justify-content: center;
        gap: 2rem;
    }
    
    .stat-item {
        min-width: 100px;
    }
    
    .feedback-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .feedback-notification {
        max-width: none;
        transform: translateY(-100px);
    }
    
    .feedback-notification.show {
        transform: translateY(0);
    }
    
    .tutorial-content {
        padding: 1.5rem;
    }
    
    .tutorial-header h2 {
        font-size: 1.5rem;
    }
    
    .search-suggestions {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-radius: 12px 12px 0 0;
        border-top: 2px solid #3182ce;
        border-bottom: none;
    }
    
    .suggestion-btn {
        min-height: 70px;
        padding: 16px;
    }
    
    .suggestion-title {
        font-size: 1rem;
    }
    
    .suggestion-snippet {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .featured-explorations h3 {
        font-size: 1.3rem;
    }
    
    .progress-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        min-width: auto;
        width: 100%;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .tutorial-content {
        padding: 1rem;
        width: 95%;
    }
    
    .tutorial-header h2 {
        font-size: 1.3rem;
    }
    
    .tutorial-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

.suggestion-label {
    color: #38b6ff;
    text-shadow: 0 1px 4px rgba(49,130,206,0.25), 0 1px 2px rgba(0,0,0,0.4);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.search-section, .search-container {
    position: relative;
    z-index: 100000 !important;
    overflow: visible !important;
}

.search-suggestions {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%);
    border: 3px solid #3182ce;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 32px rgba(49, 130, 206, 0.25), 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100000;
    max-width: 700px;
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Add extra margin below the sticky suggestions to separate from progress section */
.search-suggestions + .progress-section {
    margin-top: 2.5rem;
}

.search-suggestions.hidden {
    display: none !important;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #a0aec0;
    font-size: 1.1rem;
    gap: 1rem;
}

.loading-placeholder i {
    font-size: 2rem;
    color: #3182ce;
    animation: spin 1s linear infinite;
}

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

.popular-searches h3 {
    color: #3182ce;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

/* Exploration Journey Modal */
.exploration-journey-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.exploration-journey-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.exploration-journey-modal .modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    margin: 5vh auto;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 16px;
    border: 2px solid #3182ce;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(49, 130, 206, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.exploration-journey-modal .modal-header {
    background: linear-gradient(135deg, #3182ce 0%, #2b77cb 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.exploration-journey-modal .modal-header h2 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exploration-journey-modal .close-modal-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.exploration-journey-modal .close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.exploration-journey-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 80px);
}

.exploration-journey-modal .empty-journey {
    text-align: center;
    padding: 3rem 2rem;
    color: #a0aec0;
}

.exploration-journey-modal .empty-journey i {
    font-size: 3rem;
    color: #3182ce;
    margin-bottom: 1rem;
}

.exploration-journey-modal .empty-journey h3 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.exploration-journey-modal .journey-stats {
    background: rgba(49, 130, 206, 0.1);
    padding: 1rem 2rem;
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.exploration-journey-modal .journey-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.exploration-journey-modal .journey-stats .stat i {
    color: #3182ce;
}

.exploration-journey-modal .journey-list {
    padding: 0;
}

.exploration-journey-modal .journey-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.exploration-journey-modal .journey-item:hover {
    background: rgba(49, 130, 206, 0.1);
    border-left: 4px solid #3182ce;
    padding-left: calc(2rem - 4px);
}

.exploration-journey-modal .journey-number {
    background: #3182ce;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 1rem;
}

.exploration-journey-modal .journey-content {
    flex: 1;
    min-width: 0;
}

.exploration-journey-modal .journey-content h4 {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exploration-journey-modal .journey-time {
    color: #a0aec0;
    font-size: 0.75rem;
}

.exploration-journey-modal .journey-action {
    color: #3182ce;
    margin-left: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.exploration-journey-modal .journey-item:hover .journey-action {
    opacity: 1;
}

/* Make progress stat items clickable */
.stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem;
}

.stat-item.clickable:hover {
    background: rgba(49, 130, 206, 0.1);
    transform: translateY(-1px);
}

/* Mobile Fullscreen Node Details */
.mobile-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.mobile-back-btn:hover,
.mobile-back-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.mobile-fullscreen-actions {
    display: flex;
    gap: 0.5rem;
}

.mobile-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-action-btn:hover,
.mobile-action-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mobile-fullscreen-content {
    flex: 1;
    padding: 1.5rem;
    color: white;
    overflow-y: auto;
    word-wrap: break-word;
    hyphens: auto;
}

.mobile-node-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #fff;
    text-align: center;
}

/* Mobile Infobox Image */
.mobile-infobox-image {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-infobox-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

/* Mobile Prominent Info */
.mobile-prominent-info {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.mobile-prominent-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-prominent-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-prominent-temporal,
.mobile-prominent-spatial {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: #f0f0f0;
}

.mobile-prominent-temporal i,
.mobile-prominent-spatial i {
    font-size: 1.1rem;
    color: #667eea;
    min-width: 20px;
}

.mobile-prominent-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0.125rem;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-prominent-item.primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    font-weight: 600;
}

.mobile-prominent-item.clickable {
    cursor: pointer;
}

.mobile-prominent-item.clickable:hover,
.mobile-prominent-item.clickable:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.mobile-node-extract {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #f5f5f5;
    margin: 1.5rem 0;
    text-align: justify;
    hyphens: auto;
}

.mobile-node-extract p {
    margin-bottom: 1rem;
}

/* Mobile Section Titles */
.mobile-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.mobile-section-title i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Mobile Relationship Summaries */
.mobile-relationship-summaries {
    margin: 1.5rem 0;
}

.mobile-relationship-item {
    background: rgba(118, 75, 162, 0.1);
    border: 1px solid rgba(118, 75, 162, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.mobile-relationship-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #f0f0f0;
    margin: 0;
    text-align: justify;
    hyphens: auto;
}

/* Mobile Little Known Connections */
.mobile-little-known-connections {
    margin: 1.5rem 0;
}

.mobile-connections-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.mobile-connection-item {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px;
}

.mobile-connection-item:hover,
.mobile-connection-item:active {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.mobile-connection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.mobile-connection-explanation {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0e0e0;
    margin: 0;
    text-align: justify;
    hyphens: auto;
}

/* Loading state for mobile */
.loading-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #ccc;
}

.loading-message i {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
    display: block;
}

/* Mobile connections loading */
.mobile-connections-loading {
    text-align: center;
    padding: 1.5rem;
    font-size: 1rem;
    color: #ccc;
}

.mobile-connections-loading i {
    font-size: 1.2rem;
    color: #667eea;
    margin-right: 0.5rem;
}

.mobile-connections-empty {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.95rem;
    color: #999;
    font-style: italic;
}

.mobile-connections-error {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.95rem;
    color: #e53e3e;
}

/* Portrait mode specific adjustments */
@media screen and (orientation: portrait) {
    .mobile-fullscreen-overlay {
        /* Ensure full coverage in portrait mode */
        min-height: 100vh;
        min-width: 100vw;
        width: 100vw;
        height: 100vh;
        /* Fix for iOS Safari viewport issues */
        height: -webkit-fill-available;
        /* Hardware acceleration for smoother performance */
        transform: translateZ(0);
    }
    
    .mobile-fullscreen-content {
        /* Remove height restrictions to allow full content display */
        flex: 1;
        overflow-y: auto;
        /* Better text wrapping for narrow screens */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        /* Ensure proper spacing */
        padding: 1rem 1.5rem 2rem 1.5rem;
    }
    
    .mobile-node-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
        /* Better line breaking for long titles */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .mobile-back-btn {
        /* Ensure button is easily tappable in portrait */
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .mobile-fullscreen-header {
        /* Reduce header height in portrait to save space */
        padding: 0.75rem;
        /* Ensure header doesn't get cut off */
        flex-shrink: 0;
    }
    
    /* Better spacing for prominent info in portrait */
    .mobile-prominent-item {
        /* Ensure touch targets are large enough */
        min-height: 44px;
        padding: 0.75rem 1rem;
        /* Better text wrapping */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Better spacing for connections in portrait */
    .mobile-connection-item {
        /* Ensure touch targets are large enough */
        min-height: 60px;
        padding: 1rem;
    }
    
    .mobile-connection-title {
        /* Better line breaking for connection titles */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}
  