* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; overflow-x: hidden; overflow-y: auto; background: #f5f5f0; }

/* Welcome Page */
#welcome-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    background: #ffffff;
    overflow-y: auto;
    z-index: 20000;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}
#welcome-page.hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

/* Hero Section */
.hero-header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.hero-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid #e5e5e5;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #3d5a40;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.hero-nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.hero-nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.hero-nav-links a:hover {
    color: #588157;
}

.cta-button {
    background: #588157;
    color: #ffffff;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #3d5a40;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger-menu span {
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

/* Hero Content */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    text-align: center;
}

.hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 56px;
    font-weight: 700;
    color: #3d5a40;
    margin-bottom: 8px;
}

.hero-logo {
    height: 60px;
    width: auto;
}

.hero-tagline {
    font-size: 18px;
    color: #555;
    margin-bottom: 40px;
    font-weight: 400;
}

.video-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 32px;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
    border: 2px solid #588157;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 16px;
}

video.video-placeholder {
    display: block;
    object-fit: cover;
}

video.video-placeholder::-webkit-media-controls-fullscreen-button {
    display: none;
}

video.video-placeholder::-webkit-media-controls-volume-slider {
    display: none;
}

video.video-placeholder::-webkit-media-controls-mute-button {
    display: none;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.btn-primary {
    background: #588157;
    color: #ffffff;
    padding: 14px 32px;
    border: 2px solid #588157;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #3d5a40;
    border-color: #3d5a40;
}

.btn-secondary {
    background: #ffffff;
    color: #588157;
    padding: 14px 32px;
    border: 2px solid #588157;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.hero-support {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Use Cases Section */
.section-use-cases {
    padding: 80px 40px;
    background: #f9f9f9;
}

.section-intro {
    text-align: center;
    font-size: 18px;
    color: #333;
    max-width: 800px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.use-case-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.use-case-card:hover {
    border-color: #588157;
    box-shadow: 0 4px 12px rgba(88, 129, 87, 0.1);
    transform: translateY(-2px);
}

.use-case-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #3d5a40;
    margin-bottom: 12px;
}

.use-case-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Technology Section */
.section-technology {
    padding: 80px 40px;
    background: #ffffff;
}

.section-technology h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #3d5a40;
    margin-bottom: 24px;
}

.tech-description {
    text-align: center;
    font-size: 16px;
    color: #555;
    max-width: 800px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

.tech-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto 24px;
    position: relative;
}

.tech-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #588157;
    z-index: 0;
}

.tech-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.tech-icon {
    width: 48px;
    height: 48px;
    background: #588157;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    border: 4px solid #ffffff;
}

.tech-label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    text-align: center;
    max-width: 120px;
}

.tech-caption {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Footer */
.welcome-footer {
    padding: 40px 40px;
    background: #f9f9f9;
    border-top: 1px solid #e5e5e5;
}

/* Chevron Demo Section */
.chevron-demo {
    padding: 60px 40px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chevron-demo:hover {
    background: #f5f5f5;
}

.chevron-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.chevron-arrows {
    display: flex;
    gap: 8px;
    font-size: 48px;
    color: #588157;
    font-weight: bold;
    animation: chevronBounce 1.5s ease-in-out infinite;
}

.chevron-arrows span:nth-child(2) {
    animation-delay: 0.15s;
}

@keyframes chevronBounce {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(10px);
        opacity: 1;
    }
}

.chevron-content p {
    font-size: 18px;
    font-weight: 600;
    color: #3d5a40;
    margin: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-link {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #588157;
}

.footer-lang {
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.95);
    padding: 4px;
    border-radius: 20px;
    border: 2px solid #588157;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-lang:hover {
    box-shadow: 0 2px 8px rgba(88, 129, 87, 0.2);
}

.lang-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.lang-btn.lang-hidden {
    display: none;
}

.footer-lang.expanded .lang-btn.lang-hidden {
    display: flex;
}

.lang-btn.active {
    background: #588157;
    border-color: #3d5a40;
}

.lang-btn:hover {
    transform: scale(1.05);
    background: rgba(88, 129, 87, 0.2);
}

.lang-btn.active:hover {
    background: #3d5a40;
}

/* Main Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(61, 90, 64, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(218, 215, 205, 0.2);
    z-index: 10000;
    display: none;
    padding: 8px 20px;
    align-items: center;
}
.main-nav.show {
    display: flex;
}
.main-nav h1 {
    color: #dad7cd;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
#backToWelcome:hover {
    background: rgba(163,177,138,0.3);
    border-color: #dad7cd;
}

/* Main app container */
#main-app {
    display: block;
    min-height: 100vh;
}

#canvas-container {
    width: 100%;
    height: calc(100vh - 53px);
    cursor: crosshair;
    position: relative;
    transition: width 0.3s ease;
}
#canvas-container.with-kg-panel {
    width: calc(100% - 450px);
}

.controls {
    position: fixed;
    top: 73px;
    left: 20px;
    background: rgba(20, 20, 30, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(61, 90, 64, 0.3);
    z-index: 1000;
    width: 340px;
    max-width: 340px;
}
.controls h2 {
    color: #a3b18a;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-wrapper { margin-bottom: 16px; }
.file-input-label {
    display: inline-block; padding: 6px 12px; background: transparent;
    color: rgba(218, 215, 205, 0.8); border: 1px solid rgba(163, 177, 138, 0.5); border-radius: 6px;
    cursor: pointer; transition: all 0.3s ease; font-weight: 400; text-align: center; width: 100%; font-size: 12px;
}
.file-input-label:hover {
    color: rgba(218, 215, 205, 1);
    border-color: #a3b18a;
    background: rgba(163, 177, 138, 0.1);
}
input[type="file"] { display: none; }

.search-section { background: rgba(163, 177, 138, 0.1); padding: 14px; border-radius: 8px; margin-bottom: 14px; }
.search-section h3 { color: #a3b18a; font-size: 14px; margin-bottom: 10px; font-weight: 500; }

/* Top search bar */
.search-centered {
    position: fixed;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
}

.search-input-wrapper { display: flex; gap: 12px; margin-bottom: 10px; }
.search-input-wrapper input {
    flex: 1; background: rgba(255, 255, 255, 0.95); border: 2px solid #588157;
    color: #333; padding: 18px 24px; border-radius: 12px; font-size: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}
.search-input-wrapper input::placeholder { color: rgba(0, 0, 0, 0.5); }
.search-input-wrapper input:focus {
    outline: none;
    border-color: #3d5a40;
    box-shadow: 0 8px 40px rgba(88, 129, 87, 0.5);
}
.search-input-wrapper button {
    padding: 18px 32px; background: linear-gradient(135deg, #588157 0%, #3d5a40 100%);
    border: none; color: white; border-radius: 12px; font-size: 16px; cursor: pointer;
    font-weight: 600; transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(88, 129, 87, 0.4);
}
.search-input-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 129, 87, 0.6);
}
.search-input-wrapper button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Go-To checkbox */
.goto-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px;
    background: rgba(163, 177, 138, 0.1);
    border-radius: 6px;
    cursor: pointer;
}
.goto-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.goto-checkbox label {
    color: #a3b18a;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.search-results {
    margin-top: 12px; max-height: 250px; overflow-y: auto;
    background: rgba(163, 177, 138, 0.1); padding: 12px; border-radius: 8px;
}
.search-results h4 {
    color: #a3b18a; font-size: 13px; margin-bottom: 10px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.result-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; background: rgba(163, 177, 138, 0.15); border-radius: 6px; margin-bottom: 8px;
    border-left: 3px solid #588157;
    transition: all 0.2s ease;
    cursor: pointer;
}
.result-item:hover {
    background: rgba(163, 177, 138, 0.25);
    border-left-color: #3d5a40;
}
.result-item .index { color: #dad7cd; font-weight: 600; font-size: 13px; }
.result-item .similarity {
    color: #a3b18a; font-size: 12px; font-weight: 600;
    background: rgba(163, 177, 138, 0.2); padding: 3px 8px; border-radius: 4px;
}

.click-popup {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98) 0%, rgba(30, 30, 50, 0.98) 100%);
    padding: 24px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px); border: 1px solid rgba(163, 177, 138, 0.3); z-index: 20000;
    min-width: 320px; max-width: 500px; display: none; animation: popupSlideIn 0.3s ease-out;
}
@keyframes popupSlideIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
.click-popup.show { display: block; }
.popup-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid rgba(163, 177, 138, 0.2);
}
.popup-header h3 { color: #a3b18a; font-size: 16px; font-weight: 600; margin: 0; }
.popup-close {
    background: rgba(163, 177, 138, 0.2); border: none; color: #dad7cd;
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
    font-size: 18px; line-height: 1; transition: all 0.2s ease;
}
.popup-close:hover { background: rgba(255, 107, 107, 0.3); transform: scale(1.1); }
.popup-content { color: #e0e0e0; }
.popup-field {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; background: rgba(163, 177, 138, 0.1); border-radius: 8px;
    margin-bottom: 8px;
}
.popup-field label { color: #aaa; font-size: 13px; }
.popup-field .value {
    color: #a3b18a; font-weight: 600; font-size: 14px;
    padding: 4px 12px; background: rgba(163, 177, 138, 0.2);
    border-radius: 6px; font-family: 'Courier New', monospace;
}
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 19999; display: none;
}
.popup-overlay.show { display: block; }

.toggle-bbox {
    margin-top: 10px; padding: 10px; background: rgba(163, 177, 138, 0.1);
    border-radius: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer;
    transition: background 0.2s ease;
}
.toggle-bbox:hover { background: rgba(163, 177, 138, 0.15); }
.toggle-bbox input[type="checkbox"] {
    width: 18px; height: 18px; cursor: pointer;
}
.toggle-bbox label {
    color: #a3b18a; font-size: 13px; cursor: pointer; user-select: none;
}

.status { padding: 10px; background: rgba(163, 177, 138, 0.1); border-radius: 6px; color: #aaa; font-size: 12px; text-align: center; margin-top: 10px; }
.stats { margin-top: 10px; padding: 8px; background: rgba(163, 177, 138, 0.05); border-radius: 6px; color: #888; font-size: 12px; line-height: 1.6; display: none; }
.stats.active { display: block; }
.loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 18px; display: none; }
.error-message { color: #ff6b6b; margin-top: 10px; padding: 10px; background: rgba(255, 107, 107, 0.1); border-radius: 6px; display: none; font-size: 12px; }
.success-message { color: #a3b18a; margin-top: 10px; padding: 10px; background: rgba(163, 177, 138, 0.2); border-radius: 6px; display: none; font-size: 12px; }

/* Knowledge Graph Panel - Collapsible on the RIGHT */
.kg-panel {
    position: fixed;
    right: 0;
    top: 53px;
    bottom: 0;
    width: 450px;
    background: linear-gradient(135deg, #3d5a40 0%, #588157 100%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 16px rgba(0,0,0,0.3);
}
.kg-panel.open {
    transform: translateX(0);
}
.kg-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(218, 215, 205, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kg-panel-header h3 {
    color: #dad7cd;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.kg-panel-close {
    background: rgba(218, 215, 205, 0.2);
    border: none;
    color: #dad7cd;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kg-panel-close:hover {
    background: rgba(255, 107, 107, 0.5);
    color: #fff;
}
.kg-panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#graph-svg {
    width: 100%;
    height: 100%;
}

.kg-node { cursor: pointer; transition: all 0.2s ease; }
.kg-node circle { fill: #dad7cd; stroke: #a3b18a; stroke-width: 2.5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.kg-node:hover circle { fill: #a3b18a; stroke-width: 3px; }
.kg-node.selected circle { fill: #ffa726; stroke: #dad7cd; stroke-width: 3.5px; filter: drop-shadow(0 4px 8px rgba(255,167,38,0.5)); }
.kg-node.highlighted circle { fill: #ff0000; stroke: #fff; stroke-width: 4px; filter: drop-shadow(0 4px 12px rgba(255,0,0,0.8)); }
.kg-node text { font-size: 13px; font-weight: 600; fill: #fff; text-anchor: middle; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.kg-node image { pointer-events: all; cursor: pointer; }
.kg-node.preview-mode circle { display: none; }
.kg-node.preview-mode .node-label { font-size: 12px; font-weight: 600; fill: #fff; text-anchor: middle; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.kg-node.preview-mode:hover image { filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.kg-node.preview-mode.selected image { filter: drop-shadow(0 4px 12px rgba(255,167,38,0.8)); }
.kg-node.preview-mode.highlighted image { filter: drop-shadow(0 4px 12px rgba(255,0,0,0.8)); }
.kg-link { stroke: rgba(218, 215, 205, 0.3); stroke-width: 2px; }

.kg-tooltip {
    position: fixed; background: #fff; color: #333; padding: 20px; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3); pointer-events: none; opacity: 0;
    transition: opacity 0.3s ease; max-width: 450px; font-size: 15px; line-height: 1.6;
    z-index: 15000; border: 3px solid #588157;
}
.kg-tooltip.visible { opacity: 1; }
.kg-tooltip-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px solid #e0e0e0; }
.kg-tooltip-icon { width: 32px; height: 32px; background: #588157; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 14px; }
.kg-tooltip-image { width: 100%; max-width: 200px; height: auto; border-radius: 8px; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.kg-tooltip h3 { margin: 0; color: #3d5a40; font-size: 18px; font-weight: 600; }
.kg-tooltip-body { color: #555; font-size: 14px; }

.kg-info {
    position: absolute; top: 20px; left: 20px; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px); padding: 20px; border-radius: 12px; font-size: 14px;
    max-width: 280px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); color: #fff;
}
.kg-info h2 { font-size: 18px; margin-bottom: 12px; color: #dad7cd; font-weight: 600; }
.kg-info p { margin: 8px 0; display: flex; justify-content: space-between; align-items: center; }
.kg-info strong { color: #fff; }
.kg-info .count { background: #a3b18a; color: #fff; padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 13px; }
.kg-toggle-container { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.2); }
.kg-toggle-label { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.kg-toggle-switch { position: relative; width: 50px; height: 26px; background: rgba(255,255,255,0.3); border-radius: 13px; transition: background 0.3s; }
.kg-toggle-switch.active { background: #a3b18a; }
.kg-toggle-slider { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.3s; }
.kg-toggle-switch.active .kg-toggle-slider { transform: translateX(24px); }
.kg-info .hint { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 12px; opacity: 0.8; line-height: 1.5; }

/* KG Toggle Button */
.kg-toggle-btn {
    position: fixed;
    right: 20px;
    top: 55px;
    background: linear-gradient(135deg, #588157 0%, #3d5a40 100%);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 8999;
    box-shadow: 0 4px 12px rgba(88, 129, 87, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}
.kg-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 129, 87, 0.6);
}
.kg-toggle-btn.hidden {
    display: none;
}
.kg-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* BOM List Panel */
.segments-panel {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 300px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(163, 177, 138, 0.3);
    border-radius: 12px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.segments-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(163, 177, 138, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.segments-panel-header h3 {
    color: #a3b18a;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.segments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.segment-item {
    background: rgba(163, 177, 138, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 3px solid #588157;
    transition: all 0.2s ease;
    cursor: pointer;
}
.segment-item:hover {
    background: rgba(163, 177, 138, 0.2);
    border-left-color: #3d5a40;
}
.segment-item.highlighted {
    background: rgba(255, 0, 0, 0.2);
    border-left-color: #ff0000;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
}
.segment-item-id {
    color: #a3b18a;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}
.segment-item-title {
    color: #dad7cd;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}
.segment-item-desc {
    color: #aaa;
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   RESPONSIVE DESIGN - Media Queries
   ============================================ */

/* Tablet: 768px - 1199px */
@media (max-width: 1199px) {
    .hero-title { font-size: 42px; }
    .video-container { max-width: 600px; }
    .use-cases-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .tech-timeline { flex-wrap: wrap; gap: 32px; }
    .tech-timeline::before { display: none; }

    .controls { width: 280px; }
    .search-centered { max-width: 500px; }
    .kg-panel { width: 350px; }
    #canvas-container.with-kg-panel { width: calc(100% - 350px); }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
    /* Hero Navigation */
    .hero-nav { padding: 15px 20px; }
    .hero-brand { font-size: 20px; }

    .hero-nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        gap: 0;
        padding: 0;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        display: none;
    }

    .hero-nav-links.mobile-active {
        display: flex;
    }

    .hero-nav-links a,
    .hero-nav-links .cta-button {
        width: 100%;
        padding: 16px 20px;
        text-align: left;
        border-radius: 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .hamburger-menu { display: flex; }

    /* Hero Content */
    .hero-content { padding: 40px 20px; }
    .hero-title { font-size: 36px; }
    .hero-tagline { font-size: 16px; margin-bottom: 30px; }
    .video-container { margin-bottom: 24px; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn-primary, .btn-secondary { width: 100%; }

    /* Sections */
    .section-use-cases,
    .section-technology { padding: 60px 20px; }

    .section-intro { font-size: 16px; margin-bottom: 32px; }
    .use-cases-grid { grid-template-columns: 1fr; gap: 16px; }

    .section-technology h2 { font-size: 28px; }
    .tech-timeline { flex-direction: column; gap: 24px; }
    .tech-timeline::before { display: none; }
    .tech-step { flex-direction: row; gap: 16px; }
    .tech-label { text-align: left; }

    /* Footer */
    .welcome-footer { padding: 30px 20px; }
    .footer-content { flex-direction: column; gap: 24px; }
    .footer-links { flex-direction: column; gap: 16px; text-align: center; }
    .footer-lang { order: -1; }
    .lang-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    /* Main Navigation */
    .main-nav {
        padding: 8px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .main-nav h1 { font-size: 14px; }
    #backToWelcome { margin-right: 0; margin-bottom: 5px; }

    /* Canvas */
    #canvas-container { height: 50vh !important; }
    #canvas-container.with-kg-panel { width: 100% !important; }

    /* Search Bar */
    .search-centered {
        top: 50px;
        width: 90%;
        max-width: none;
        left: 5%;
        transform: none;
        z-index: 9999;
    }
    .search-input-wrapper { flex-direction: column; gap: 8px; }
    .search-input-wrapper input {
        padding: 12px 16px;
        font-size: 16px;
        width: 100%;
    }
    .search-input-wrapper button {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
    }

    /* Controls Panel */
    .controls {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: none;
        border-radius: 0;
        margin-top: 120px;
        box-shadow: none;
        border-top: 1px solid rgba(163, 177, 138, 0.3);
    }

    /* BOM List in Controls */
    .segments-list {
        max-height: 200px !important;
    }

    /* Knowledge Graph Panel */
    .kg-panel {
        width: 100%;
        height: 50vh;
        bottom: 0;
        right: 0;
        transform: translateY(100%);
    }
    .kg-panel.open {
        transform: translateY(0);
    }
    .kg-toggle-btn {
        bottom: 10px;
        right: 10px;
        top: auto;
    }

    /* Popups */
    .click-popup {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    .kg-tooltip {
        max-width: 90%;
        font-size: 14px;
    }

    /* Touch Targets */
    button, .lang-btn, .segment-item, .result-item {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Hide complex features on mobile */
    .kg-info { display: none; }
    .stats { font-size: 11px; }
}

/* Small Mobile: < 480px */
@media (max-width: 479px) {
    .welcome-header h1 { font-size: 20px; }
    .welcome-header p { font-size: 14px; }
    .welcome-content { padding: 15px; }
    .use-case h3 { font-size: 18px; }
    .use-case p { font-size: 14px; }
    .demo-button {
        width: 100%;
        max-width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .lang-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .search-centered {
        top: 50px;
        width: 95%;
        left: 2.5%;
        z-index: 9999;
    }
    .search-input-wrapper input {
        font-size: 14px;
        padding: 10px 14px;
    }
    .search-input-wrapper button {
        font-size: 14px;
        padding: 10px 14px;
    }
    .controls { padding: 15px; }
    .controls h2 { font-size: 16px; }

    #canvas-container { height: 40vh !important; }

    /* KG close button larger on mobile */
    .kg-panel-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* Landscape on Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    #canvas-container { height: 60vh !important; }
    .welcome-content { max-height: 80vh; overflow-y: auto; }
}

/* Print Styles */
@media print {
    .lang-toggle, .main-nav, .controls, .kg-toggle-btn,
    .segments-panel, .search-centered { display: none; }
    #welcome-page { display: none; }
    #canvas-container { height: 100vh; }
}

/* Custom Modal */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.custom-modal-overlay.show {
    display: flex;
}

.custom-modal {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-modal h3 {
    color: #ff6b6b;
    font-size: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-modal p {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 12px;
}

.custom-modal ul {
    color: #bbb;
    margin: 16px 0;
    padding-left: 24px;
}

.custom-modal li {
    margin-bottom: 8px;
}

.custom-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.custom-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal-btn-cancel {
    background: #555;
    color: #fff;
}

.custom-modal-btn-cancel:hover {
    background: #666;
}

.custom-modal-btn-delete {
    background: #ff4444;
    color: #fff;
}

.custom-modal-btn-delete:hover {
    background: #cc0000;
}

.custom-modal-btn-ok {
    background: #588157;
    color: #fff;
}

.custom-modal-btn-ok:hover {
    background: #3d5a40;
}

.custom-modal.success h3 {
    color: #4caf50;
}

.custom-modal.error h3 {
    color: #ff6b6b;
}
