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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 40px;
    border-bottom: 3px solid #34495e;
}



.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 400;
}

.content {
    padding: 40px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
    font-weight: 600;
}

.section h3 {
    color: #34495e;
    font-size: 1.4em;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.section p {
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
}

.interactive-demo {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

input[type="range"] {
    width: 200px;
    cursor: pointer;
}

input[type="number"] {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    width: 100px;
}

button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #34495e;
}

button:active {
    background: #1a252f;
}

button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.plot-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 380px;
}

.formula {
    background: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #00838f;
    margin: 15px 0;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 1.1em;
}

.key-concept {
    background: #ecf0f1;
    border-left: 4px solid #2c3e50;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.key-concept h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.step.active .step-number {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.step-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.metrics-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    border: 2px solid #e0e0e0;
    text-align: center;
}

.metric-value {
    font-size: 2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 10px 0;
}

.metric-label {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.tree-visualization {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    overflow-x: auto;
}

.info-box {
    background: #fff9e6;
    border-left: 4px solid #f39c12;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.tree-container {
    background: white;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tree-node {
    cursor: pointer;
}

.tree-node circle {
    fill: #fff;
    stroke: #2c3e50;
    stroke-width: 2px;
}

.tree-node.split circle {
    fill: #ffffff;
    stroke: #2c3e50;
    stroke-width: 2.5px;
}

.tree-node.leaf circle {
    fill: #00695c;
}

.tree-node text {
    font-size: 12px;
    font-family: Arial, sans-serif;
    fill: #2c3e50;
}

.tree-link {
    fill: none;
    stroke: #95a5a6;
    stroke-width: 2px;
}

.step-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.step-controls button {
    padding: 10px 20px;
    min-width: 100px;
}

.current-step {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.trees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.single-tree-view {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    min-height: 500px;
    overflow: visible;
}

.single-tree-view h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.single-tree-view svg {
    overflow: visible;
}

.checkmark {
    color: #00695c;
    font-weight: bold;
}

.xmark {
    color: #c62828;
    font-weight: bold;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .content {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .section h2 {
        font-size: 1.4em;
    }

    /* Stack plots vertically on mobile */
    .plot-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stack sequential views vertically on mobile */
    .sequential-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stack tree grid on mobile */
    .trees-grid {
        grid-template-columns: 1fr !important;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
    }

    input[type="range"] {
        width: 100%;
    }

    /* Mobile-friendly comparison table */
    .comparison-table thead {
        display: none;
    }

    .comparison-table,
    .comparison-table tbody,
    .comparison-table tr,
    .comparison-table td {
        display: block;
        width: 100%;
    }

    .comparison-table tr {
        margin-bottom: 20px;
        border: 2px solid #2c3e50;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }

    .comparison-table td {
        text-align: left;
        padding: 10px 0;
        border: none !important;
        word-break: break-word;
        overflow-wrap: break-word;
        display: flex;
        gap: 10px;
    }

    .comparison-table td:first-child {
        font-size: 1.2em;
        font-weight: bold;
        color: #2c3e50;
        margin-bottom: 10px;
        border-bottom: 2px solid #e0e0e0 !important;
        padding-bottom: 10px;
        display: block;
    }

    .comparison-table td:before {
        content: attr(data-label);
        font-weight: bold;
        min-width: 110px;
        max-width: 110px;
        color: #2c3e50;
        flex-shrink: 0;
    }

    .comparison-table td:first-child:before {
        content: "";
        display: none;
    }
}

/* Hamburger Menu */
.hamburger {
    position: fixed;
    top: 20px;
    right: 20px; /* Changed from left to right */
    z-index: 1000;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    font-size: 28px;
    color: white;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
    background: #34495e;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.hamburger .menu-text {
    display: inline;
}

.hamburger .close-text {
    display: none;
}

.hamburger.active .menu-text {
    display: none;
}

.hamburger.active .close-text {
    display: inline;
    font-size: 32px;
}

/* Mobile */
@media (max-width: 768px) {
    .hamburger {
        top: 10px;
        right: 5px; /* Changed from left to right */
        width: 25px;
        height: 25px;
        font-size: 22px;
        background: rgba(44, 62, 80, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .hamburger:hover {
        background: rgba(44, 62, 80, 0.6);
    }
    
    .hamburger.active .close-text {
        font-size: 30px;
    }
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -350px; /* Changed from left: -350px */
    width: 300px;
    height: 100vh;
    background: #2c3e50;
    z-index: 999;
    transition: right 0.3s ease; /* Changed from left */
    overflow-y: auto;
    padding: 80px 30px 30px 30px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.3); /* Shadow on left side */
}

.nav-menu.active {
    right: 0; /* Changed from left: 0 */
}


.nav-menu h3 {
    color: white;
    font-size: 1.4em;
    margin-bottom: 30px; /* More space from close button */
    padding-bottom: 15px;
    padding-top: 10px; /* Space from top */
    border-bottom: 2px solid #34495e;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
}

.nav-menu li {
    margin-bottom: 15px;
}

.nav-menu a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1em;
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: #34495e;
    color: white;
    transform: translateX(5px);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}
