        :root {
            /* Sorting colors */
            --unsorted: #666666;
            --comparing-i: #FFC107;
            --comparing-j: #FF5733;
            --pivot: #9C27B0;
            --sorted: #4CAF50;
        }
           
      
        
        
        
        
        .main-container {
            max-width: 1400px;
            margin: 6rem auto 3rem;
            padding: 0 1.5rem;
        }
        
        .page-title {
            text-align: center;
            margin-bottom: 1.5rem;
            font-size: 2.5rem;
            background: linear-gradient(45deg, var(--accent), var(--accent-alt));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        /* Two-column layout */
        .content-wrapper {
            display: flex;
            flex-direction: row;
            gap: 1.5rem;
        }
        
        /* Left column - 75% */
        .visualization-column {
            flex: 3;
        }
        
        /* Right column - 25% */
        .controls-column {
            flex: 1;
        }
        
        .glass-panel {
            background-color: rgba(18, 18, 18, 0.7);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 16px;
            box-shadow: var(--shadow);
            border: 1px solid var(--glass-border);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            position: relative;
            overflow: hidden;
        }
        
        .glass-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, 
                rgba(0, 242, 255, 0.05), 
                rgba(138, 43, 226, 0.05));
            z-index: -1;
        }
        
        #controls {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        
        .control-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .control-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
        }
        
        button {
            background: linear-gradient(45deg, var(--accent), var(--accent-alt));
            color: var(--black);
            padding: 0.8rem 1.2rem;
            border-radius: 30px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        
        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }
        
        button::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, var(--accent-alt), var(--accent));
            border-radius: 30px;
            z-index: -1;
            transition: opacity 0.3s ease;
            opacity: 0;
        }
        
        button:hover::before {
            opacity: 1;
        }
        
        select, input {
            background-color: rgba(0, 0, 0, 0.5);
            border: 1px solid var(--glass-border);
            color: var(--text);
            padding: 0.8rem 1rem;
            border-radius: 10px;
            font-weight: 500;
            transition: all 0.3s ease;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 1em;
            padding-right: 2.5rem;
            width: 100%;
        }
        
        select:focus, input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.2);
        }
        
        .section-title {
            font-size: 1.3rem;
            margin-bottom: 1rem;
            color: var(--text);
            border-bottom: 1px solid var(--glass-border);
            padding-bottom: 0.5rem;
        }
        
        .legend {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-secondary);
        }
        
        .color-box {
            width: 1rem;
            height: 1rem;
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            flex-shrink: 0;
        }
        
        #container {
            width: 100%;
            height: 400px;
            position: relative;
            overflow: hidden;
        }
        
        #algorithm-title {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            background: linear-gradient(45deg, var(--accent), var(--accent-alt));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        #algorithm-description, #algorithm-complexity, #current-step {
            color: var(--text-secondary);
            margin-bottom: 1rem;
            font-size: 0.95rem;
        }
        
        #current-step {
            padding: 1rem;
            background-color: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            border-left: 3px solid var(--accent);
        }
        
        .stats-panel {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
            margin-top: 1rem;
        }
        
        .stat-box {
            background-color: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            padding: 0.75rem;
            text-align: center;
        }
        
        .stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
        }
        
        .stat-value {
            font-size: 1.2rem;
            font-weight: bold;
            color: var(--text);
        }
        
/* Just replace these existing rules with these updated ones */

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }
    
    .glass-panel {
        padding: 1rem;
    }
    
    #container {
        height: 280px; /* Changed from 250px to 280px to show bar values */
    }
    
    /* Add these new rules to fix flickering */
    .control-label, .section-title, #algorithm-title {
        white-space: nowrap;
        overflow: hidden;
    }
    
    #algorithm-description, #algorithm-complexity, #current-step {
        min-height: 2.5rem;
    }
    
    .stat-box {
        min-height: 3rem;
    }
    
    button {
        white-space: nowrap;
    }
}

/* Add this new rule for mobile button layout */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .visualization-column,
    .controls-column {
        flex: 1 1 100%;
        width: 100%;
        padding:auto;
    }
    
    #container {
        height: 350px;

    }
    
    /* Add mobile button row layout */
    #controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .control-group:nth-last-child(-n+2) {
        grid-column: span 1;
    }
}
