:root {
    --accent-color: #94A378;
    --bg-dark: #161616;
    --text-white: #ededed;
    --transition: all 0.3s ease;
}

.visualizer-section {
    padding: 10rem 10% 5rem;
    text-align: center;
    background: transparent;
}

.visualizer-title {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 4rem;
    font-weight: 700;
}

.visualizer-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.tab-btn {
    padding: 1rem 2.8rem;
    font-size: 1.6rem;
    background: transparent;
    color: var(--text-white);
    border: 2px solid var(--accent-color);
    border-radius: 4rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--accent-color);
    color: black;
    box-shadow: 0 0 25px var(--accent-color);
    transform: scale(1.05);
}

.visualizer-container {
    background: var(--bg-dark);
    padding: 3rem;
    border-radius: 2rem;
    border: 1px solid rgba(148, 163, 120, 0.2);
    min-height: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.viz-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.viz-content.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.viz-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.viz-controls input[type="number"] {
    background: #000;
    border: 2px solid var(--accent-color);
    color: var(--text-white);
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    width: 100px;
    font-size: 1.6rem;
}

.viz-display {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: auto;
    padding: 2rem;
}

/* Binary Search Styles */
.search-nodes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bs-node {
    width: 50px;
    height: 50px;
    background: black;
    border: 2px solid var(--accent-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-white);
    transition: var(--transition);
}

.bs-node.active-range {
    border-color: #ff9f43;
    box-shadow: 0 0 10px #ff9f43;
}

.bs-node.mid-point {
    background: #ff4757;
    border-color: #ff4757;
    transform: scale(1.1);
}

.bs-node.found {
    background: #2ed573;
    border-color: #2ed573;
    box-shadow: 0 0 20px #2ed573;
    transform: scale(1.2);
}

/* Sorting Styles */
.sorting-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 300px;
}

.bar {
    background: var(--accent-color);
    width: 100%;
    transition: height 0.1s ease, background 0.1s ease;
}

.bar.comparing {
    background: #ff4757;
    box-shadow: 0 0 15px #ff4757;
}

.bar.sorted {
    background: #2ed573;
    box-shadow: 0 0 15px #2ed573;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-white);
    font-size: 1.4rem;
}

.control-group input[type="range"] {
    accent-color: var(--accent-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .visualizer-section {
        padding: 8rem 5%;
    }

    .visualizer-title {
        font-size: 3rem;
    }

    .tab-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.4rem;
    }

    .viz-controls {
        gap: 1rem;
    }
}

