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

/* Navigation Bar */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-link.active {
    background-color: #3498db;
}

.nav-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.nav-button:hover {
    background-color: #c0392b;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001; /* Ensure it's above other elements */
}

.hamburger span {
    width: 25px;
    height: 4px; /* Made thicker */
    background-color: white;
    margin: 4px 0; /* More spacing */
    transition: 0.3s;
    border-radius: 2px;
    display: block; /* Ensure visibility */
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important; /* Force display on mobile */
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #2c3e50;
        flex-direction: column;
        padding: 1rem 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-link {
        padding: 1rem 2rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-button {
        margin: 1rem 2rem;
        width: calc(100% - 4rem);
    }
}

/* Tour Styles */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 2000;
    display: none;
}

.tour-highlight {
    position: relative;
    z-index: 2001;
    box-shadow: 0 0 0 4px #e74c3c, 0 0 0 9999px rgba(0,0,0,0.7);
    border-radius: 4px;
}

.tour-tooltip {
    position: absolute;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 300px;
    z-index: 2002;
}

@media (max-width: 768px) {
    .tour-tooltip {
        padding: 1rem;
        max-width: 90vw;
        font-size: 0.9rem;
    }
    
    .tour-tooltip h4 {
        font-size: 1.1rem;
    }
    
    .tour-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tour-btn {
        padding: 0.8rem 1rem;
        font-size: 1rem;
        width: 100%;
    }
}

.tour-tooltip h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.tour-tooltip p {
    margin: 0 0 1rem 0;
    color: #555;
}

.tour-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tour-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.tour-btn-next {
    background-color: #3498db;
    color: white;
}

.tour-btn-skip {
    background-color: #95a5a6;
    color: white;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding-top: 60px; /* Add padding for fixed navbar */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.control-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.control-panel h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.control-group small {
    color: #718096;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.control-group input[type="range"] {
    margin-bottom: 5px;
}

.control-group span {
    font-weight: 600;
    color: #667eea;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn.secondary:hover {
    background: #edf2f7;
}

.btn.danger {
    background: #fed7d7;
    color: #c53030;
    border: 2px solid #feb2b2;
}

.btn.danger:hover {
    background: #feb2b2;
}

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

.stats {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-weight: 600;
    color: #4a5568;
}

.stat span:last-child {
    color: #667eea;
    font-weight: 700;
}

.visualization-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.viz-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.viz-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* Prevent pinch zoom on mobile devices */
.viz-container {
    min-height: 300px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    touch-action: pan-y; /* Allow vertical scrolling but prevent zoom */
}

/* Prevent zoom on Plotly charts specifically */
.plotly .modebar {
    display: none !important;
}

.plotly .plotly-graph-div {
    touch-action: pan-y;
}

/* Prevent zoom on D3 visualizations */
.viz-container svg {
    touch-action: pan-y;
}

.network-node {
    fill: #667eea;
    stroke: #4c51bf;
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.network-node:hover {
    fill: #5a67d8;
    r: 12;
}

.network-link {
    stroke: #cbd5e0;
    stroke-width: 1;
    opacity: 0.6;
}

.network-link.active {
    stroke: #667eea;
    stroke-width: 3;
    opacity: 1;
}

.data-point {
    opacity: 0.8;
    stroke: white;
    stroke-width: 2;
}

.data-point.class-0 {
    fill: #ff6b6b;
}

.data-point.class-1 {
    fill: #4ecdc4;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 300px 1fr;
    }
    
    .visualization-area {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    body {
        padding-top: 60px; /* Adjust for smaller navbar */
    }
    
    .container {
        padding: 10px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        position: relative;
        top: 0;
        order: 2; /* Move control panel below visualizations on mobile */
    }
    
    .visualization-area {
        order: 1;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .viz-section {
        padding: 15px;
    }
    
    .viz-container {
        min-height: 250px;
    }
    
    .control-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        margin-bottom: 0;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .control-group input,
    .control-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    .viz-section {
        padding: 10px;
    }
    
    .viz-container {
        min-height: 200px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .stats {
        padding: 10px;
    }
    
    .stat {
        font-size: 0.9em;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Pulse animation for active nodes */
.pulse {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}
